AnnRegion.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef REGIONS_ANNREGION_H
00018 #define REGIONS_ANNREGION_H
00019
00020 #include <coordinates/Coordinates/CoordinateSystem.h>
00021 #include <imageanalysis/Annotations/AnnotationBase.h>
00022 #include <images/Regions/WCBox.h>
00023 #include <images/Regions/ImageRegion.h>
00024 #include <measures/Measures/MDirection.h>
00025 #include <measures/Measures/MFrequency.h>
00026
00027 namespace casa {
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053 class AnnRegion: public AnnotationBase {
00054
00055 public:
00056
00057 virtual ~AnnRegion();
00058
00059 void setAnnotationOnly(const Bool isAnnotationOnly);
00060
00061
00062 Bool isAnnotationOnly() const;
00063
00064 virtual TableRecord asRecord() const;
00065
00066 virtual ImageRegion asImageRegion() const;
00067
00068
00069
00070 virtual CountedPtr<const WCRegion> getRegion() const;
00071
00072 virtual SHARED_PTR<const WCRegion> getRegion2() const;
00073
00074
00075 virtual Bool isRegion() const;
00076
00077 void setDifference(const Bool difference);
00078
00079 Bool isDifference() const;
00080
00081
00082
00083
00084
00085 vector<Double> getSpectralPixelRange() const;
00086
00087
00088 Bool setFrequencyLimits(
00089 const Quantity& beginFreq,
00090 const Quantity& endFreq,
00091 const String& freqRefFrame,
00092 const String& dopplerString,
00093 const Quantity& restfreq
00094 );
00095
00096 protected:
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109 AnnRegion(
00110 const Type shape,
00111 const String& dirRefFrameString,
00112 const CoordinateSystem& csys,
00113 const IPosition& imShape,
00114 const Quantity& beginFreq,
00115 const Quantity& endFreq,
00116 const String& freqRefFrame,
00117 const String& dopplerString,
00118 const Quantity& restfreq,
00119 const Vector<Stokes::StokesTypes> stokes,
00120 const Bool annotationOnly
00121 );
00122
00123
00124
00125
00126
00127
00128 AnnRegion(
00129 const Type shape,
00130 const CoordinateSystem& csys,
00131 const IPosition& imShape,
00132 const Vector<Stokes::StokesTypes>& stokes
00133 );
00134
00135
00136 AnnRegion(const AnnRegion& other);
00137
00138
00139 AnnRegion& operator= (const AnnRegion& rhs);
00140
00141 Bool operator== (const AnnRegion& other) const;
00142
00143
00144
00145
00146 void _extend();
00147
00148 void _toRecord(const ImageRegion& region);
00149
00150
00151 Quantity _lengthToAngle(
00152 const Quantity& quantity, const uInt pixelAxis
00153 ) const;
00154
00155 virtual void _printPrefix(ostream& os) const;
00156
00157
00158
00159 void _setDirectionRegion(const ImageRegion& region);
00160
00161 private:
00162
00163 Bool _isAnnotationOnly;
00164 Bool _isDifference, _constructing;
00165 ImageRegion _imageRegion, _directionRegion;
00166 IPosition _imShape;
00167 vector<Double> _spectralPixelRange;
00168
00169 static const String _class;
00170
00171 WCBox _makeExtensionBox(
00172 const Vector<Quantity>& freqRange,
00173 const Vector<Stokes::StokesTypes>& stokesRange,
00174 const IPosition& pixelAxes
00175 ) const;
00176
00177 void _init();
00178
00179 };
00180
00181
00182 class ToLCRegionConversionError : public AipsError {
00183 public:
00184 ToLCRegionConversionError(String msg) : AipsError(msg) {}
00185 };
00186
00187 }
00188
00189
00190
00191 #endif