casa
5.7.0-16
|
Base class for PixelCanvas event-based tools. More...
#include <PCTool.h>
Public Member Functions | |
PCTool (PixelCanvas *pcanvas, Display::KeySym keysym=Display::K_Pointer_Button1) | |
Constructor. More... | |
virtual | ~PCTool () |
Destructor. More... | |
virtual void | enable () |
Switch the tool on/off. More... | |
virtual void | disable () |
virtual void | operator() (const PCPositionEvent &ev) |
Required operators for event handling. More... | |
virtual void | operator() (const PCMotionEvent &ev) |
virtual void | operator() (const PCRefreshEvent &ev) |
virtual void | keyPressed (const PCPositionEvent &ev) |
Functions called by the local event handling operators. More... | |
virtual void | keyReleased (const PCPositionEvent &ev) |
virtual void | otherKeyPressed (const PCPositionEvent &ev) |
virtual void | otherKeyReleased (const PCPositionEvent &ev) |
virtual void | moved (const PCMotionEvent &ev) |
virtual void | refresh (const PCRefreshEvent &ev) |
virtual PixelCanvas * | pixelCanvas () const |
Get the PixelCanvas to which this Tool is attached. More... | |
virtual void | setKey (const Display::KeySym &keysym) |
Set/get which key to catch. More... | |
virtual Display::KeySym | getKey () const |
Protected Member Functions | |
virtual casacore::Bool | keyPresentlyDown (const PCMotionEvent &ev) |
Indicate whether key is presently pressed. More... | |
Private Attributes | |
PixelCanvas * | itsPixelCanvas |
The PixelCanvas to which this is connected. More... | |
Display::KeySym | itsKeySym |
The key to handle. More... | |
Display::KeyModifier | itsKeyModifier |
The modifier mask for the key. More... | |
casacore::Bool | itsEventHandlersRegistered |
Whether the event handlers are currently registered. More... | |
PCToolPosEH * | itsPositionEH |
The event handlers. More... | |
PCToolMotEH * | itsMotionEH |
PCToolRefEH * | itsRefreshEH |
Base class for PixelCanvas event-based tools.
Public interface
<prerequisites> PCPositionEH PCMotionEH PCRefreshEH </prerequisites>
PCTool stands for PixelCanvas Tool.
This class is a base class upon which tools which respond to various events on a PixelCanvas can be built. It wraps up the position, motion and refresh events so that the programmer sees them all coming into one class, where they can be dealt with in a unified manner. PCTool is not actually abstract, so the programmer need only write handlers for the events in which they are interested.
The majority of tools written for the PixelCanvas will fall into the category that this class serves: they respond to a single key or mouse button, and they potentially need to respond to position, motion and refresh events.
casa::PCTool::PCTool | ( | PixelCanvas * | pcanvas, |
Display::KeySym | keysym = Display::K_Pointer_Button1 |
||
) |
Constructor.
A PixelCanvas to attach to must be specified, and normally a key to respond to as well.
|
virtual |
Destructor.
|
virtual |
|
virtual |
Switch the tool on/off.
This simply registers or unregisters the event handlers.
|
inlinevirtual |
|
protectedvirtual |
Indicate whether key is presently pressed.
|
virtual |
Functions called by the local event handling operators.
By default they do nothing, so a derived class needs only implement the events it cares about.
Reimplemented in casa::PCInvisTool.
|
virtual |
|
virtual |
Reimplemented in casa::PCInvisTool.
|
virtual |
Required operators for event handling.
These are called when events occur, and distribute the events to the "user-level" methods.
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
inlinevirtual |
Get the PixelCanvas to which this Tool is attached.
Definition at line 179 of file PCTool.h.
References itsPixelCanvas.
|
virtual |
|
virtual |
Set/get which key to catch.
|
private |
|
private |
|
private |
|
private |
|
private |
The PixelCanvas to which this is connected.
Definition at line 199 of file PCTool.h.
Referenced by pixelCanvas().
|
private |
|
private |