casa
$Rev:20696$
|
00001 //# PCInvisTool.h: base class for PC event-based invisible position tools 00002 //# Copyright (C) 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_PCINVISTOOL_H 00029 #define TRIALDISPLAY_PCINVISTOOL_H 00030 00031 #include <casa/aips.h> 00032 #include <display/DisplayEvents/PCTool.h> 00033 00034 namespace casa { //# NAMESPACE CASA - BEGIN 00035 00036 // <summary> 00037 // Base implementation of PCTool for invisible (non-drawing) tools. 00038 // </summary> 00039 // 00040 // <synopsis> 00041 // This class implements some of PCTool, and adds additional interface 00042 // to support invisible (ie. non-drawing) tools for PixelCanvases. 00043 // </synopsis> 00044 00045 class PCInvisTool : public PCTool { 00046 00047 public: 00048 00049 // Constructor. Requires a PixelCanvas to operate on, and a key 00050 // to catch. 00051 PCInvisTool(PixelCanvas *pcanvas, 00052 Display::KeySym keysym = Display::K_Pointer_Button1); 00053 00054 // Destructor. 00055 virtual ~PCInvisTool(); 00056 00057 // Functions called by the local event handling operators. 00058 // <group> 00059 virtual void keyPressed(const PCPositionEvent &ev); 00060 //virtual void keyReleased(const PCPositionEvent &ev); 00061 virtual void moved(const PCMotionEvent &ev); 00062 // </group> 00063 00064 // Function called when a position is ready. 00065 virtual void positionReady() { }; 00066 00067 // Retrieve the position in PixelCanvas pixel coordinates. 00068 virtual void get(Int &x, Int &y) const; 00069 00070 // Retrieve the position in fractional PixelCanvas coordinates. 00071 virtual void getFractional(Float &x, Float &y) const; 00072 00073 private: 00074 00075 // Have we moved? 00076 Bool itsMoved; 00077 00078 // Pixel coordinates of the position. 00079 Int itsX, itsY; 00080 00081 }; 00082 00083 00084 } //# NAMESPACE CASA - END 00085 00086 #endif