DOKK / manpages / debian 11 / ivtools-dev / Manipulator.3u.en
Manipulator(3U) InterViews Reference Manual Manipulator(3U)

Manipulator - base class for defining direct-manipulation semantics

#include <Unidraw/manip.h>

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.

Grasp is called once at the beginning of direct manipulation to allow the manipulator to initialize its internal state based on the initiating 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.
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.
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.

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

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

1 August 1990 Unidraw