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 Member Functions | Private Attributes | List of all members
casa::DisplayTool Class Referenceabstract

Base class for event-based tools in the display classes. More...

#include <DisplayTool.h>

Inheritance diagram for casa::DisplayTool:
casa::MultiWCTool casa::WCTool casa::MWCCrosshairTool casa::MWCEllipseTool casa::MWCPannerTool casa::MWCPolylineTool casa::MWCPolyTool casa::MWCPositionVelocityTool casa::MWCRectTool casa::MWCRulerlineTool casa::RegionTool casa::WCCrosshairTool casa::WCInvisTool casa::WCPolyTool casa::WCRectTool

Public Member Functions

virtual ~DisplayTool ()
 Destructor. More...
 
virtual void enable ()=0
 Switch the tool on/off. More...
 
virtual void disable ()=0
 
virtual void setKey (const Display::KeySym &keysym)
 Set/get which key to catch. More...
 
virtual Display::KeySym getKey () const
 

Protected Member Functions

 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 Member Functions

void chooseKeyModifier ()
 Support function to choose a key modifier for the tool key. More...
 

Private Attributes

Display::KeySym itsKeySym
 The key to handle. More...
 
Display::KeyModifier itsKeyModifier
 The modifier mask for the key. More...
 

Detailed Description

Base class for event-based tools in the display classes.

Intended use:

Internal

Review Status

Reviewed By:
Ralph Marson
Date Reviewed:
2000/04/18
Test programs:
tDisplayTool

Etymology

"DisplayTool" is a base interface for "Tools" to be used in "Display" applications.

Etymology

Synopsis

This class is a simple base class which provides a suitable base upon which to build interactive user tools for the display classes. It simply provides a facility to setup a key to catch and respond to, and an interface to enable and disable the tool.

Example

A function to provide information about a DisplayTool might look like:

void MyClass::printToolKey(const DisplayTool &tool) const {
cout << tool.getKey() << endl;
}

Motivation

This class unites all key handling for display tools.

Definition at line 74 of file DisplayTool.h.

Constructor & Destructor Documentation

virtual casa::DisplayTool::~DisplayTool ( )
virtual

Destructor.

casa::DisplayTool::DisplayTool ( const Display::KeySym keysym = Display::K_Pointer_Button1)
explicitprotected

Constructor taking a key to which this tool will initially be

attached, typically one of the pointer buttons.

casa::DisplayTool::DisplayTool ( const DisplayTool other)
protected

Copy constructor - construct a new DisplayTool from other, using copy semantics.

Member Function Documentation

void casa::DisplayTool::chooseKeyModifier ( )
private

Support function to choose a key modifier for the tool key.

virtual void casa::DisplayTool::disable ( )
pure virtual
virtual void casa::DisplayTool::enable ( )
pure virtual

Switch the tool on/off.

This simply registers or unregisters the event handlers.

Implemented in casa::WCTool, casa::RegionTool, and casa::MultiWCTool.

virtual Display::KeySym casa::DisplayTool::getKey ( ) const
virtual
Display::KeyModifier casa::DisplayTool::keyModifiers ( )
inlineprotected

Return the modifier mask.

Some keys, specifically the mouse (pointer) buttons, have associated with them a bit mask which is used to determine if that key is currently held down. This function returns the modifier for the key of this tool, and returns 0 if the key does not have a modifier bit mask, eg. it is an alphanumeric key on the keyboard.

Definition at line 114 of file DisplayTool.h.

References itsKeyModifier.

DisplayTool& casa::DisplayTool::operator= ( const DisplayTool other)
protected

Copy assignment using copy semantics.

virtual void casa::DisplayTool::setKey ( const Display::KeySym keysym)
virtual

Set/get which key to catch.

Member Data Documentation

Display::KeyModifier casa::DisplayTool::itsKeyModifier
private

The modifier mask for the key.

Definition at line 124 of file DisplayTool.h.

Referenced by keyModifiers().

Display::KeySym casa::DisplayTool::itsKeySym
private

The key to handle.

Definition at line 121 of file DisplayTool.h.


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