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 ini-
tialize state it will need in later phases; the manipulat-
ing 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 manip-
ulation whenever a new event arrives, until it
returns false. Each call to Manipulating should
produce a new frame of the animation that charac-
terizes the manipulation.
virtual void Effect(Event&)
Effect is called once at the end of direct manipu-
lation 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 cre-
ated the manipulator. These operations do nothing
by default; subclasses that require this informa-
tion must redefine these operations to assign and
retrieve the state they require.
Manipulator()
The constructor is protected to disallow instantia-
tion of abstract base class objects.
SEE ALSO
Event(3I), Tool(3U), Viewer(3U)
Man(1) output converted with
man2html