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 // semi-major and semi-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 elliptical region as specified in ASCII format.
00042 // Specified by center position, semi-major and semi-minor axes, and position angle.
00043 // </etymology>
00044 
00045 // <synopsis>
00046 // This class represents an annotation of an elliptical region in coordinate space specified by
00047 // center, semi-major and semi-minor axes, and position angle
00048 // </synopsis>
00049 
00050 class AnnEllipse: public AnnRegion {
00051 
00052 public:
00053 
00054         // <src>positionAngle</src> is defined as the angle between north and the
00055         // ellipse major axis. Note the lengths are for the semi-major and semi-minor axes,
00056         // not the major and minor axes
00057         // <group>
00058 
00059         AnnEllipse(
00060                 const Quantity& xcenter, const Quantity& ycenter,
00061                 const Quantity& semiMajorAxis,
00062                 const Quantity& semiMinorAxis, 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& semiMajorAxis,
00084                 const Quantity& semiMinorAxis, const Quantity& positionAngle,
00085                 const CoordinateSystem& csys,
00086                 const IPosition& imShape,
00087                 const Vector<Stokes::StokesTypes>& stokes
00088         );
00089 
00090         // implicit copy constructor and destructor are fine
00091 
00092         //</group>
00093 
00094         AnnEllipse& operator=(const AnnEllipse& other);
00095 
00096         Bool operator==(const AnnEllipse& other) const;
00097 
00098         // Get the center position, tranformed to the reference
00099         // from of the coordinate system if necessary
00100         MDirection getCenter() const;
00101 
00102         // get semi-major axis. The quantity will have units
00103         // of angular measure
00104         Quantity getSemiMajorAxis() const;
00105 
00106         // get semi-minor axis. The quantity will have units
00107         // of angular measure
00108         Quantity getSemiMinorAxis() const;
00109 
00110         // get position angle. The quantity will have units
00111         // of angular measure and will be measured from north through east,
00112         // using the normal astronomical convention.
00113         Quantity getPositionAngle() const;
00114 
00115         virtual ostream& print(ostream &os) const;
00116 
00117 
00118 private:
00119         AnnotationBase::Direction _inputCenter;
00120         Quantity _inputSemiMajorAxis, _inputSemiMinorAxis, _inputPositionAngle,
00121                 _convertedSemiMajorAxis, _convertedSemiMinorAxis,
00122                 _convertedPositionAngle;
00123 
00124         void _init(     const Quantity& xcenter, const Quantity& ycenter);
00125 };
00126 
00127 }
00128 
00129 #endif /* ASCIIELLIPSEREGION_H_ */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 31 Aug 2016 for casa by  doxygen 1.6.1