WCMotionEvent.h

Go to the documentation of this file.
00001 //# WCMotionEvent.h: class which stores WorldCanvas motion event information
00002 //# Copyright (C) 1993,1994,1995,1996,1998,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_WCMOTIONEVENT_H
00029 #define TRIALDISPLAY_WCMOTIONEVENT_H
00030 
00031 #include <casa/aips.h>
00032 #include <casa/Arrays/Vector.h>
00033 #include <display/DisplayEvents/WorldCanvasEvent.h>
00034 
00035 namespace casa { //# NAMESPACE CASA - BEGIN
00036 
00037         class WorldCanvas;
00038 
00039 // <summary>
00040 // Class which stores WorldCanvas motion event information.
00041 // </summary>
00042 
00043 // <use visibility=export>
00044 
00045 // <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos="">
00046 // </reviewed>
00047 
00048 // <etymology>
00049 // "WCMotionEvent" is a contraction and concatentation of
00050 // "WorldCanvas", "Motion" and "Event", and describes motion events
00051 // occuring on WorldCanvases.
00052 // </etymology>
00053 
00054 // <synopsis>
00055 // This class adds to the information stored in the <linkto
00056 // class=WorldCanvasEvent>WorldCanvasEvent</linkto> class.  It adds
00057 // informatino describing the current position of the mouse or
00058 // pointing device, and the state of the keyboard modifiers (including
00059 // the mouse buttons).
00060 // </synopsis>
00061 
00062 // <example>
00063 // </example>
00064 
00065 // <motivation>
00066 // A compact way of passing motion event information around the
00067 // WorldCanvas-oriented display classes was needed, with a functional
00068 // but tight and efficient interface.
00069 // </motivation>
00070 
00071 // <thrown>
00072 // None.
00073 // </thrown>
00074 
00075 // <todo asof="1999/10/15">
00076 // None.
00077 // </todo>
00078 
00079         class WCMotionEvent : public WorldCanvasEvent {
00080 
00081         public:
00082 
00083                 // Constructor taking a pointer to the WorldCanvas for which the
00084                 // event is valid, the state of the keyboard and pointer modifiers,
00085                 // and the pixel, linear and world coordinates of the event.
00086                 WCMotionEvent(WorldCanvas *wc, const uInt &modifiers,
00087                               const Int &pixX, const Int &pixY,
00088                               const Double &linX, const Double &linY,
00089                               const Vector<Double> &world);
00090 
00091                 // copy constructor.
00092                 WCMotionEvent(const WCMotionEvent &other);
00093 
00094                 // Destructor.
00095                 virtual ~WCMotionEvent();
00096 
00097                 // The x and y pixel position of the pointer when the event
00098                 // occurred.
00099                 // <group>
00100                 virtual Int pixX() const {
00101                         return itsPixX;
00102                 }
00103                 virtual Int pixY() const {
00104                         return itsPixY;
00105                 }
00106                 // </group>
00107 
00108                 // The x and y linear coordinates of the event.
00109                 // <group>
00110                 virtual Double linX() const {
00111                         return itsLinX;
00112                 }
00113                 virtual Double linY() const {
00114                         return itsLinY;
00115                 }
00116                 // </group>
00117 
00118                 // The world coordinates describing where the event occurred.
00119                 virtual const Vector<Double> &world() const {
00120                         return itsWorld;
00121                 }
00122 
00123                 // Return the state of the "modifiers": this is made up of mask bits
00124                 // referring to various keys on the keyboard (eg. Control, Shift,
00125                 // etc.) and the mouse buttons.
00126                 virtual uInt modifiers() const {
00127                         return itsModifiers;
00128                 }
00129 
00130         protected:
00131 
00132                 // (Required) default constructor.
00133                 WCMotionEvent();
00134 
00135                 // (Required) copy assignment.
00136                 WCMotionEvent &operator=(const WCMotionEvent &other);
00137                 friend class QtDisplayPanel;            /*** to access assignment operator to save "last event" ***/
00138 
00139         private:
00140 
00141                 // Store the pixel position of the event here.
00142                 Int itsPixX, itsPixY;
00143 
00144                 // Store the linear position of the event here.
00145                 Double itsLinX, itsLinY;
00146 
00147                 // Store the world position of the event here.
00148                 Vector<Double> itsWorld;
00149 
00150                 // Store the button and keyboard modifier masks here.
00151                 uInt itsModifiers;
00152 
00153         };
00154 
00155 
00156 } //# NAMESPACE CASA - END
00157 
00158 #endif
00159 
00160 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 31 Aug 2016 for casa by  doxygen 1.6.1