casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
AnnEllipse.h
Go to the documentation of this file.
00001 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00002 //# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public
00003 //# License for more details.
00004 //#
00005 //# You should have received a copy of the GNU Library General Public License
00006 //# along with this library; if not, write to the Free Software Foundation,
00007 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
00008 //#
00009 //# Correspondence concerning AIPS++ should be addressed as follows:
00010 //#        Internet email: aips2-request@nrao.edu.
00011 //#        Postal address: AIPS++ Project Office
00012 //#                        National Radio Astronomy Observatory
00013 //#                        520 Edgemont Road
00014 //#                        Charlottesville, VA 22903-2475 USA
00015 //#
00016 
00017 #ifndef ANNOTATIONS_ANNELLIPSE_H
00018 #define ANNOTATIONS_ANNELLIPSE_H
00019 
00020 #include <imageanalysis/Annotations/AnnRegion.h>
00021 
00022 
00023 #include <casa/aips.h>
00024 
00025 namespace casa {
00026 
00027 // <summary>
00028 // This class represents an annotation of an elliptical (in position coordinates) region specified
00029 // in an ascii region file as proposed in CAS-2285. It is specified by its center position
00030 // major and minor axes, and position angle.
00031 // </summary>
00032 // <author>Dave Mehringer</author>
00033 // <use visibility=export>
00034 // <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos="">
00035 // </reviewed>
00036 // <prerequisite>
00037 
00038 // </prerequisite>
00039 
00040 // <etymology>
00041 // Holds the specification of a an annotation of an annular region as specified in ASCII format.
00042 // Specified by center position, major and minor axes, and position angle.
00043 // </etymology>
00044 
00045 // <synopsis>
00046 // This class represents an annotation of an annular region in coordinate space specified by
00047 // center, major and minor axes, and position angle
00048 // </synopsis>
00049 
00050 
00051 class AnnEllipse: public AnnRegion {
00052 
00053 public:
00054 
00055         // <src>positionAngle</src> is defined as the angle between north and the
00056         // ellipse major axis.
00057         // <group>
00058 
00059         AnnEllipse(
00060                 const Quantity& xcenter, const Quantity& ycenter,
00061                 const Quantity& majorAxis,
00062                 const Quantity& minorAxis, const Quantity& positionAngle,
00063                 const String& dirRefFrameString,
00064                 const CoordinateSystem& csys,
00065                 const IPosition& imShape,
00066                 const Quantity& beginFreq,
00067                 const Quantity& endFreq,
00068                 const String& freqRefFrameString,
00069                 const String& dopplerString,
00070                 const Quantity& restfreq,
00071                 const Vector<Stokes::StokesTypes> stokes,
00072                 const Bool annotationOnly
00073         );
00074 
00075         // Simplified constructor.
00076         // all frequencies are used (these can be set after construction).
00077         // xcenter and ycenter
00078         // must be in the same frame as the csys direction coordinate.
00079         // is a region (not just an annotation), although this value can be changed after
00080         // construction.
00081         AnnEllipse(
00082                 const Quantity& xcenter, const Quantity& ycenter,
00083                 const Quantity& majorAxis,
00084                 const Quantity& minorAxis, const Quantity& positionAngle,
00085                 const CoordinateSystem& csys,
00086                 const IPosition& imShape,
00087                 const Vector<Stokes::StokesTypes>& stokes
00088         );
00089 
00090 
00091         // implicit copy constructor and destructor are fine
00092 
00093         //</group>
00094 
00095         AnnEllipse& operator=(const AnnEllipse& other);
00096 
00097         // Get the center position, tranformed to the reference
00098         // from of the coordinate system if necessary
00099         MDirection getCenter() const;
00100 
00101         // get major axis. The quantity will have units
00102         // of angular measure
00103         Quantity getMajorAxis() const;
00104 
00105         // get minor axis. The quantity will have units
00106         // of angular measure
00107         Quantity getMinorAxis() const;
00108 
00109         // get position angle. The quantity will have units
00110         // of angular measure
00111         Quantity getPositionAngle() const;
00112 
00113         virtual ostream& print(ostream &os) const;
00114 
00115 
00116 private:
00117         AnnotationBase::Direction _inputCenter;
00118         Quantity _inputMajorAxis, _inputMinorAxis, _inputPositionAngle,
00119                 _convertedMajorAxis, _convertedMinorAxis;
00120 
00121         void _init(     const Quantity& xcenter, const Quantity& ycenter);
00122 };
00123 
00124 }
00125 
00126 #endif /* ASCIIELLIPSEREGION_H_ */