casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
WCPositionEvent.h
Go to the documentation of this file.
00001 //# WCPositionEvent.h: class which stores WorldCanvas position event info
00002 //# Copyright (C) 1993,1994,1995,1996,1998,1999,2000,2002
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_WCPOSITIONEVENT_H
00029 #define TRIALDISPLAY_WCPOSITIONEVENT_H
00030 
00031 #include <casa/aips.h>
00032 #include <casa/Arrays/Vector.h>
00033 #include <display/Display/DisplayEnums.h>
00034 #include <display/DisplayEvents/WCMotionEvent.h>
00035 
00036 namespace casa { //# NAMESPACE CASA - BEGIN
00037 
00038 class WorldCanvas;
00039 
00040 // <summary>
00041 // Class which stores WorldCanvas position event information.
00042 // </summary>
00043 
00044 // <use visibility=export>
00045 
00046 // <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos="">
00047 // </reviewed>
00048 
00049 // <etymology>
00050 // "WCPositionEvent" is a contraction and concatenation of "WorldCanvas", 
00051 // "Position" and "Event", and describes position events occuring on
00052 // WorldCanvases.
00053 // </etymology>
00054 
00055 // <prerequisite>
00056 // <li> <linkto class=WorldCanvasEvent>WorldCanvasEvent</linkto>
00057 // </prerequisite>
00058 
00059 // <synopsis>
00060 // This class adds to the information stored in the <linkto
00061 // class=WCMotionEvent>WCMotionEvent</linkto> class.  It adds
00062 // information describing key that has been pressed or released, and
00063 // the state of that key.
00064 // </synopsis>
00065 
00066 // <example>
00067 // </example>
00068 
00069 // <motivation>
00070 // A compact way of passing passing position event information around
00071 // the WorldCanvas-oriented display classes was needed, with a
00072 // functional but tight and efficient interface.
00073 // </motivation>
00074 
00075 // <thrown>
00076 // None.
00077 // </thrown>
00078 
00079 // <todo asof="1999/10/18">
00080 // None.
00081 // </todo>
00082 
00083 class WCPositionEvent : public WCMotionEvent {
00084 
00085  public:
00086 
00087   // Constructor taking a pointer to the WorldCanvas for which the
00088   // event is valid, the key which is pressed and its state
00089   // (ie. pressed or released), the state of the keyboard and pointer
00090   // modifiers, and the pixel, linear and world coordinates of the
00091   // event.
00092   WCPositionEvent(WorldCanvas * wc,
00093                   const Display::KeySym &key,
00094                   const Bool &keyState,
00095                   const uInt &modifiers,
00096                   const Int &pixX, const Int &pixY,
00097                   const Double &linX, const Double &linY,
00098                   const Vector<Double> &world);
00099 
00100   // Destructor.
00101   virtual ~WCPositionEvent();
00102 
00103   // Which key was pressed or released?
00104   virtual Display::KeySym key() const 
00105     { return itsKey; }
00106 
00107   // What state is the key in: <src>True</src> for pressed,
00108   // <src>False</src> for released.
00109   virtual Bool keystate() const 
00110     { return itsKeyState; }
00111 
00112  protected:
00113 
00114   // (Required) default constructor.
00115   WCPositionEvent();
00116 
00117   // (Required) copy constructor.
00118   WCPositionEvent(const WCPositionEvent &other);
00119 
00120   // (Required) copy assignment.
00121   WCPositionEvent &operator=(const WCPositionEvent &other);
00122 
00123  private:
00124 
00125   // Store the key that was pressed or released here.
00126   Display::KeySym itsKey;
00127 
00128   // Store the state of that key here.
00129   Bool itsKeyState;
00130 
00131 };
00132 
00133 
00134 } //# NAMESPACE CASA - END
00135 
00136 #endif
00137 
00138