casa
$Rev:20696$
|
00001 //# PCMotionEvent.h: class which stores PixelCanvas motion event information 00002 //# Copyright (C) 1993,1994,1995,1996,1999,2000 00003 //# Associated Universities, Inc. Washington DC, USA. 00004 //# 00005 //# This library is free software; you can redistribute it and/or modify it 00006 //# under the terms of the GNU Library General Public License as published by 00007 //# the Free Software Foundation; either version 2 of the License, or (at your 00008 //# option) any later version. 00009 //# 00010 //# This library is distributed in the hope that it will be useful, but WITHOUT 00011 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00012 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public 00013 //# License for more details. 00014 //# 00015 //# You should have received a copy of the GNU Library General Public License 00016 //# along with this library; if not, write to the Free Software Foundation, 00017 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA. 00018 //# 00019 //# Correspondence concerning AIPS++ should be addressed as follows: 00020 //# Internet email: aips2-request@nrao.edu. 00021 //# Postal address: AIPS++ Project Office 00022 //# National Radio Astronomy Observatory 00023 //# 520 Edgemont Road 00024 //# Charlottesville, VA 22903-2475 USA 00025 //# 00026 //# $Id$ 00027 00028 #ifndef TRIALDISPLAY_PCMOTIONEVENT_H 00029 #define TRIALDISPLAY_PCMOTIONEVENT_H 00030 00031 #include <casa/aips.h> 00032 #include <display/DisplayEvents/PixelCanvasEvent.h> 00033 00034 namespace casa { //# NAMESPACE CASA - BEGIN 00035 00036 class PixelCanvas; 00037 00038 // <summary> 00039 // Class which stores PixelCanvas motion event information. 00040 // </summary> 00041 00042 // <use visibility=export> 00043 00044 // <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos=""> 00045 // </reviewed> 00046 00047 // <etymology> 00048 // "PCMotionEvent" is a contraction and concatenation of "PixelCanvas", 00049 // "Motion" and "Event", and describes motion events occuring on 00050 // PixelCanvases. 00051 // </etymology> 00052 00053 // <prerequisite> 00054 // <li> <linkto class=PixelCanvasEvent>PixelCanvasEvent</linkto> 00055 // </prerequisite> 00056 00057 // <synopsis> 00058 // This class adds to the information stored in the <linkto 00059 // class=PixelCanvasEvent>PixelCanvasEvent</linkto> class. It adds 00060 // information describing the current position of the mouse or 00061 // pointing device, and the state of the keyboard modifiers (including 00062 // the mouse buttons). 00063 // </synopsis> 00064 00065 // <example> 00066 // </example> 00067 00068 // <motivation> 00069 // A compact way of passing motion event information around the 00070 // PixelCanvas-oriented display classes was needed, with a functional 00071 // but tight and efficient interface. 00072 // </motivation> 00073 00074 // <thrown> 00075 // None. 00076 // </thrown> 00077 00078 // <todo asof="1999/10/15"> 00079 // None. 00080 // </todo> 00081 00082 class PCMotionEvent : public PixelCanvasEvent { 00083 00084 public: 00085 00086 // Constructor taking a pointer to the PixelCanvas for which the 00087 // event is valid, the position of the event, and the keyboard and 00088 // pointer modifiers. 00089 PCMotionEvent(PixelCanvas *pc, const Int &x, const Int &y, 00090 const uInt &modifiers); 00091 00092 // Destructor. 00093 virtual ~PCMotionEvent(); 00094 00095 // The x and y pixel position of the pointer when the event occured. 00096 // <group> 00097 virtual Int x() const 00098 { return itsX; } 00099 virtual Int y() const 00100 { return itsY; } 00101 // </group> 00102 00103 // Return the state of the "modifiers": this is made up of mask 00104 // bits referring to various keys on the keyboard (eg. Control, 00105 // Shift, etc.) and the mouse buttons. 00106 virtual uInt modifiers() const 00107 { return itsModifiers; } 00108 00109 protected: 00110 00111 // (Required) default constructor. 00112 PCMotionEvent(); 00113 00114 // (Required) copy constructor. 00115 PCMotionEvent(const PCMotionEvent &other); 00116 00117 // (Required) copy assignment. 00118 PCMotionEvent &operator=(const PCMotionEvent &other); 00119 00120 private: 00121 00122 // Store the position of the event here. 00123 Int itsX, itsY; 00124 00125 // Store the button and keyboard modifier masks here. 00126 uInt itsModifiers; 00127 00128 }; 00129 00130 00131 } //# NAMESPACE CASA - END 00132 00133 #endif 00134 00135