casa
5.7.0-16
|
Base class for MultiWorldCanvas event-based tools. More...
#include <MultiWCTool.h>
Public Member Functions | |
MultiWCTool (const Display::KeySym &keysym=Display::K_Pointer_Button1, bool enable_events=true) | |
Constructor taking the primary key to which this tool will respond. More... | |
virtual | ~MultiWCTool () |
Destructor. More... | |
virtual void | addWorldCanvas (WorldCanvas &worldcanvas) |
Add/remove a WorldCanvas from the control of this tool. More... | |
virtual void | removeWorldCanvas (WorldCanvas &worldcanvas) |
virtual void | addWorldCanvases (PanelDisplay *pdisp) |
Add/Remove a list of WorldCanvases from PanelDisplay. More... | |
virtual void | removeWorldCanvases (PanelDisplay *pdisp) |
virtual void | enable () |
Switch the tool on/off - this simply registers or unregisters the event handlers on the WorldCanvases. More... | |
virtual void | disable () |
virtual void | operator() (const WCPositionEvent &ev) |
Required operators for event handling - these are called when events occur, and distribute the events to the "user-level" methods. More... | |
virtual void | operator() (const WCMotionEvent &ev) |
default sends event to cout More... | |
virtual void | operator() (const WCRefreshEvent &ev) |
original handler interface (still used for WCRefreshEvents) More... | |
virtual void | reset (casacore::Bool=false) |
Derived classes should implement this to return to the non-showing, non-active state. 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 |
Public Member Functions inherited from casa::WCPositionEH | |
WCPositionEH () | |
Default Constructor Required. More... | |
virtual | ~WCPositionEH () |
Destructor. More... | |
Public Member Functions inherited from casa::WCMotionEH | |
WCMotionEH () | |
Default Constructor Required. More... | |
virtual | ~WCMotionEH () |
Destructor. More... | |
Public Member Functions inherited from casa::WCRefreshEH | |
WCRefreshEH () | |
Default Constructor Required. More... | |
virtual | ~WCRefreshEH () |
Destructor. More... | |
Public Member Functions inherited from casa::DisplayEH | |
virtual void | handleEvent (DisplayEvent &) |
Classes that contain this interface (i.e., derive from it) can override this method to implement actions for whatever types of DisplayEvent they're interested in. More... | |
virtual | ~DisplayEH () |
Protected Member Functions | |
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 | updateRegion () |
virtual void | clicked (casacore::Int, casacore::Int) |
virtual void | doubleClicked (casacore::Int, casacore::Int) |
virtual void | draw (const WCRefreshEvent &, const viewer::region::region_list_type &) |
Draw whatever should be drawn (if anything) on current WC. More... | |
virtual void | refresh () |
Copy back-to-front buffer (erasing all MWCTool drawings), then cause this (and all MWCTools on current WC's PC) to draw (or not draw) themselves, according to their current state. More... | |
virtual void | setClipToDrawArea () |
Cause subsequent drawing commands to be clipped to the current WC (or its drawing area). More... | |
virtual void | setClipToWC () |
virtual void | resetClip () |
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... | |
Protected Attributes | |
WorldCanvas * | itsCurrentWC |
WC being (or to be) drawn on (may be 0 initially). More... | |
Private Member Functions | |
MultiWCTool () | |
copy, default constructors (do not use) More... | |
MultiWCTool (const MultiWCTool &other) | |
MultiWCTool & | operator= (const MultiWCTool &other) |
Private Attributes | |
std::list< WorldCanvas * > | itsWCList |
casacore::Bool | itsEventHandlersRegistered |
whether the event handlers are registered More... | |
Friends | |
class | MWCRTZoomer |
The WorldCanvases to which this tool is connected. More... | |
class | MWCPannerTool |
Base class for MultiWorldCanvas event-based tools.
Public interface
<prerequisites> WCPositionEH WCMotionEH WCRefreshEH </prerequisites>
MultiWCTool stands for MultiWorldCanvas 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. MultiWCTool 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.
Definition at line 89 of file MultiWCTool.h.
casa::MultiWCTool::MultiWCTool | ( | const Display::KeySym & | keysym = Display::K_Pointer_Button1 , |
bool | enable_events = true |
||
) |
Constructor taking the primary key to which this tool will respond.
|
virtual |
Destructor.
|
private |
copy, default constructors (do not use)
|
private |
|
virtual |
Add/remove a WorldCanvas from the control of this tool.
|
virtual |
Add/Remove a list of WorldCanvases from PanelDisplay.
|
inlineprotectedvirtual |
Reimplemented in casa::QtPVToolRegion, casa::QtPolylineToolRegion, casa::QtPTRegion, casa::QtELRegion, casa::QtOldPTRegion, casa::QtPointRegion, casa::QtOldELRegion, casa::QtRTRegion, and casa::QtOldRTRegion.
Definition at line 150 of file MultiWCTool.h.
|
virtual |
Implements casa::DisplayTool.
Reimplemented in casa::RegionTool, casa::MWCCrosshairTool, casa::MultiPVTool, casa::MultiRectTool, casa::MultiPolyTool, casa::MWCPolyTool, casa::MWCPolylineTool, casa::MWCRectTool, casa::MWCEllipseTool, and casa::MultiPolylineTool.
|
inlineprotectedvirtual |
Reimplemented in casa::QtPVToolRegion, casa::QtPolylineToolRegion, casa::QtPTRegion, casa::QtELRegion, casa::QtOldPTRegion, casa::QtPointRegion, casa::QtOldELRegion, casa::QtRTRegion, and casa::QtOldRTRegion.
Definition at line 151 of file MultiWCTool.h.
|
protectedvirtual |
Draw whatever should be drawn (if anything) on current WC.
Should only be called by refresh event handler.
Reimplemented in casa::MultiPVTool, casa::MultiRectTool, casa::MultiPolyTool, casa::MultiPolylineTool, casa::MWCCrosshairTool, casa::MWCPolyTool, casa::MWCRectTool, casa::MWCEllipseTool, casa::MWCPolylineTool, casa::MWCPannerTool, casa::RegionTool, casa::MWCRulerlineTool, and casa::MWCPositionVelocityTool.
|
virtual |
Switch the tool on/off - this simply registers or unregisters the event handlers on the WorldCanvases.
Implements casa::DisplayTool.
Reimplemented in casa::RegionTool.
|
protectedvirtual |
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::MultiPVTool, casa::MultiRectTool, casa::MultiPolyTool, casa::MultiPolylineTool, casa::MWCCrosshairTool, casa::MWCPolyTool, casa::MWCRectTool, casa::MWCEllipseTool, casa::MWCPolylineTool, casa::RegionTool, casa::MWCPannerTool, casa::MWCRulerlineTool, and casa::MWCPositionVelocityTool.
|
protectedvirtual |
Reimplemented in casa::MultiPVTool, casa::MultiRectTool, casa::MultiPolyTool, casa::MultiPolylineTool, casa::MWCCrosshairTool, casa::MWCPolyTool, casa::MWCRectTool, casa::MWCEllipseTool, casa::MWCPolylineTool, casa::RegionTool, casa::MWCPannerTool, casa::MWCRulerlineTool, and casa::MWCPositionVelocityTool.
|
protectedvirtual |
Reimplemented in casa::MultiPVTool, casa::MultiRectTool, casa::MultiPolyTool, casa::MultiPolylineTool, casa::MWCCrosshairTool, casa::MWCRectTool, casa::MWCPolyTool, casa::MWCEllipseTool, casa::MWCPolylineTool, casa::RegionTool, casa::MWCPannerTool, casa::MWCRulerlineTool, and casa::MWCPositionVelocityTool.
|
virtual |
Required operators for event handling - these are called when events occur, and distribute the events to the "user-level" methods.
Implements casa::WCPositionEH.
|
virtual |
default sends event to cout
Implements casa::WCMotionEH.
|
virtual |
original handler interface (still used for WCRefreshEvents)
Implements casa::WCRefreshEH.
|
private |
|
protectedvirtual |
|
protectedvirtual |
Reimplemented in casa::RegionTool.
|
protectedvirtual |
Copy back-to-front buffer (erasing all MWCTool drawings), then cause this (and all MWCTools on current WC's PC) to draw (or not draw) themselves, according to their current state.
Mouse and kbd event handlers within the tools now call this in response to drawing state changes, rather than calling draw() directly, so that only valid tool drawings are displayed, even when more than one is active. NB: the meaning of this routine has changed to be more in line with the rest of the DL (i.e., it now causes, rather than responds to, refresh events).
|
virtual |
|
virtual |
|
inlinevirtual |
Derived classes should implement this to return to the non-showing, non-active state.
It should not unregister the tool from WCs or disable event handling. If skipRefresh is false and the tool was showing, it also calls refresh() to erase. (The caller should set skipRefresh=true (only) if it will handle refresh itself).
Reimplemented in casa::MWCCrosshairTool, casa::MultiPVTool, casa::MultiRectTool, casa::MultiPolyTool, casa::MWCPolyTool, casa::MWCPolylineTool, casa::MWCRectTool, casa::MWCEllipseTool, casa::MultiPolylineTool, casa::MWCPannerTool, casa::MWCRulerlineTool, and casa::MWCPositionVelocityTool.
Definition at line 136 of file MultiWCTool.h.
|
protectedvirtual |
|
protectedvirtual |
Cause subsequent drawing commands to be clipped to the current WC (or its drawing area).
Be sure to reset when finished drawing; clipping will apply to drawing on entire PC.
|
protectedvirtual |
|
inlineprotectedvirtual |
Reimplemented in casa::QtPVTool, casa::QtCrossTool, casa::QtRectTool, casa::QtEllipseTool, casa::QtOldRectTool, casa::QtPolylineTool, casa::QtOldEllipseTool, casa::QtPolyTool, and casa::QtOldPolyTool.
Definition at line 149 of file MultiWCTool.h.
|
friend |
Definition at line 193 of file MultiWCTool.h.
|
friend |
The WorldCanvases to which this tool is connected.
Definition at line 192 of file MultiWCTool.h.
|
protected |
WC being (or to be) drawn on (may be 0 initially).
WC where latest relevant input event was received.
Definition at line 180 of file MultiWCTool.h.
|
private |
whether the event handlers are registered
Definition at line 197 of file MultiWCTool.h.
|
private |
Definition at line 194 of file MultiWCTool.h.