casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DSCircle.h
Go to the documentation of this file.
1 //# DSCircle.h: Circle implementation for "DisplayShapes"
2 //# Copyright (C) 1998,1999,2000,2001,2002
3 //# Associated Universities, Inc. Washington DC, USA.
4 //#
5 //# This library is free software; you can redistribute it and/or modify it
6 //# under the terms of the GNU Library General Public License as published by
7 //# the Free Software Foundation; either version 2 of the License, or (at your
8 //# option) any later version.
9 //#
10 //# This library is distributed in the hope that it will be useful, but WITHOUT
11 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
13 //# License for more details.
14 //#
15 //# You should have received a copy of the GNU Library General Public License
16 //# along with this library; if not, write to the Free Software Foundation,
17 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
18 //#
19 //# Correspondence concerning AIPS++ should be addressed as follows:
20 //# Internet email: aips2-request@nrao.edu.
21 //# Postal address: AIPS++ Project Office
22 //# National Radio Astronomy Observatory
23 //# 520 Edgemont Road
24 //# Charlottesville, VA 22903-2475 USA
25 //#
26 //# $Id:
27 #ifndef TRIALDISPLAY_DSCIRCLE_H
28 #define TRIALDISPLAY_DSCIRCLE_H
29 
30 #include <casa/aips.h>
31 
33 #include <casa/Arrays/Matrix.h>
34 #include <casa/Arrays/Vector.h>
35 
36 
37 namespace casa { //# NAMESPACE CASA - BEGIN
38 
39 // <summary>
40 // Circle implementation;extends DSEllipse, adding general circle functions
41 // </summary>
42 //
43 // <prerequisite>
44 // <li> <linkto class="DSEllipse">DSEllipse</linkto>
45 // <li> <linkto class="DisplayShape">DisplayShape</linkto>
46 // </prerequisite>
47 //
48 // <etymology>
49 // DSCircle is a method of managing the drawing of a circle onto a PixelCanvas.
50 // </etymology>
51 //
52 // <synopsis>
53 // DSCircle simply extends from DSEllipse, and adds some general circle
54 // functionality. It basically replaces the set major and set minor axis
55 // functions with a setRadius function. Almost all of the functionality
56 // is contained in DSEllipse.
57 //
58 // There are generally two ways to make DisplayShape(s); To create them in
59 // "one hit" by providing arguments to the constructor, or by using the
60 // default constructor and then the "setOptions" method. A simple interface
61 // for all classes inheriting from the
62 // <linkto class="DisplayShape">DisplayShape</linkto> class is provided by
63 // <linkto class="DisplayShapeInterface">DisplayShapeInterface</linkto>.
64 // </synopsis>
65 //
66 // <motivation>
67 // To enable display of circles onto a pixel canvas.
68 // </motivation>
69 //
70 // <example>
71 // <srcblock>
72 // </srcblock>
73 // </example>
74 
75 
76 
77  class DSCircle : public DSEllipse {
78 
79  public:
80 
81  // Constructors and destructors.
82  // <group>
83  DSCircle();
84  DSCircle(const casacore::Float& xPos, const casacore::Float& yPos, const casacore::Float& radius,
85  const casacore::Bool& hasHandles, const casacore::Bool& drawHandles);
86  DSCircle(const DSCircle& other);
87  virtual ~DSCircle();
88  // </group>
89 
90  // General DisplayShape functionality
91  // <group>
92  virtual void rotate(const casacore::Float& /*angle*/) {};
93  virtual void setCenter(const casacore::Float& xPos, const casacore::Float& yPos);
94  virtual casacore::Bool inObject(const casacore::Float& dX, const casacore::Float& dY);
95  virtual void changePoint(const casacore::Vector<casacore::Float>& newPos);
96  virtual void changePoint(const casacore::Vector<casacore::Float>& newPos, const casacore::Int nPoint);
97  // </group>
98 
99  // Circle specific functionality
100  // <group>
101  virtual void setRadius(const casacore::Float& radius);
102  virtual void setMajorAxis(const casacore::Float& /*major*/) {};
103  virtual void setMinorAxis(const casacore::Float& /*minor*/) {};
104  // </group>
105 
106  // Get and set options
107  // <group>
108  virtual casacore::Bool setOptions(const casacore::Record& settings);
109  virtual casacore::Record getOptions();
110  // </group>
111 
112  private:
113  // casacore::Function to set defaults when default constructor called
114  virtual void setDefaultOptions();
115 
116  };
117 
118 } //# NAMESPACE CASA - END
119 
120 #endif
121 
122 
123 
124 
125 
126 
int Int
Definition: aipstype.h:50
Circle implementation;extends DSEllipse, adding general circle functions.
Definition: DSCircle.h:77
virtual casacore::Bool setOptions(const casacore::Record &settings)
Get and set options.
virtual ~DSCircle()
virtual void changePoint(const casacore::Vector< casacore::Float > &newPos)
Changes the closest point to the supplied location to that location.
virtual casacore::Bool inObject(const casacore::Float &dX, const casacore::Float &dY)
Is the supplied point within the DisplayShape?
virtual void setRadius(const casacore::Float &radius)
Circle specific functionality.
Implementation of a ellipse.
Definition: DSEllipse.h:71
virtual void setMinorAxis(const casacore::Float &)
Definition: DSCircle.h:103
A hierarchical collection of named fields of various types.
Definition: Record.h:180
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
virtual casacore::Record getOptions()
Get and set options.
float Float
Definition: aipstype.h:54
virtual void setDefaultOptions()
casacore::Function to set defaults when default constructor called
virtual void setMajorAxis(const casacore::Float &)
Definition: DSCircle.h:102
DSCircle()
Constructors and destructors.
virtual void rotate(const casacore::Float &)
General DisplayShape functionality.
Definition: DSCircle.h:92
virtual void setCenter(const casacore::Float &xPos, const casacore::Float &yPos)
Sets the center of the DisplayShape.