casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PCInvisTool.h
Go to the documentation of this file.
1 //# PCInvisTool.h: base class for PC event-based invisible position tools
2 //# Copyright (C) 1999,2000
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_PCINVISTOOL_H
29 #define TRIALDISPLAY_PCINVISTOOL_H
30 
31 #include <casa/aips.h>
33 
34 namespace casa { //# NAMESPACE CASA - BEGIN
35 
36 // <summary>
37 // Base implementation of PCTool for invisible (non-drawing) tools.
38 // </summary>
39 //
40 // <synopsis>
41 // This class implements some of PCTool, and adds additional interface
42 // to support invisible (ie. non-drawing) tools for PixelCanvases.
43 // </synopsis>
44 
45  class PCInvisTool : public PCTool {
46 
47  public:
48 
49  // Constructor. Requires a PixelCanvas to operate on, and a key
50  // to catch.
51  PCInvisTool(PixelCanvas *pcanvas,
53 
54  // Destructor.
55  virtual ~PCInvisTool();
56 
57  // Functions called by the local event handling operators.
58  // <group>
59  virtual void keyPressed(const PCPositionEvent &ev);
60  //virtual void keyReleased(const PCPositionEvent &ev);
61  virtual void moved(const PCMotionEvent &ev);
62  // </group>
63 
64  // casacore::Function called when a position is ready.
65  virtual void positionReady() { };
66 
67  // Retrieve the position in PixelCanvas pixel coordinates.
68  virtual void get(casacore::Int &x, casacore::Int &y) const;
69 
70  // Retrieve the position in fractional PixelCanvas coordinates.
71  virtual void getFractional(casacore::Float &x, casacore::Float &y) const;
72 
73  private:
74 
75  // Have we moved?
77 
78  // Pixel coordinates of the position.
80 
81  };
82 
83 
84 } //# NAMESPACE CASA - END
85 
86 #endif
int Int
Definition: aipstype.h:50
virtual void keyPressed(const PCPositionEvent &ev)
Functions called by the local event handling operators.
PCInvisTool(PixelCanvas *pcanvas, Display::KeySym keysym=Display::K_Pointer_Button1)
Constructor.
Class which stores PixelCanvas motion event information.
Definition: PCMotionEvent.h:82
Base class defining interface to pixel-based output devices.
Definition: PixelCanvas.h:161
casacore::Int itsX
Pixel coordinates of the position.
Definition: PCInvisTool.h:79
casacore::Int itsY
Definition: PCInvisTool.h:79
virtual void getFractional(casacore::Float &x, casacore::Float &y) const
Retrieve the position in fractional PixelCanvas coordinates.
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
float Float
Definition: aipstype.h:54
virtual void moved(const PCMotionEvent &ev)
virtual void keyReleased(const PCPositionEvent &amp;ev);
casacore::Bool itsMoved
Have we moved?
Definition: PCInvisTool.h:76
virtual void positionReady()
casacore::Function called when a position is ready.
Definition: PCInvisTool.h:65
Base implementation of PCTool for invisible (non-drawing) tools.
Definition: PCInvisTool.h:45
Class which stores PixelCanvas position event information.
Base class for PixelCanvas event-based tools.
Definition: PCTool.h:138
KeySym
Keysyms for PixelCanvas keyboard events.
Definition: DisplayEnums.h:412
virtual ~PCInvisTool()
Destructor.