QPTool.qo.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 #ifndef QPTOOL_QO_H_
00028 #define QPTOOL_QO_H_
00029
00030 #ifdef AIPS_HAS_QWT
00031 #include <graphics/GenericPlotter/PlotTool.h>
00032
00033 #include <casaqt/QwtPlotter/QPAnnotation.h>
00034
00035 #include <qwt_plot_picker.h>
00036 #include <qwt_plot_panner.h>
00037
00038 namespace casa {
00039
00040
00041 class QPTracker;
00042
00043
00044
00045
00046 class QPSelectTool : public PlotSelectTool {
00047 public:
00048
00049 QPSelectTool(PlotCoordinate::System sys = PlotCoordinate::WORLD);
00050
00051
00052 QPSelectTool(PlotAxis xAxis, PlotAxis yAxis,
00053 PlotCoordinate::System sys = PlotCoordinate::WORLD);
00054
00055
00056 ~QPSelectTool();
00057 };
00058
00059
00060
00061
00062 class QPZoomTool : public PlotZoomTool {
00063 public:
00064
00065 QPZoomTool(PlotCoordinate::System sys = PlotCoordinate::WORLD);
00066
00067
00068 QPZoomTool(PlotAxis xAxis, PlotAxis yAxis,
00069 PlotCoordinate::System sys = PlotCoordinate::WORLD);
00070
00071
00072 ~QPZoomTool();
00073 };
00074
00075
00076
00077
00078 class QPPanTool : public QObject, public PlotPanTool {
00079 Q_OBJECT
00080
00081 public:
00082
00083 QPPanTool(PlotCoordinate::System sys = PlotCoordinate::WORLD);
00084
00085
00086 QPPanTool(PlotAxis xAxis, PlotAxis yAxis,
00087 PlotCoordinate::System sys = PlotCoordinate::WORLD);
00088
00089
00090 ~QPPanTool();
00091
00092
00093
00094
00095
00096 void setActive(bool isActive = true);
00097
00098
00099
00100
00101
00102
00103 void handleMouseEvent(const PlotEvent& event);
00104
00105 protected:
00106
00107
00108
00109 void attach(PlotCanvas* canvas);
00110
00111
00112 void detach();
00113
00114 private:
00115 QwtPlotPanner* m_panner;
00116
00117 private slots:
00118
00119 void panned(int dx, int dy);
00120 };
00121
00122
00123
00124 class QPTrackerTool : public PlotTrackerTool {
00125 public:
00126
00127 QPTrackerTool(PlotCoordinate::System sys = PlotCoordinate::WORLD);
00128
00129
00130 QPTrackerTool(PlotAxis xAxis, PlotAxis yAxis,
00131 PlotCoordinate::System sys = PlotCoordinate::WORLD);
00132
00133
00134 ~QPTrackerTool();
00135
00136
00137
00138
00139 void setActive(bool isActive = true);
00140
00141
00142
00143
00144
00145
00146 void handleMouseEvent(const PlotEvent& event);
00147
00148
00149
00150
00151 void setDrawText(bool draw = true);
00152
00153 protected:
00154
00155
00156
00157 void attach(PlotCanvas* canvas);
00158
00159
00160 void detach();
00161
00162 private:
00163 QPTracker* m_tracker;
00164 };
00165
00166
00167
00168 class QPTracker : public QwtPlotPicker {
00169 Q_OBJECT
00170
00171 public:
00172
00173 QPTracker(QPTrackerTool& tracker, QwtPlotCanvas* canvas);
00174
00175
00176 ~QPTracker();
00177
00178
00179
00180
00181 PlotAnnotationPtr getAnnotation() {
00182 return PlotAnnotationPtr(&m_annotation, false); }
00183
00184
00185
00186
00187
00188
00189
00190 QwtText trackerText(const QPoint& pos) const {
00191 return trackerText(invTransform(pos)); }
00192 QwtText trackerText(const QwtDoublePoint& pos) const;
00193
00194
00195 private:
00196 QPTrackerTool& m_tracker;
00197 QPAnnotation m_annotation;
00198 };
00199
00200 }
00201
00202 #endif
00203
00204 #endif