casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Member Functions | Private Attributes | List of all members
casa::WCTool Class Reference

Base class for WorldCanvas event-based tools. More...

#include <WCTool.h>

Inheritance diagram for casa::WCTool:
casa::DisplayTool casa::WCCrosshairTool casa::WCInvisTool casa::WCPolyTool casa::WCRectTool casa::WCPTRegion casa::WCRTRegion casa::WCRTZoomer

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 WorldCanvasworldCanvas () const
 Get the WorldCanvas that this Tool is attached to. More...
 
virtual PixelCanvaspixelCanvas () 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...
 
WCTooloperator= (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...
 
DisplayTooloperator= (const DisplayTool &other)
 Copy assignment using copy semantics. More...
 
Display::KeyModifier keyModifiers ()
 Return the modifier mask. More...
 

Private Attributes

WorldCanvasitsWorldCanvas
 The WorldCanvas to which this is connected. More...
 
PixelCanvasitsPixelCanvas
 The PixelCanvas to which this is connected via the WorldCanvas. More...
 
casacore::Bool itsEventHandlersRegistered
 whether the event handlers are registered More...
 
WCToolPosEHitsPositionEH
 event handlers: More...
 
WCToolMotEHitsMotionEH
 
WCToolRefEHitsRefreshEH
 

Detailed Description

Base class for WorldCanvas event-based tools.

Intended use:

Public interface

Review Status

Date Reviewed:
yyyy/mm/dd

<prerequisites> WCPositionEH WCMotionEH WCRefreshEH </prerequisites>

Etymology

WCTool stands for WorldCanvas Tool

Synopsis

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.

Example

Motivation

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.

To Do

Definition at line 141 of file WCTool.h.

Constructor & Destructor Documentation

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 casa::WCTool::~WCTool ( )
virtual

Destructor.

casa::WCTool::WCTool ( )
protected

(Required) default constructor.

casa::WCTool::WCTool ( const WCTool other)
protected

(Required) copy constructor.

Member Function Documentation

virtual void casa::WCTool::disable ( )
virtual
virtual void casa::WCTool::enable ( )
virtual

Switch the tool on/off - this simply registers or unregisters the event handlers.

Implements casa::DisplayTool.

virtual void casa::WCTool::keyPressed ( const WCPositionEvent )
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 void casa::WCTool::keyReleased ( const WCPositionEvent )
virtual
virtual void casa::WCTool::moved ( const WCMotionEvent ,
const viewer::region::region_list_type  
)
virtual
virtual void casa::WCTool::operator() ( const WCPositionEvent ev)
virtual

Required operators for event handling - these are called when an events occur, and distribute the events to the "user-level" methods.

virtual void casa::WCTool::operator() ( const WCMotionEvent ev)
virtual
virtual void casa::WCTool::operator() ( const WCRefreshEvent ev)
virtual
WCTool& casa::WCTool::operator= ( const WCTool other)
protected

(Required) copy assignment.

virtual void casa::WCTool::otherKeyPressed ( const WCPositionEvent )
virtual
virtual void casa::WCTool::otherKeyReleased ( const WCPositionEvent )
virtual
virtual PixelCanvas* casa::WCTool::pixelCanvas ( ) const
inlinevirtual

Get the PixelCanvas that this Tool is attached to via its WorldCanvas.

Definition at line 187 of file WCTool.h.

References itsPixelCanvas.

virtual void casa::WCTool::refresh ( const WCRefreshEvent )
virtual
virtual WorldCanvas* casa::WCTool::worldCanvas ( ) const
inlinevirtual

Get the WorldCanvas that this Tool is attached to.

Definition at line 182 of file WCTool.h.

References itsWorldCanvas.

Member Data Documentation

casacore::Bool casa::WCTool::itsEventHandlersRegistered
private

whether the event handlers are registered

Definition at line 211 of file WCTool.h.

WCToolMotEH* casa::WCTool::itsMotionEH
private

Definition at line 215 of file WCTool.h.

PixelCanvas* casa::WCTool::itsPixelCanvas
private

The PixelCanvas to which this is connected via the WorldCanvas.

Definition at line 208 of file WCTool.h.

Referenced by pixelCanvas().

WCToolPosEH* casa::WCTool::itsPositionEH
private

event handlers:

Definition at line 214 of file WCTool.h.

WCToolRefEH* casa::WCTool::itsRefreshEH
private

Definition at line 216 of file WCTool.h.

WorldCanvas* casa::WCTool::itsWorldCanvas
private

The WorldCanvas to which this is connected.

Definition at line 205 of file WCTool.h.

Referenced by worldCanvas().


The documentation for this class was generated from the following file: