ComponentListWrapper.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 #ifndef COMPONENTLISTWRAPPER_H_
00027 #define COMPONENTLISTWRAPPER_H_
00028
00029 #include <casa/BasicSL/String.h>
00030 #include <components/ComponentModels/ComponentList.h>
00031 #include <QTextStream>
00032 namespace casa {
00033
00034 template <class T> class ImageInterface;
00035 class RegionShape;
00036 class RegionBox;
00037
00042 class ComponentListWrapper {
00043 public:
00044 ComponentListWrapper();
00045 int getSize() const;
00046 string getRA( int i ) const;
00047 string getDEC( int i ) const;
00048 string getType( int i ) const;
00049 const ComponentShape* getShape( int i ) const;
00050 Quantity getMajorAxis( int i ) const;
00051 Quantity getMinorAxis( int i ) const;
00052 Quantity getAngle( int i ) const;
00053 Quantum< Vector<double> > getLatLong( int i ) const;
00054 Quantity getFlux( int i ) const;
00055
00056 void clear();
00057 void remove( QVector<int> indices );
00058 void fromComponentList( ComponentList list );
00059 bool fromRecord( String& errorMsg, Record& record );
00060 bool toEstimateFile( QTextStream& stream,
00061 const ImageInterface<Float>*const image, QString& errorMsg,
00062 bool screenEstimates = false, RegionBox* screenBox = NULL) const;
00063 QList<RegionShape*> toDrawingDisplay(const ImageInterface<Float>* image, const QString& colorName) const;
00064 bool toRegionFile(const ImageInterface<float>* image, int channelIndex, const QString& filePath ) const;
00065 virtual ~ComponentListWrapper();
00066
00067 private:
00068 void toRecord( Record& record, const Quantity& quantity ) const;
00069 double getRAValue( int i, const String& unit ) const;
00070 double getDECValue( int i, const String& unit ) const;
00071 double radiansToDegrees( double value ) const;
00072 double degreesToArcSecs( double Value ) const;
00073 Quantity getAxis( int listIndex, int shapeIndex, bool toArcSecs ) const;
00074 double rotateAngle( double value ) const;
00075 void deconvolve(const ImageInterface<float>* image, int channel,
00076 Quantity& majorAxis, Quantity& minorAxis, Quantity& positionAngle) const;
00077
00078 ComponentList skyList;
00079 const String RAD;
00080 const String DEG;
00081 const String ARC_SEC;
00082 };
00083
00084 }
00085 #endif