casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
WCMotionEvent.h
Go to the documentation of this file.
1 //# WCMotionEvent.h: class which stores WorldCanvas motion event information
2 //# Copyright (C) 1993,1994,1995,1996,1998,1999,2000
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 #ifndef TRIALDISPLAY_WCMOTIONEVENT_H
29 #define TRIALDISPLAY_WCMOTIONEVENT_H
30 
31 #include <casa/aips.h>
32 #include <casa/Arrays/Vector.h>
34 
35 namespace casa { //# NAMESPACE CASA - BEGIN
36 
37  class WorldCanvas;
38 
39 // <summary>
40 // Class which stores WorldCanvas motion event information.
41 // </summary>
42 
43 // <use visibility=export>
44 
45 // <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos="">
46 // </reviewed>
47 
48 // <etymology>
49 // "WCMotionEvent" is a contraction and concatentation of
50 // "WorldCanvas", "Motion" and "Event", and describes motion events
51 // occuring on WorldCanvases.
52 // </etymology>
53 
54 // <synopsis>
55 // This class adds to the information stored in the <linkto
56 // class=WorldCanvasEvent>WorldCanvasEvent</linkto> class. It adds
57 // informatino describing the current position of the mouse or
58 // pointing device, and the state of the keyboard modifiers (including
59 // the mouse buttons).
60 // </synopsis>
61 
62 // <example>
63 // </example>
64 
65 // <motivation>
66 // A compact way of passing motion event information around the
67 // WorldCanvas-oriented display classes was needed, with a functional
68 // but tight and efficient interface.
69 // </motivation>
70 
71 // <thrown>
72 // None.
73 // </thrown>
74 
75 // <todo asof="1999/10/15">
76 // None.
77 // </todo>
78 
80 
81  public:
82 
83  // Constructor taking a pointer to the WorldCanvas for which the
84  // event is valid, the state of the keyboard and pointer modifiers,
85  // and the pixel, linear and world coordinates of the event.
87  const casacore::Int &pixX, const casacore::Int &pixY,
90 
91  // copy constructor.
92  WCMotionEvent(const WCMotionEvent &other);
93 
94  // Destructor.
95  virtual ~WCMotionEvent();
96 
97  // The x and y pixel position of the pointer when the event
98  // occurred.
99  // <group>
100  virtual casacore::Int pixX() const {
101  return itsPixX;
102  }
103  virtual casacore::Int pixY() const {
104  return itsPixY;
105  }
106  // </group>
107 
108  // The x and y linear coordinates of the event.
109  // <group>
110  virtual casacore::Double linX() const {
111  return itsLinX;
112  }
113  virtual casacore::Double linY() const {
114  return itsLinY;
115  }
116  // </group>
117 
118  // The world coordinates describing where the event occurred.
119  virtual const casacore::Vector<casacore::Double> &world() const {
120  return itsWorld;
121  }
122 
123  // Return the state of the "modifiers": this is made up of mask bits
124  // referring to various keys on the keyboard (eg. Control, Shift,
125  // etc.) and the mouse buttons.
126  virtual casacore::uInt modifiers() const {
127  return itsModifiers;
128  }
129 
130  protected:
131 
132  // (Required) default constructor.
133  WCMotionEvent();
134 
135  // (Required) copy assignment.
136  WCMotionEvent &operator=(const WCMotionEvent &other);
137  friend class QtDisplayPanel; /*** to access assignment operator to save "last event" ***/
138 
139  private:
140 
141  // Store the pixel position of the event here.
143 
144  // Store the linear position of the event here.
146 
147  // Store the world position of the event here.
149 
150  // Store the button and keyboard modifier masks here.
152 
153  };
154 
155 
156 } //# NAMESPACE CASA - END
157 
158 #endif
159 
160 
WCMotionEvent()
(Required) default constructor.
virtual casacore::Double linX() const
The x and y linear coordinates of the event.
int Int
Definition: aipstype.h:50
casacore::Double itsLinY
casacore::Double itsLinX
Store the linear position of the event here.
casacore::uInt itsModifiers
Store the button and keyboard modifier masks here.
casacore::Int itsPixX
Store the pixel position of the event here.
virtual casacore::Int pixX() const
The x and y pixel position of the pointer when the event occurred.
virtual casacore::Int pixY() const
casacore::Vector< casacore::Double > itsWorld
Store the world position of the event here.
Class which stores WorldCanvas motion event information.
Definition: WCMotionEvent.h:79
double Double
Definition: aipstype.h:55
WCMotionEvent & operator=(const WCMotionEvent &other)
(Required) copy assignment.
casacore::Int itsPixY
virtual casacore::uInt modifiers() const
Return the state of the &quot;modifiers&quot;: this is made up of mask bits referring to various keys on the ke...
virtual casacore::Double linY() const
Implementation of drawing in world coordinates on top of a PixelCanvas.
Definition: WorldCanvas.h:204
Base class describing event information for WorldCanvases.
virtual ~WCMotionEvent()
Destructor.
unsigned int uInt
Definition: aipstype.h:51
virtual const casacore::Vector< casacore::Double > & world() const
The world coordinates describing where the event occurred.