QtWCBox.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
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #ifndef QT_WCBOX_H
00030 #define QT_WCBOX_H
00031
00032
00033 #include <casa/aips.h>
00034 #include <display/Display/DisplayCoordinateSystem.h>
00035 #include <images/Regions/WCRegion.h>
00036 #include <lattices/LRegions/RegionType.h>
00037 #include <casa/Arrays/Vector.h>
00038 #include <casa/Quanta/Quantum.h>
00039
00040 namespace casa {
00041
00042
00043 class LCRegion;
00044 class TableRecord;
00045 class IPosition;
00046
00047
00048 class QtWCBox : public WCRegion {
00049 public:
00050 QtWCBox();
00051
00052
00053
00054
00055
00056
00057 QtWCBox(const Vector<Quantum<Double> >& blc,
00058 const Vector<Quantum<Double> >& trc,
00059 const DisplayCoordinateSystem& cSys,
00060 const Vector<Int>& absRel);
00061
00062
00063
00064
00065
00066
00067 QtWCBox(const Vector<Quantum<Double> >& blc,
00068 const Vector<Quantum<Double> >& trc,
00069 const IPosition& pixelAxes,
00070 const DisplayCoordinateSystem& cSys,
00071 const Vector<Int>& absRel);
00072
00073
00074
00075 QtWCBox(const LCRegion& region,
00076 const DisplayCoordinateSystem& cSys);
00077
00078
00079 QtWCBox (const QtWCBox& other);
00080
00081
00082 virtual ~QtWCBox();
00083
00084
00085 QtWCBox& operator= (const QtWCBox& other);
00086
00087
00088 virtual Bool operator==(const WCRegion& other) const;
00089
00090
00091 virtual WCRegion* cloneRegion() const;
00092
00093
00094 virtual Bool canExtend() const;
00095
00096
00097 QtWCBox splitBox (const IPosition& axes) const;
00098
00099
00100
00101 virtual LCRegion* doToLCRegion (const CoordinateSystem& cSys,
00102 const IPosition& latticeShape,
00103 const IPosition& pixelAxesMap,
00104 const IPosition& outOrder) const;
00105
00106
00107
00108
00109
00110 virtual TableRecord toRecord(const String& tableName) const;
00111
00112
00113 static QtWCBox* fromRecord (const TableRecord& rec,
00114 const String& tableName);
00115
00116
00117 static String className();
00118
00119
00120 virtual String type() const;
00121
00122
00123 String toBoxString() const;
00124 static QtWCBox* fromBoxString(const String&,
00125 const DisplayCoordinateSystem& cSys, String& err);
00126
00127
00128
00129 void setChanExt(const Double, const Double);
00130 Bool getChanExt(Double&, Double&);
00131
00132
00133
00134 void setPolExt(const Double, const Double);
00135 Bool getPolExt(Double&, Double&);
00136
00137 static void unitInit();
00138
00139 private:
00140 Vector<Quantum<Double> > itsBlc;
00141 Vector<Quantum<Double> > itsTrc;
00142 IPosition itsPixelAxes;
00143 DisplayCoordinateSystem itsCSys;
00144 Vector<Int> itsAbsRel;
00145 Bool itsNull;
00146
00147
00148
00149 void checkUnits (const IPosition& pixelAxes,
00150 const Vector<Quantum<Double> >& values,
00151 const DisplayCoordinateSystem& cSys);
00152
00153
00154 void convertPixel(Double& pixel,
00155 const Quantum<Double>& value,
00156 const Int absRel,
00157 const Double refPix,
00158 const Int shape,
00159 const Bool isBlc) const;
00160
00161 };
00162
00163
00164
00165 }
00166
00167 #endif