casa
5.7.0-16
|
Base class for WorldCanvas event-based tools. More...
#include <WCTool.h>
Public Member Functions | |
WCTool (WorldCanvas *wcanvas, const Display::KeySym &keysym=Display::K_Pointer_Button1) | |
Constructor taking a pointer to a WorldCanvas to which this tool will attach, and a primary key to respond to. More... | |
virtual | ~WCTool () |
Destructor. More... | |
virtual void | enable () |
Switch the tool on/off - this simply registers or unregisters the event handlers. More... | |
virtual void | disable () |
virtual void | operator() (const WCPositionEvent &ev) |
Required operators for event handling - these are called when an events occur, and distribute the events to the "user-level" methods. More... | |
virtual void | operator() (const WCMotionEvent &ev) |
virtual void | operator() (const WCRefreshEvent &ev) |
virtual void | keyPressed (const WCPositionEvent &) |
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. More... | |
virtual void | keyReleased (const WCPositionEvent &) |
virtual void | otherKeyPressed (const WCPositionEvent &) |
virtual void | otherKeyReleased (const WCPositionEvent &) |
virtual void | moved (const WCMotionEvent &, const viewer::region::region_list_type &) |
virtual void | refresh (const WCRefreshEvent &) |
virtual WorldCanvas * | worldCanvas () const |
Get the WorldCanvas that this Tool is attached to. More... | |
virtual PixelCanvas * | pixelCanvas () const |
Get the PixelCanvas that this Tool is attached to via its WorldCanvas. More... | |
Public Member Functions inherited from casa::DisplayTool | |
virtual | ~DisplayTool () |
Destructor. More... | |
virtual void | setKey (const Display::KeySym &keysym) |
Set/get which key to catch. More... | |
virtual Display::KeySym | getKey () const |
Protected Member Functions | |
WCTool () | |
(Required) default constructor. More... | |
WCTool (const WCTool &other) | |
(Required) copy constructor. More... | |
WCTool & | operator= (const WCTool &other) |
(Required) copy assignment. More... | |
Protected Member Functions inherited from casa::DisplayTool | |
DisplayTool (const Display::KeySym &keysym=Display::K_Pointer_Button1) | |
Constructor taking a key to which this tool will initially be attached, typically one of the pointer buttons. More... | |
DisplayTool (const DisplayTool &other) | |
Copy constructor - construct a new DisplayTool from other , using copy semantics. More... | |
DisplayTool & | operator= (const DisplayTool &other) |
Copy assignment using copy semantics. More... | |
Display::KeyModifier | keyModifiers () |
Return the modifier mask. More... | |
Private Attributes | |
WorldCanvas * | itsWorldCanvas |
The WorldCanvas to which this is connected. More... | |
PixelCanvas * | itsPixelCanvas |
The PixelCanvas to which this is connected via the WorldCanvas. More... | |
casacore::Bool | itsEventHandlersRegistered |
whether the event handlers are registered More... | |
WCToolPosEH * | itsPositionEH |
event handlers: More... | |
WCToolMotEH * | itsMotionEH |
WCToolRefEH * | itsRefreshEH |
Base class for WorldCanvas event-based tools.
Public interface
<prerequisites> WCPositionEH WCMotionEH WCRefreshEH </prerequisites>
WCTool stands for WorldCanvas Tool
This class is a base class upon which tools which respond to various events on a WorldCanvas 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. WCTool 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 WorldCanvas 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::WCTool::WCTool | ( | WorldCanvas * | wcanvas, |
const Display::KeySym & | keysym = Display::K_Pointer_Button1 |
||
) |
Constructor taking a pointer to a WorldCanvas to which this tool will attach, and a primary key to respond to.
|
virtual |
Destructor.
|
protected |
(Required) default constructor.
|
protected |
(Required) copy constructor.
|
virtual |
Implements casa::DisplayTool.
Reimplemented in casa::WCCrosshairTool, casa::WCPolyTool, and casa::WCRectTool.
|
virtual |
Switch the tool on/off - this simply registers or unregisters the event handlers.
Implements casa::DisplayTool.
|
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::WCCrosshairTool, casa::WCPolyTool, casa::WCRectTool, and casa::WCInvisTool.
|
virtual |
Reimplemented in casa::WCCrosshairTool, casa::WCPolyTool, casa::WCRectTool, and casa::WCInvisTool.
|
virtual |
Reimplemented in casa::WCCrosshairTool, casa::WCPolyTool, casa::WCRectTool, and casa::WCInvisTool.
|
virtual |
Required operators for event handling - these are called when an events occur, and distribute the events to the "user-level" methods.
|
virtual |
|
virtual |
|
virtual |
Reimplemented in casa::WCCrosshairTool, casa::WCPolyTool, and casa::WCRectTool.
|
virtual |
|
inlinevirtual |
Get the PixelCanvas that this Tool is attached to via its WorldCanvas.
Definition at line 187 of file WCTool.h.
References itsPixelCanvas.
|
virtual |
Reimplemented in casa::WCCrosshairTool, casa::WCPolyTool, and casa::WCRectTool.
|
inlinevirtual |
Get the WorldCanvas that this Tool is attached to.
Definition at line 182 of file WCTool.h.
References itsWorldCanvas.
|
private |
|
private |
|
private |
The PixelCanvas to which this is connected via the WorldCanvas.
Definition at line 208 of file WCTool.h.
Referenced by pixelCanvas().
|
private |
|
private |
|
private |
The WorldCanvas to which this is connected.
Definition at line 205 of file WCTool.h.
Referenced by worldCanvas().