![](../../Home/Icons/Home.gif)
![](../icons/UpCNM.gif)
![](../icons/CNMContext.gif)
![](../../Home/Icons/Search.gif)
Taxonomy Categories:
Member Functions:
Interface Category:
API.
Inherits From:
TToolInteractor, MMouseEventHandler
Inherited By:
TCanvasDragInteractor
TCanvasMulticlickInteractor
Purpose:
Abstract base class for all canvas interactors. Provides member functions for recording points that occur during interaction, for saving modifier keys state at any point during interaction, and for later accessing these to be processed at the end of interaction.
Canvas interaction is a process that starts, continues, and eventually ends. Derived classes associate specific events with these stages of the process. For example, a drag interactor associates mouse down with start, mouse move with continue, and mouse up with end. A derived class can model a particular style of interaction (for example, drag interaction) while leaving the details concerning what the interaction is used for to yet another further derived class. The derived class that models an interaction style mixes in the appropriate event handler classes and implements the handling of specific events to record points and modifier keys and calls StartInteraction, ContinueInteraction, and EndInteraction. Another class that derives from this class can override StartInteraction, ContinueInteraction, and/or EndInteraction to access the previously recorded points and modifier keys and take specific actions. For instance, a derived class might override EndInteraction to access the first and last recorded points and do a command to add a canvas line that has these endpoints.
Derived classes also call DrawFeedback when visual feedback should be provided during interaction, and override DrawFeedback to implement the drawing of visual feedback. Typically, a derived class that models an interaction style calls DrawFeedback.
Instantiation:
Allocate on the heap or the stack.
Deriving Classes:
Abstract base class; must be derived.
Concurrency:
Not multithread safe.
Resource Use:
No special requirements.
TCanvasInteractor (MToolHandler *)
Interface Category:
API.
Purpose:
Constructor.
Calling Context:
Called by constructors of derived classes.
Parameters:
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
virtual ~ TCanvasInteractor ()
Interface Category:
API.
Purpose:
Destructor.
Calling Context:
Called to destroy an object.
Parameters:
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
virtual void DrawFeedback ()
Interface Category:
API.
Purpose:
Implements how the feedback is drawn.
Calling Context:
Called by a derived class that models an interaction style.
Parameters:
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
Pure virtual function; must be overridden.
Member Function: TCanvasInteractor::StartInteraction
virtual void StartInteraction ()
Interface Category:
API.
Purpose:
Implements what semantic action takes place when interaction starts. Typically, a command binding is executed by calling MToolInteractor::DoBegin.
Calling Context:
Called by a derived class that models an interaction style.
Parameters:
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
Pure virtual function; must be overridden.
Member Function: TCanvasInteractor::ContinueInteraction
virtual void ContinueInteraction ()
Interface Category:
API.
Purpose:
Implements what semantic action takes place as interaction continues. Typically, a command binding is executed by calling MToolInteractor::DoIncrement.
Calling Context:
Called by a derived class that models an interaction style.
Parameters:
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
Pure virtual function; must be overridden.
virtual void EndInteraction ()
Interface Category:
API.
Purpose:
Implements what semantic action takes place when interaction ends. Typically, a command binding is executed by calling either MToolInteractor::AdoptAndDoEnd or MToolHandler::AdoptAndDo.
Calling Context:
Called by a derived class that models an interaction style.
Parameters:
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
Pure virtual function; must be overridden.
virtual void RecordPoint (const TGPoint &)
Interface Category:
API.
Purpose:
Adds the specified point to the end of the point log.
Calling Context:
Typically called by a derived class that models an interaction style.
Parameters:
- const TGPoint & -The point to record.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
virtual TGPointArray GetPoints () const
Interface Category:
API.
Purpose:
Provides access to all the points that have been recorded as a point array.
Calling Context:
Typically called by a derived class that binds an interaction style to doing a command.
Parameters:
Return Value:
TGPointArray -The points.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
virtual TGPoint GetPoint (unsigned long index) const
Interface Category:
API.
Purpose:
Provides access to a specified point that has been recorded.
Calling Context:
Typically called by a derived class that binds an interaction style to doing a command.
Parameters:
- unsigned long index -The index of the point to access in the point log.
Return Value:
TGPoint -The specified point.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
virtual TGPoint GetFirstPoint () const
Interface Category:
API.
Purpose:
Provides access to the first point that has been recorded.
Calling Context:
Typically called by a derived class that binds an interaction style to doing a command.
Parameters:
Return Value:
TGPoint -The first recorded point.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
virtual TGPoint GetLastPoint () const
Interface Category:
API.
Purpose:
Provides access to the last point that has been recorded.
Calling Context:
Typically called by a derived class that binds an interaction style to doing a command.
Parameters:
Return Value:
TGPoint -The last recorded point.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TCanvasInteractor::GetNumberOfPoints
virtual unsigned long GetNumberOfPoints () const
Interface Category:
API.
Purpose:
Identifies the number of recorded points in the point log.
Calling Context:
Typically called by a derived class that binds an interaction style to doing a command.
Parameters:
Return Value:
unsigned long -The number of recorded points in the point log.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
virtual TGRect GetBounds () const
Interface Category:
API.
Purpose:
Computes the tightest enclosing rectangular bounds of all the points in the point log.
Calling Context:
Typically called by a derived class that binds an interaction style to doing a command.
Parameters:
Return Value:
TGRect -The bounds.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
virtual TGPoint RemoveLastPoint ()
Interface Category:
API.
Purpose:
Removes the last point from the point log.
Calling Context:
Typically called by a derived class that refines an interaction style of its base class. For example, the base class can record a point for each click and a point for a final double click. The derived class might want to remove the final double-click point to refine the interaction style.
Parameters:
Return Value:
TGPoint -The point that is removed.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
virtual void SetModifierKeys (const TModifierKeys &)
Interface Category:
API.
Purpose:
Saves the modifier key state for later access.
Calling Context:
Typically called by a derived class that models an interaction style.
Parameters:
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
virtual TModifierKeys GetModifierKeys () const
Interface Category:
API.
Purpose:
Provides access to the modifier keys that have previously been saved with SetModifierKeys.
Calling Context:
Typically called by a derived class that binds an interaction style to doing a command.
Parameters:
Return Value:
TModifierKeys -The modifier keys.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.