QtMWCTools.qo.h

Go to the documentation of this file.
00001 //# Copyright (C) 2005
00002 //# Associated Universities, Inc. Washington DC, USA.
00003 //#
00004 //# This library is free software; you can redistribute it and/or modify it
00005 //# under the terms of the GNU Library General Public License as published by
00006 //# the Free Software Foundation; either version 2 of the License, or (at your
00007 //# option) any later version.
00008 //#
00009 //# This library is distributed in the hope that it will be useful, but WITHOUT
00010 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00011 //# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public
00012 //# License for more details.
00013 //#
00014 //# You should have received a copy of the GNU Library General Public License
00015 //# along with this library; if not, write to the Free Software Foundation,
00016 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
00017 //#
00018 //# Correspondence concerning AIPS++ should be addressed as follows:
00019 //#        Internet email: aips2-request@nrao.edu.
00020 //#        Postal address: AIPS++ Project Office
00021 //#                        National Radio Astronomy Observatory
00022 //#                        520 Edgemont Road
00023 //#                        Charlottesville, VA 22903-2475 USA
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                         // cout << "Object=" << objectName().toStdString()
00066                         //      << " setCoordType: coordType=" << coordType
00067                         //      << " t=" << t << endl;
00068                 }
00069                 //String getCoordType() {return coordType;}
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                 /* virtual void crosshairReady(const String& evtype); */
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 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 31 Aug 2016 for casa by  doxygen 1.6.1