Manipulator(3U)

NAME
Manipulator - base class for defining direct-manipulation semantics

SYNOPSIS
#include <Unidraw/manip.h>

DESCRIPTION
Tools use manipulator objects to encapsulate the mechanics of direct manipulation. Manipulators turn user input events into an animation sequence that characterize the manipulation. Manipulators abstract the manipulation into three phases: the grasping phase, which occurs at the start of the manipulation and lets the manipulator initialize state it will need in later phases; the manipulating phase, during which the manipulator accepts input events and generates graphical output that characterizes successive frames of the animation; and finally the effect phase, which occurs at the end of the manipulation and lets the manipulator finalize its state. Manipulator is an abstract base class. Subclasses support different manipulation semantics.

MANIPULATOR PUBLIC OPERATIONS

virtual void Grasp(Event&)
    Grasp is called once at the beginning of direct manipulation to allow the manipulator to initialize its internal state based on the initiating event.

virtual boolean Manipulating(Event&)
    Manipulating is called repeatedly during the manipulation whenever a new event arrives, until it returns false. Each call to Manipulating should produce a new frame of the animation that characterizes the manipulation.

virtual void Effect(Event&)
    Effect is called once at the end of direct manipulation to allow the manipulator to finalize its internal state based on the last event supplied to the Manipulating operation.

virtual void SetViewer(Viewer*)

virtual Viewer* GetViewer()

virtual void SetTool(Tool*)

virtual Tool* GetTool()
    Get and set the viewer, in which the manipulator generates graphical output, and the tool that created the manipulator. These operations do nothing by default; subclasses that require this information must redefine these operations to assign and retrieve the state they require.

MANIPULATOR PROTECTED OPERATIONS

Manipulator()
    The constructor is protected to disallow instantiation of abstract base class objects.

SEE ALSO
Event(3I), Tool(3U), Viewer(3U)