casa
$Rev:20696$
|
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_ANNRECTBOX_H 00018 #define ANNOTATIONS_ANNRECTBOX_H 00019 00020 #include <casa/aips.h> 00021 #include <imageanalysis/Annotations/AnnRegion.h> 00022 00023 namespace casa { 00024 00025 // <summary> 00026 // This class represents an annotation for rectangular (in position coordinates) region specified 00027 // in an ascii region file as proposed in CAS-2285 00028 // </summary> 00029 // <author>Dave Mehringer</author> 00030 // <use visibility=export> 00031 // <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos=""> 00032 // </reviewed> 00033 // <prerequisite> 00034 00035 // </prerequisite> 00036 00037 // <etymology> 00038 // Holds the specification of an annotation for a rectangular region as specified in ASCII format. 00039 // </etymology> 00040 00041 // <synopsis> 00042 // This class represents an annotaton for a rectangular region in coordinate space. 00043 // </synopsis> 00044 00045 00046 class AnnRectBox: public AnnRegion { 00047 00048 public: 00049 00050 AnnRectBox( 00051 const Quantity& blcx, 00052 const Quantity& blcy, 00053 const Quantity& trcx, 00054 const Quantity& trcy, 00055 const String& dirRefFrameString, 00056 const CoordinateSystem& csys, 00057 const IPosition& imShape, 00058 const Quantity& beginFreq, 00059 const Quantity& endFreq, 00060 const String& freqRefFrameString, 00061 const String& dopplerString, 00062 const Quantity& restfreq, 00063 const Vector<Stokes::StokesTypes> stokes, 00064 const Bool annotationOnly 00065 ); 00066 00067 // Simplified constructor. 00068 // all frequencies are used (these can be set after construction). 00069 // blcx, blcy, trcx, and trcy 00070 // must be in the same frame as the csys direction coordinate. 00071 // is a region (not just an annotation), although this value can be changed after 00072 // construction. 00073 AnnRectBox( 00074 const Quantity& blcx, 00075 const Quantity& blcy, 00076 const Quantity& trcx, 00077 const Quantity& trcy, 00078 const CoordinateSystem& csys, 00079 const IPosition& imShape, 00080 const Vector<Stokes::StokesTypes>& stokes 00081 ); 00082 00083 // implicit copy constructor and destructor are fine 00084 00085 AnnRectBox& operator=(const AnnRectBox& other); 00086 00087 // get the blc and trc direction coords for the box. 00088 // The output directions will be converted from the input 00089 // reference frame to the reference frame of the input 00090 // coordinate system if necessary. 00091 // blc is the 0th component, trc the 1st in the returned vector. 00092 00093 Vector<MDirection> getCorners() const; 00094 00095 ostream& print(ostream &os) const; 00096 00097 private: 00098 AnnotationBase::Direction _inputCorners; 00099 00100 void _init( 00101 const Quantity& blcx, const Quantity& blcy, 00102 const Quantity& trcx, const Quantity& trcy 00103 ); 00104 00105 }; 00106 00107 } 00108 00109 #endif