Tool(3U) | InterViews Reference Manual | Tool(3U) |
Tool - base class for tool objects
#include <Unidraw/Tools/tool.h>
Tool is an abstract base class for objects that support direct manipulation of components. Tools employ animation and other visual effects for immediate feedback to reinforce the user's perception that he is dealing with real objects. The user grasps and wields a tool to achieve a desired effect. The effect may involve a change to one or more components' internal state, or it may change the way components are viewed, or there may be no effect at all (if for example the tool is used in an inapropriate context).
Conceptually, tools do their work within viewers, in which graphical component views are displayed and manipulated. Whenever a viewer receives an input event (such as a mouse click or key press), it in turn asks the current tool (defined by the enclosing editor object) to produce a manipulator object. A tool implements its CreateManipulator operation to create and initialize an appropriate manipulator, which encapsulates the tool's manipulation semantics by defining the three phases (grasp, wield, effect) of the manipulation. Moreover, a tool can delegate manipulator creation to one or more of the GraphicView objects in the viewer to allow component-specific interaction. A tool's InterpretManipulator operation accesses and analyzes information in the manipulator that characterizes the manipulation and then creates a command that carries out the desired effect. If a tool delegated manipulator creation to a graphical view, then it must delegate its interpretation to the same view.
CreateManipulator creates a manipulator that is appropriate for the tool. It receives the viewer in which the manipulation will take place, an event with which to initialize the manipulator if necessary, and the coordinate transformation that maps canvas coordinates into the subject's coordinate space. InterpretManipulator is called following manipulation and defines how to construct a command that carries out the manipulation's desired effect.
Catalog(3U), Command(3U), ControlInfo(3U), Editor(3U), Event(3I), GraphicView(3U), Manipulator(3U), Transformer(3I), Viewer(3U), classes(3U), istream(3C++), ostream(3C++)
24 January 1991 | Unidraw |