casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
WCPositionEvent.h
Go to the documentation of this file.
1 //# WCPositionEvent.h: class which stores WorldCanvas position event info
2 //# Copyright (C) 1993,1994,1995,1996,1998,1999,2000,2002
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_WCPOSITIONEVENT_H
29 #define TRIALDISPLAY_WCPOSITIONEVENT_H
30 
31 #include <casa/aips.h>
32 #include <casa/Arrays/Vector.h>
35 
36 namespace casa { //# NAMESPACE CASA - BEGIN
37 
38  class WorldCanvas;
39 
40 // <summary>
41 // Class which stores WorldCanvas position event information.
42 // </summary>
43 
44 // <use visibility=export>
45 
46 // <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos="">
47 // </reviewed>
48 
49 // <etymology>
50 // "WCPositionEvent" is a contraction and concatenation of "WorldCanvas",
51 // "Position" and "Event", and describes position events occuring on
52 // WorldCanvases.
53 // </etymology>
54 
55 // <prerequisite>
56 // <li> <linkto class=WorldCanvasEvent>WorldCanvasEvent</linkto>
57 // </prerequisite>
58 
59 // <synopsis>
60 // This class adds to the information stored in the <linkto
61 // class=WCMotionEvent>WCMotionEvent</linkto> class. It adds
62 // information describing key that has been pressed or released, and
63 // the state of that key.
64 // </synopsis>
65 
66 // <example>
67 // </example>
68 
69 // <motivation>
70 // A compact way of passing passing position event information around
71 // the WorldCanvas-oriented display classes was needed, with a
72 // functional but tight and efficient interface.
73 // </motivation>
74 
75 // <thrown>
76 // None.
77 // </thrown>
78 
79 // <todo asof="1999/10/18">
80 // None.
81 // </todo>
82 
83  class WCPositionEvent : public WCMotionEvent {
84 
85  public:
86 
87  // Constructor taking a pointer to the WorldCanvas for which the
88  // event is valid, the key which is pressed and its state
89  // (ie. pressed or released), the state of the keyboard and pointer
90  // modifiers, and the pixel, linear and world coordinates of the
91  // event.
93  const Display::KeySym &key,
94  const casacore::Bool &keyState,
96  const casacore::Int &pixX, const casacore::Int &pixY,
99 
100  // Destructor.
101  virtual ~WCPositionEvent();
102 
103  // Which key was pressed or released?
104  virtual Display::KeySym key() const {
105  return itsKey;
106  }
107 
108  // What state is the key in: <src>true</src> for pressed,
109  // <src>false</src> for released.
110  virtual casacore::Bool keystate() const {
111  return itsKeyState;
112  }
113 
114  protected:
115 
116  // (Required) default constructor.
117  WCPositionEvent();
118 
119  // (Required) copy constructor.
120  WCPositionEvent(const WCPositionEvent &other);
121 
122  // (Required) copy assignment.
124 
125  private:
126 
127  // Store the key that was pressed or released here.
129 
130  // Store the state of that key here.
132 
133  };
134 
135 
136 } //# NAMESPACE CASA - END
137 
138 #endif
139 
140 
virtual casacore::Double linX() const
The x and y linear coordinates of the event.
int Int
Definition: aipstype.h:50
virtual Display::KeySym key() const
Which key was pressed or released?
virtual casacore::Bool keystate() const
What state is the key in: true for pressed, false for released.
virtual casacore::Int pixX() const
The x and y pixel position of the pointer when the event occurred.
virtual casacore::Int pixY() const
Class which stores WorldCanvas motion event information.
Definition: WCMotionEvent.h:79
double Double
Definition: aipstype.h:55
WCPositionEvent & operator=(const WCPositionEvent &other)
(Required) copy assignment.
WCPositionEvent()
(Required) default constructor.
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
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
Class which stores WorldCanvas position event information.
Implementation of drawing in world coordinates on top of a PixelCanvas.
Definition: WorldCanvas.h:204
virtual ~WCPositionEvent()
Destructor.
casacore::Bool itsKeyState
Store the state of that key here.
KeySym
Keysyms for PixelCanvas keyboard events.
Definition: DisplayEnums.h:412
Display::KeySym itsKey
Store the key that was pressed or released here.
unsigned int uInt
Definition: aipstype.h:51
virtual const casacore::Vector< casacore::Double > & world() const
The world coordinates describing where the event occurred.