WCPositionEH.h

Classes

WCPositionEH -- Base class for handling WorldCanvas position events. (full description)

class WCPositionEH

Interface

Public Members
WCPositionEH()
virtual void operator()(const WCPositionEvent & ev)
virtual ~WCPositionEH()

Description

Prerequisite

Etymology

WCPositionEH : WorldCanvas Position Event-Handler

Synopsis

WCPositionEH is a base class. Its operator() function is called by mechanisms within the Display Library when a keyboard key or mouse button is pressed while within the area of the world canvas.

Users must derive from this class and override the op () function to catch key and button presses. Positions in world, linear, and pixel coordinates are returned.

This base class does have a concrete implementation, namely to report to stdout events it receives. To effect this behaviour, create an instance this class and register it as an event-handler on a WorldCanvas.

Motivation

Provide the user with an object-oriented approach to event handling and include world-coordinate position information.

Example

see the test programs in Display/test.

Member Description

WCPositionEH()

Default Constructor Required

virtual void operator()(const WCPositionEvent & ev)

Default just prints the event to cout

virtual ~WCPositionEH()

Destructor