casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
QtOldMouseTools.qo.h
Go to the documentation of this file.
1 //# QtOldMouseTools.qo.h: Qt versions of display library mouse tools.
2 //# Copyright (C) 2005
3 //# Associated Universities, Inc. Washington DC, USA.
4 //#
5 //# This library is free software; you can redistribute it and/or modify it
6 //# under the terms of the GNU Library General Public License as published by
7 //# the Free Software Foundation; either version 2 of the License, or (at your
8 //# option) any later version.
9 //#
10 //# This library is distributed in the hope that it will be useful, but WITHOUT
11 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
13 //# License for more details.
14 //#
15 //# You should have received a copy of the GNU Library General Public License
16 //# along with this library; if not, write to the Free Software Foundation,
17 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
18 //#
19 //# Correspondence concerning AIPS++ should be addressed as follows:
20 //# Internet email: aips2-request@nrao.edu.
21 //# Postal address: AIPS++ Project Office
22 //# National Radio Astronomy Observatory
23 //# 520 Edgemont Road
24 //# Charlottesville, VA 22903-2475 USA
25 //#
26 //# $Id$
27 
28 
29 #ifndef QTOLDMOUSETOOLS_H
30 #define QTOLDMOUSETOOLS_H
31 
32 #include <casa/aips.h>
37 #include <casa/Containers/Record.h>
38 
39 #include <graphics/X11/X_enter.h>
40 # include <QObject>
41 #include <graphics/X11/X_exit.h>
42 
43 namespace casa {
44 
45 
46 
47 // <synopsis>
48 // Nothing yet: it may prove useful for Qt-signal-emitting mouse tools
49 // (which are MWCTools or possibly PCTools) to have a common base.
50 // </synopsis>
51  class QtOldMouseTool: public QObject {
52 
53  Q_OBJECT //# Allows slot/signal definition. Must only occur in
54  //# implement/.../*.h files; also, makefile must include
55  //# name of this file in 'mocs' section.
56 
57  public:
58 
59  QtOldMouseTool() : QObject() { }
61 
62  };
63 
64 
65 
66 
67 // <synopsis>
68 // QtOldRTRegion is the Rectangle Region mouse tool that sends a signal
69 // when a new rectangle is ready.
70 // </synopsis>
71  class QtOldRTRegion: public QtOldMouseTool, public MWCRTRegion {
72 
73  Q_OBJECT //# Allows slot/signal definition. Must only occur in
74  //# implement/.../*.h files; also, makefile must include
75  //# name of this file in 'mocs' section.
76 
77  public:
78 
80 
82 
83  // Retrieve the current rectangular mouse region record and WCH, if any.
84  // (If nothing is ready, returns false -- be sure to check before using
85  // return parameters. See implementation for mouseRegion casacore::Record format).
86  bool getMouseRegion(casacore::Record& mouseRegion, WorldCanvasHolder*& wch);
87 
88  signals:
89 
90  // See regionReady() implementation for format of the record. (For some
91  // uses, a connecting slot may be able to do without the WCH* parameter).
94 
95  protected:
96 
97  // Signals mouseRegionReady with an appropriate casacore::Record, when
98  // called by base class in response to user selection with the mouse.
99  // See implementation for format of the record.
100  virtual void regionReady();
101 
102  virtual void clicked(int x, int y);
103  virtual void doubleClicked(int x, int y);
104  //virtual void rectangleReady();
105  //virtual void handleEvent(DisplayEvent& ev);
106  //virtual void keyPressed(const WCPositionEvent &ev);
107 
108  PanelDisplay* pd_; // (Kludge... zIndex inaccessible from WC...)
109 
110  };
111 
112 
113 // <synopsis>
114 // QtOldELRegion is the Ellipse Region mouse tool that sends a signal
115 // when a new circle is ready.
116 // </synopsis>
117  class QtOldELRegion: public QtOldMouseTool, public MWCETRegion {
118 
119  Q_OBJECT //# Allows slot/signal definition. Must only occur in
120  //# implement/.../*.h files; also, makefile must include
121  //# name of this file in 'mocs' section.
122 
123  public:
124 
126 
128 
129  // Retrieve the current circular mouse region record and WCH, if any.
130  // (If nothing is ready, returns false -- be sure to check before using
131  // return parameters. See implementation for mouseRegion casacore::Record format).
132  bool getMouseRegion(casacore::Record& mouseRegion, WorldCanvasHolder*& wch);
133 
134  signals:
135 
136  // See regionReady() implementation for format of the record. (For some
137  // uses, a connecting slot may be able to do without the WCH* parameter).
140 
141  protected:
142 
143  // Signals mouseRegionReady with an appropriate casacore::Record, when
144  // called by base class in response to user selection with the mouse.
145  // See implementation for format of the record.
146  virtual void regionReady();
147 
148  virtual void clicked(int x, int y);
149  virtual void doubleClicked(int x, int y);
150 
151  PanelDisplay* pd_; // (Kludge... zIndex inaccessible from WC...)
152 
153  };
154 
155 
156 // <synopsis>
157 // QtOldPTRegion is the Polygon Region mouse tool that sends a signal
158 // when a new polygon is ready.
159 // </synopsis>
160  class QtOldPTRegion: public QtOldMouseTool, public MWCPTRegion {
161 
162  Q_OBJECT //# Allows slot/signal definition. Must only occur in
163  //# implement/.../*.h files; also, makefile must include
164  //# name of this file in 'mocs' section.
165 
166  public:
167 
169 
171 
172  // Retrieve the current polygon mouse region record and WCH, if any.
173  // (If nothing is ready, returns false -- be sure to check before using
174  // return parameters. See implementation for mouseRegion casacore::Record format).
175  bool getMouseRegion(casacore::Record& mouseRegion, WorldCanvasHolder*& wch);
176 
177  signals:
178 
179  // See regionReady() implementation for format of the record. (For some
180  // uses, a connecting slot may be able to do without the WCH* parameter).
183 
184  protected:
185 
186  // This callback is invoked by the base when the user double-clicks
187  // inside a polygon defined previously (but see also polygonReady(),
188  // below). This implementation emits the Qt signal mouseRegionReady()
189  // with an appropriate casacore::Record defining the user's polygon mouse selection.
190  // See implementation for format of the record.
191  virtual void regionReady();
192  virtual void clicked(int x, int y);
193  virtual void doubleClicked(int x, int y);
194 
195  //virtual void handleEvent(DisplayEvent& ev);
196  //virtual void keyPressed(const WCPositionEvent &ev);
197 
199  //
200  // This callback is invoked by the base when the polygon is first
201  // defined (by a double-click at last point) or when the mouse is
202  // released after a move/resize. It was unused in glish. For Qt,
203  // this will also signal that the polygon region has been fully
204  // 'selected/made ready' (which will preclude the need for the
205  // user to double-click [again] inside the polygon to select it).
206  //virtual void polygonReady() { regionReady(); }
207 
208  // is this fix to 1393?
209  virtual void polygonReady() { }
210 
211  PanelDisplay* pd_; // (Kludge... zIndex inaccessible from WC...)
212 
213  };
214 
215 
216 
217 
218 } //# NAMESPACE CASA - END
219 
220 #endif
221 
WorldCanvas event-based polygon region drawer.
Definition: MWCPTRegion.h:79
virtual void regionReady()
Signals mouseRegionReady with an appropriate casacore::Record, when called by base class in response ...
WorldCanvas event-based rectangle region drawer.
Definition: MWCRTRegion.h:78
QtOldPTRegion(PanelDisplay *pd)
PanelDisplay * pd_
virtual void rectangleReady(); virtual void handleEvent(DisplayEvent&amp; ev); virtual void keyPressed(co...
void mouseRegionReady(casacore::Record mouseRegion, WorldCanvasHolder *)
See regionReady() implementation for format of the record.
virtual void regionReady()
Signals mouseRegionReady with an appropriate casacore::Record, when called by base class in response ...
void mouseRegionReady(casacore::Record mouseRegion, WorldCanvasHolder *)
See regionReady() implementation for format of the record.
QtOldRTRegion(PanelDisplay *pd)
virtual void polygonReady()
virtual void handleEvent(DisplayEvent&amp; ev); virtual void keyPressed(const WCPositionEvent &amp;ev); ...
bool getMouseRegion(casacore::Record &mouseRegion, WorldCanvasHolder *&wch)
Retrieve the current rectangular mouse region record and WCH, if any.
void echoClicked(casacore::Record)
WorldCanvas event-based elliptical region drawer.
Definition: MWCETRegion.h:78
virtual void clicked(int x, int y)
virtual void doubleClicked(int x, int y)
A hierarchical collection of named fields of various types.
Definition: Record.h:180
virtual void doubleClicked(int x, int y)
void mouseRegionReady(casacore::Record mouseRegion, WorldCanvasHolder *)
See regionReady() implementation for format of the record.
void echoClicked(casacore::Record)
virtual void regionReady()
This callback is invoked by the base when the user double-clicks inside a polygon defined previously ...
void echoClicked(casacore::Record)
QtOldELRegion(PanelDisplay *pd)
virtual void clicked(int x, int y)
virtual void doubleClicked(int x, int y)
A holder to interface between DisplayDatas and a WorldCanvas.
A class which creates and manages &quot;panelled&quot; displays.
Definition: PanelDisplay.h:79
bool getMouseRegion(casacore::Record &mouseRegion, WorldCanvasHolder *&wch)
Retrieve the current polygon mouse region record and WCH, if any.
bool getMouseRegion(casacore::Record &mouseRegion, WorldCanvasHolder *&wch)
Retrieve the current circular mouse region record and WCH, if any.
virtual void clicked(int x, int y)