casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CrosshairEvent.h
Go to the documentation of this file.
1 //# CrosshairEvent.h: class for MWCCrosshairTool point selection event.
2 //# Copyright (C) 1993,1994,1995,1996,1998,1999,2000,2002,2003
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_CROSSHAIREVENT_H
29 #define TRIALDISPLAY_CROSSHAIREVENT_H
30 
31 #include <casa/aips.h>
33 
34 namespace casa { //# NAMESPACE CASA - BEGIN
35 
36  class WorldCanvas;
37 
38 // <summary>
39 // WorldCanvasEvent:contains info on the WC point selected by MWCCrosshairTool
40 // </summary>
41 
42 // <use visibility=export>
43 
44 // <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos="">
45 // </reviewed>
46 
47 // <etymology>
48 // "CrosshairEvent" holds information about a point selected by the user
49 // with the MWCCrosshairTool.
50 // </etymology>
51 
52 // <synopsis>
53 // CrosshairEvent is created by
54 // <linkto class="MWCCrosshairTool">MWCCrosshairTool</linkto>
55 // when a point is selected by the crosshair on a
56 // <linkto class="WorldCanvas">WorldCanvas</linkto> draw area.
57 // The event is passed (via WorldCanvas::handleEvent()) to the generic
58 // <linkto class="DisplayEH">DisplayEH</linkto>s
59 // registered with the WorldCanvas.
60 // </synopsis>
61 
62 // <motivation>
63 // A mechanism was needed to notify library objects associated with a
64 // WorldCanvas (in particular,
65 // <linkto class="DisplayData">DisplayData</linkto>s)
66 // when a position was selected on the WC via MWCCrosshairTool.
67 // Formerly, this information was sent only to glish.
68 // This event is on a different level from the mouse/keyboard
69 // WorldCanvasEvents and serves a different purpose, so a new event type
70 // was created.
71 // </motivation>
72 
73 // <thrown>
74 // None.
75 // </thrown>
76 
77 // <todo asof="1999/10/15">
78 // None.
79 // </todo>
80 
82 
83  public:
84 
85  // Constructor taking a pointer to the WorldCanvas where the
86  // event occured, and the pixel coordinates of the event.
87  // evtype should be "down", "move", or "up", according to mouse state.
89  const casacore::String& evtype) :
90  WorldCanvasEvent(wc),
91  itsPixX(pixX), itsPixY(pixY),
92  itsEvType(evtype)
93  { }
94 
95  // The x and y pixel position of the crosshair when the event occurred.
96  // <group>
97  virtual casacore::Int pixX() const {
98  return itsPixX;
99  }
100  virtual casacore::Int pixY() const {
101  return itsPixY;
102  }
103  virtual casacore::String evtype() const {
104  return itsEvType;
105  }
106  // </group>
107 
108  private:
109 
110  // pixel position of the event
112  // "down", "move", or "up", according to mouse state.
114 
115  };
116 
117 
118 } //# NAMESPACE CASA - END
119 
120 #endif
121 
122 
casacore::Int itsPixY
WorldCanvasEvent:contains info on the WC point selected by MWCCrosshairTool.
int Int
Definition: aipstype.h:50
CrosshairEvent(WorldCanvas *wc, const casacore::Int pixX, const casacore::Int pixY, const casacore::String &evtype)
Constructor taking a pointer to the WorldCanvas where the event occured, and the pixel coordinates of...
casacore::Int itsPixX
pixel position of the event
casacore::String itsEvType
&quot;down&quot;, &quot;move&quot;, or &quot;up&quot;, according to mouse state.
virtual casacore::Int pixX() const
The x and y pixel position of the crosshair when the event occurred.
virtual casacore::String evtype() const
virtual casacore::Int pixY() const
Implementation of drawing in world coordinates on top of a PixelCanvas.
Definition: WorldCanvas.h:204
String: the storage and methods of handling collections of characters.
Definition: String.h:223
Base class describing event information for WorldCanvases.