RegionInfo.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 REGION_REGIONINFO_H_
00030 #define REGION_REGIONINFO_H_
00031
00032 #include <list>
00033 #include <string>
00034 #include <images/Images/ImageStatistics.h>
00035
00036 namespace casa {
00037
00038
00039 namespace viewer {
00040
00041 class Polyline;
00042
00043
00044 class RegionInfo {
00045 public:
00046
00047 enum InfoTypes { MsInfoType, ImageInfoType, SliceInfoType, PVLineInfoType, InvalidInfoType };
00048
00049 typedef ImageStatistics<Float>::stat_list stats_t;
00050
00051
00052
00053 typedef stats_t center_t;
00054
00055 RegionInfo( ) : stat_list_( ), type_(InvalidInfoType) { }
00056 RegionInfo( const RegionInfo &other ) : stat_list_(other.stat_list_), label_(other.label_), description_(other.description_), type_( other.type_) { }
00057 virtual ~RegionInfo( ) { }
00058
00059 SHARED_PTR<stats_t> &list( ) {
00060 return stat_list_;
00061 }
00062 const std::string &label( ) const {
00063 return label_;
00064 }
00065 const std::string &description( ) const {
00066 return description_;
00067 }
00068 InfoTypes type( ) const {
00069 return type_;
00070 }
00071
00072 protected:
00073 RegionInfo( const std::string &label, const std::string &desc, stats_t *si, InfoTypes t ) : stat_list_(si), label_(label), description_(desc), type_(t) { }
00074
00075 private:
00076 SHARED_PTR<stats_t> stat_list_;
00077 std::string label_;
00078 std::string description_;
00079 InfoTypes type_;
00080 };
00081
00082 class MsRegionInfo : public RegionInfo {
00083 public:
00084 MsRegionInfo( const std::string &label, const std::string &desc, stats_t *si ) : RegionInfo(label,desc,si,MsInfoType) { }
00085 ~MsRegionInfo( ) { }
00086 };
00087
00088 class ImageRegionInfo : public RegionInfo {
00089 public:
00090 ImageRegionInfo( const std::string &label, const std::string &desc, stats_t *si ) : RegionInfo(label,desc,si,ImageInfoType) { }
00091 ~ImageRegionInfo( ) { }
00092 };
00093
00094 class SliceRegionInfo : public RegionInfo {
00095 public:
00096 SliceRegionInfo( const std::string &label, const std::string &desc, stats_t *si, Polyline* polyline ) :
00097 RegionInfo(label,desc,si,SliceInfoType), region(polyline) { }
00098 Polyline* getRegion(){
00099 return region;
00100 }
00101 ~SliceRegionInfo( ) { }
00102 private:
00103 Polyline* region;
00104 };
00105
00106 class PVLineRegionInfo : public RegionInfo {
00107 public:
00108 PVLineRegionInfo( const std::string &label, const std::string &desc, stats_t *si,
00109 const std::vector<std::string> &ps, const std::vector<std::string> &ws,
00110 const std::string &pa, const std::string &sep ) :
00111 RegionInfo(label,desc,si,PVLineInfoType), pixel_strings_(ps), world_strings_(ws),
00112 position_angle(pa), point_separation(sep) { }
00113 ~PVLineRegionInfo( ) { }
00114 std::vector<std::string> pixelStrings( ) const {
00115 return pixel_strings_;
00116 }
00117 std::vector<std::string> worldStrings( ) const {
00118 return world_strings_;
00119 }
00120 const std::string &positionAngle( ) const {
00121 return position_angle;
00122 }
00123 const std::string &separation( ) const {
00124 return point_separation;
00125 }
00126 private:
00127 std::vector<std::string> pixel_strings_;
00128 std::vector<std::string> world_strings_;
00129 std::string position_angle;
00130 std::string point_separation;
00131 };
00132
00133
00134 }
00135 }
00136
00137 #endif