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_POINT_H_
00030 #define REGION_POINT_H_
00031
00032 #include <display/Display/MouseToolState.h>
00033 #include <display/region/Rectangle.h>
00034 #include <casa/BasicSL/String.h>
00035 #include <list>
00036
00037 namespace casa {
00038
00039 class PanelDisplay;
00040 class AnnRegion;
00041 class PixelCanvas;
00042
00043 namespace viewer {
00044
00045
00046 class QtRegionSourceKernel;
00047
00048
00049
00050
00051 class Point : public Rectangle {
00052 public:
00053 ~Point( );
00054 Point( WorldCanvas *wc, QtRegionDock *d, double x, double y, QtMouseToolNames::PointRegionSymbols sym ) :
00055 Rectangle( wc, d, x, y, x, y ), marker_(sym) {
00056
00057 }
00058
00059
00060 Point( QtRegionSourceKernel *factory, WorldCanvas *wc, double x, double y, bool hold_signals=false, QtMouseToolNames::PointRegionSymbols sym=QtMouseToolNames::SYM_DOT ) :
00061 Rectangle( "point", wc, factory->dock( ), x, y, x, y,
00062 hold_signals, new QtPointState( QString("point"), sym ), sym ), marker_(sym) {
00063 mystate->setRegion(this);
00064
00065 }
00066
00067 bool setMarker( QtMouseToolNames::PointRegionSymbols sym );
00068
00069 int clickHandle( double , double ) const {
00070 return 0;
00071 }
00072
00073 bool clickWithin( double x, double y ) const;
00074
00075
00076 region::PointInfo checkPoint( double x, double y ) const;
00077
00078
00079 unsigned int mouseMovement( double x, double y, bool other_selected );
00080 void resize( double, double ) { }
00081
00082 AnnotationBase *annotation( ) const;
00083
00084
00085 bool degenerate( ) const {
00086 return false;
00087 }
00088
00089
00090 region::RegionTypes type( ) const {
00091 return region::PointRegion;
00092 }
00093
00094 void releaseSignals( );
00095
00096 protected:
00097
00098 static const int radius;
00099
00100 virtual void fetch_region_details( region::RegionTypes &type, std::vector<std::pair<int,int> > &pixel_pts,
00101 std::vector<std::pair<double,double> > &world_pts ) const;
00102
00103 void drawRegion( bool );
00104
00105 std::list<SHARED_PTR<RegionInfo> > *generate_dds_centers( );
00106
00107 QtMouseToolNames::PointRegionSymbols marker_;
00108
00109 private:
00110 virtual bool output_region( ds9writer &out, WorldCanvas *wc, const std::vector<std::pair<double,double> > &pts ) const;
00111 void draw_arrow( PixelCanvas *, int , int , int , int ,
00112 int , int );
00113
00114 };
00115 }
00116 }
00117
00118 #endif