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 #ifndef QTMWCTOOLS_H
00028 #define QTMWCTOOLS_H
00029
00030 #include <casa/aips.h>
00031
00032 #include <display/Display/PanelDisplay.h>
00033 #include <display/QtViewer/QtMouseTools.qo.h>
00034 #include <display/region/RegionSourceFactory.h>
00035
00036 #include <graphics/X11/X_enter.h>
00037 #include <QObject>
00038 #include <QtGui>
00039 #include <graphics/X11/X_exit.h>
00040
00041 namespace casa {
00042
00043 enum ProfileType {
00044 UNKNPROF,
00045 SINGPROF,
00046 RECTPROF,
00047 ELLPROF,
00048 POLYPROF,
00049 POLYLINEPROF,
00050 PVPROF
00051 };
00052
00053 class QtMWCTool {
00054
00055 public:
00056 QtMWCTool(): coordType("world") {}
00057 virtual ~QtMWCTool() {}
00058 protected:
00059 String coordType;
00060
00061 public:
00062 virtual void setCoordType(const String& t) {
00063 if (t == "world") coordType = t;
00064 else coordType = "pixel";
00065
00066
00067
00068 }
00069
00070
00071 };
00072
00073 class QtPolyTool: public QtPTRegion, public QtMWCTool {
00074 Q_OBJECT
00075
00076 public:
00077 QtPolyTool(viewer::RegionSourceFactory *rf, PanelDisplay* pd);
00078 virtual ~QtPolyTool() {}
00079
00080 public slots:
00081 void setCoordType(const String& t);
00082
00083 signals:
00084 void wcNotify( const String c,
00085 const Vector<Double> px, const Vector<Double> py,
00086 const Vector<Double> wx, const Vector<Double> wy,
00087 const ProfileType ptype);
00088
00089 protected:
00090 virtual void updateRegion();
00091
00092 };
00093
00094 class QtPolylineTool: public QtPolylineToolRegion, public QtMWCTool {
00095 Q_OBJECT
00096
00097 public:
00098 QtPolylineTool(viewer::RegionSourceFactory *rf, PanelDisplay* pd);
00099 virtual ~QtPolylineTool() {}
00100
00101 public slots:
00102 void setCoordType(const String& t);
00103
00104 signals:
00105 void wcNotify( const String c,
00106 const Vector<Double> px, const Vector<Double> py,
00107 const Vector<Double> wx, const Vector<Double> wy,
00108 const ProfileType ptype);
00109
00110 protected:
00111 virtual void updateRegion();
00112
00113 };
00114
00115 class QtEllipseTool: public QtELRegion, public QtMWCTool {
00116 Q_OBJECT
00117
00118 public:
00119 QtEllipseTool(viewer::RegionSourceFactory *rf, PanelDisplay *pd);
00120 virtual ~QtEllipseTool() {}
00121
00122 public slots:
00123 void setCoordType(const String& t);
00124
00125 signals:
00126 void wcNotify( const String c,
00127 const Vector<Double> px, const Vector<Double> py,
00128 const Vector<Double> wx, const Vector<Double> wy,
00129 const ProfileType ptype);
00130
00131 protected:
00132 virtual void updateRegion();
00133 };
00134
00135
00136 class QtRectTool: public QtRTRegion, public QtMWCTool {
00137 Q_OBJECT
00138
00139 public:
00140 QtRectTool(viewer::RegionSourceFactory *rf, PanelDisplay* pd);
00141 virtual ~QtRectTool() {}
00142
00143 public slots:
00144 void setCoordType(const String& t);
00145
00146 signals:
00147 void wcNotify( const String c,
00148 const Vector<Double> px, const Vector<Double> py,
00149 const Vector<Double> wx, const Vector<Double> wy,
00150 const ProfileType ptype);
00151
00152 protected:
00153 virtual void updateRegion();
00154 };
00155
00156 class QtCrossTool: public QtPointRegion, public QtMWCTool {
00157 Q_OBJECT
00158
00159 public:
00160 QtCrossTool(viewer::RegionSourceFactory *rf, PanelDisplay* pd);
00161 virtual ~QtCrossTool() {}
00162
00163
00164 public slots:
00165 void setCoordType(const String& t);
00166
00167 signals:
00168 void wcNotify( const String c,
00169 const Vector<Double> px, const Vector<Double> py,
00170 const Vector<Double> wx, const Vector<Double> wy,
00171 const ProfileType ptype);
00172
00173 protected:
00174 virtual void updateRegion();
00175 };
00176
00177 class QtPVTool: public QtPVToolRegion, public QtMWCTool {
00178 Q_OBJECT
00179
00180 public:
00181 QtPVTool(viewer::RegionSourceFactory *rf, PanelDisplay* pd);
00182 virtual ~QtPVTool() {}
00183
00184 public slots:
00185 void setCoordType(const String& t);
00186
00187 signals:
00188 void wcNotify( const String c,
00189 const Vector<Double> px, const Vector<Double> py,
00190 const Vector<Double> wx, const Vector<Double> wy,
00191 const ProfileType ptype);
00192
00193 protected:
00194 virtual void updateRegion();
00195
00196 };
00197
00198 }
00199
00200 #endif
00201