casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
QtOldMWCTools.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 QTOLDMWCTOOLS_H
00028 #define QTOLDMWCTOOLS_H
00029 
00030 #include <casa/aips.h>
00031 //#include <casa/BasicSL/String.h>
00032 //#include <display/DisplayEvents/MWCRTRegion.h>
00033 #include <display/DisplayEvents/MWCCrosshairTool.h>
00034 
00035 #include <display/Display/PanelDisplay.h>
00036 #include <display/QtViewer/QtOldMouseTools.qo.h>
00037 #include <display/QtPlotter/QtMWCTools.qo.h>
00038 
00039 #include <graphics/X11/X_enter.h>
00040 #include <QObject>
00041 #include <QtGui>
00042 #include <graphics/X11/X_exit.h>
00043 
00044 namespace casa {
00045 
00046 class QtOldMWCTool
00047 {
00048 
00049 public:
00050   QtOldMWCTool(): coordType("world") {}
00051   virtual ~QtOldMWCTool() {}
00052 protected:
00053   String coordType;
00054 
00055 public:
00056   virtual void setCoordType(const String& t) {
00057              if (t == "world") coordType = t;
00058              else coordType = "pixel";
00059       // cout << "Object=" << objectName().toStdString()
00060       //      << " setCoordType: coordType=" << coordType 
00061       //      << " t=" << t << endl;
00062   }
00063   //String getCoordType() {return coordType;} 
00064 
00065 };
00066 
00067 class QtOldPolyTool: public QtOldPTRegion,  public QtOldMWCTool
00068 {
00069   Q_OBJECT
00070 
00071 public: 
00072   QtOldPolyTool(PanelDisplay* pd);
00073   virtual ~QtOldPolyTool() {}
00074  
00075 public slots:
00076   void setCoordType(const String& t);
00077 
00078 signals:
00079   void wcNotify( const String c, 
00080                  const Vector<Double> px, const Vector<Double> py,
00081                  const Vector<Double> wx, const Vector<Double> wy,
00082                  const ProfileType ptype);
00083 
00084 protected:
00085   virtual void updateRegion();
00086 
00087 };
00088 
00089 
00090 class QtOldEllipseTool: public QtOldELRegion,  public QtOldMWCTool
00091 {
00092   Q_OBJECT
00093 
00094 public:
00095   QtOldEllipseTool(PanelDisplay* pd);
00096   virtual ~QtOldEllipseTool() {}
00097 
00098 public slots:
00099   void setCoordType(const String& t);
00100 
00101 signals:
00102   void wcNotify( const String c,
00103                  const Vector<Double> px, const Vector<Double> py,
00104                  const Vector<Double> wx, const Vector<Double> wy,
00105                  const ProfileType ptype);
00106 
00107 protected:
00108   virtual void updateRegion();
00109 };
00110 
00111 
00112 class QtOldRectTool: public QtOldRTRegion,  public QtOldMWCTool
00113 {
00114   Q_OBJECT
00115 
00116 public: 
00117   QtOldRectTool(PanelDisplay* pd);
00118   virtual ~QtOldRectTool() {}
00119 
00120 public slots:
00121   void setCoordType(const String& t);
00122 
00123 signals:
00124   void wcNotify( const String c, 
00125                  const Vector<Double> px, const Vector<Double> py,
00126                  const Vector<Double> wx, const Vector<Double> wy,
00127                  const ProfileType ptype);
00128 
00129 protected:
00130   virtual void updateRegion();
00131 };
00132 
00133 class QtOldCrossTool: public QObject, public QtOldMWCTool, public MWCCrosshairTool
00134 {
00135   Q_OBJECT
00136 
00137 public: 
00138   QtOldCrossTool();
00139   virtual ~QtOldCrossTool() {}
00140   virtual void crosshairReady(const String& evtype);
00141 
00142 public slots:
00143   void setCoordType(const String& t);
00144 
00145 signals:
00146   void wcNotify( const String c, 
00147                  const Vector<Double> px, const Vector<Double> py,
00148                  const Vector<Double> wx, const Vector<Double> wy,
00149                  const ProfileType ptype);
00150 
00151 
00152 };
00153 
00154 
00155 }
00156 
00157 #endif
00158