Protected Members
- WCTool()
- WCTool(const WCTool &other)
- WCTool &operator=(const WCTool &other)
Review Status
- Date Reviewed:
- yyyy/mm/dd
WCPositionEH
WCMotionEH
WCRefreshEH
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
Member Description
Constructor taking a pointer to a WorldCanvas to which this tool
will attach, and a primary key to respond to.
Destructor.
virtual void enable()
virtual void disable()
Switch the tool on/off - this simply registers or unregisters
the event handlers
Required operators for event handling - these are called when
an events occur, and distribute the events to the "user-level"
methods
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
Get the WorldCanvas that this Tool is attached to
Get the PixelCanvas that this Tool is attached to via its WorldCanvas
(Required) default constructor.
WCTool(const WCTool &other)
(Required) copy constructor.
WCTool &operator=(const WCTool &other)
(Required) copy assignment.