Public Member Functions | Protected Attributes

Manipulator Class Reference

This reference page is linked to from the following overview topics: Plug-in Base Classes.


Search for all occurrences

Detailed Description

See also:
Class HelperObject, Class SimpleManipulator, Class IManipulatorMgr, Class INode, Class ViewExp, Class IPoint2, Class Box3

Description:
This class is available in release 4.0 and later only.

This is the base class for the development of Manipulator plug-ins. Shown are the methods that need to be implemented by the plug-in. Most of these methods are implemented by the SimpleManipulator class so most developers will not need to use these unless SimpleManipulator is not sufficient.
Data Members:
protected:

INode* mpINode;

The node being manipulated

#include <manipulator.h>

Inheritance diagram for Manipulator:
Inheritance graph
[legend]

List of all members.

Public Member Functions

ManipExport  Manipulator (INode *pINode)
BOOL  IsManipulator ()
virtual int  HitTest (TimeValue t, INode *pNode, int type, int crossing, int flags, IPoint2 *pScreenPoint, ViewExp *pVpt)=0
virtual int  Display (TimeValue t, INode *pNode, ViewExp *pVpt, int flags)=0
virtual void  GetLocalBoundBox (TimeValue t, INode *inode, ViewExp *vp, Box3 &box)=0
virtual ManipExport bool  AlwaysActive ()
virtual MSTR GetManipName ()=0
virtual DisplayState  MouseEntersObject (TimeValue t, ViewExp *pVpt, IPoint2 &m, ManipHitData *pHitData)
virtual DisplayState  MouseLeavesObject (TimeValue t, ViewExp *pVpt, IPoint2 &m, ManipHitData *pHitData)
virtual void  OnMouseMove (TimeValue t, ViewExp *pVpt, IPoint2 &m, DWORD flags, ManipHitData *pHitData)
virtual void  OnButtonDown (TimeValue t, ViewExp *pVpt, IPoint2 &m, DWORD flags, ManipHitData *pHitData)
virtual void  OnButtonUp (TimeValue t, ViewExp *pVpt, IPoint2 &m, DWORD flags, ManipHitData *pHitData)
virtual INode GetINode ()
virtual ManipExport void  DeleteThis ()

Protected Attributes

INode mpINode

Constructor & Destructor Documentation

ManipExport Manipulator ( INode pINode ) [inline]
Remarks:
Constructor. The node data member is initialized to the node passed.
{ mpINode = pINode; }

Member Function Documentation

BOOL IsManipulator ( ) [inline, virtual]

Reimplemented from Object.

{ return TRUE; }
virtual int HitTest ( TimeValue  t,
INode pNode,
int  type,
int  crossing,
int  flags,
IPoint2 pScreenPoint,
ViewExp pVpt 
) [pure virtual]
Remarks:
This method is called to determine if the specified screen point intersects the manipulator. The method returns nonzero if the item was hit; otherwise 0. This is like the normal HitTest() method in the BaseObject class. The difference is that it needs to log it hits in the viewport SubObjectHitList. It does this using the ManipHitData class defined in Manipulator.h.
Parameters:
TimeValue t

The time to perform the hit test.

INode* pNode

A pointer to the node to test.

int type

The type of hit testing to perform. See Scene and Node Hit Test Types..

int crossing

The state of the crossing setting. If TRUE crossing selection is on.

int flags

The hit test flags. See Scene and Node Hit Testing Flags.

IPoint2 *pScreenPoint

Points to the screen point to test.

ViewExp *pVpt

An interface that may be used to call methods associated with the viewports.
Returns:
Nonzero if the item was hit; otherwise 0.

Reimplemented from BaseObject.

Implemented in SimpleManipulator, and MSSimpleManipulatorXtnd.

virtual int Display ( TimeValue  t,
INode pNode,
ViewExp pVpt,
int  flags 
) [pure virtual]
Remarks:
This method lines the BaseObject::Display() method and displays the manipulator object.
Parameters:
TimeValue t

The time to display the object.

INode* pNode

Points to the node that is being manipulated by the manipulator.

ViewExp *pVpt

An interface that may be used to call methods associated with the viewports.

int flags

See List of Display Flags.
Returns:
The return value is not currently used.

Reimplemented from BaseObject.

Implemented in SimpleManipulator, and MSSimpleManipulatorXtnd.

virtual void GetLocalBoundBox ( TimeValue  t,
INode inode,
ViewExp vp,
Box3 box 
) [pure virtual]
Remarks:
Used Internally.

Returns the object space bounding box of the manipulator in the object's local coordinates.
Parameters:
TimeValue t

The time to retrieve the bounding box.

INode* inode

The node that is being manipulated by the manipulator.

ViewExp* vp

An interface that may be used to call methods associated with the viewports.

Box3& box

The bounding box is returned here.

Reimplemented from BaseObject.

Implemented in SimpleManipulator, and MSSimpleManipulatorXtnd.

virtual ManipExport bool AlwaysActive ( ) [inline, virtual]
Remarks:
This method can be used to tell the manipulator management system that this manipulator is always active.
Default Implementation:
{ return false; }
{ return false; }
virtual MSTR& GetManipName ( ) [pure virtual]
Remarks:
This method returns the manipulator name string. The SimpleManipulator class uses this method for the tooltip in the viewport.

Implemented in SimpleManipulator.

virtual DisplayState MouseEntersObject ( TimeValue  t,
ViewExp pVpt,
IPoint2 m,
ManipHitData pHitData 
) [inline, virtual]
Remarks:
This method gets called when the mouse first passes over a manipulator object. The return value is used to determine whether a redraw is needed or not. Normally manipulators display in a different color when the mouse is over them, so this should return kFullRedrawNeeded.
Parameters:
TimeValue t

The time to display the object.

ViewExp* pVpt

An interface that may be used to call methods associated with the viewports.

IPoint2& m

The location of the tooltip.

ManipHitData* pHitData

A pointer to the hitdata containing information on which manipulator was hit.
Returns:
The display state indicating whether no redraw, a full redraw, or a post redraw is needed.
Default Implementation:
{return kNoRedrawNeeded; }

Reimplemented in SimpleManipulator.

        {return kNoRedrawNeeded; }
virtual DisplayState MouseLeavesObject ( TimeValue  t,
ViewExp pVpt,
IPoint2 m,
ManipHitData pHitData 
) [inline, virtual]
Remarks:
This method gets called when the mouse leaves the manipulator object. The return value is used to determine whether a redraw is needed or not. Normally manipulators display in a different color when the mouse is over them, so this should return kFullRedrawNeeded.
Parameters:
TimeValue t

The time to display the object.

ViewExp* pVpt

An interface that may be used to call methods associated with the viewports.

IPoint2& m

The location of the tooltip.

ManipHitData* pHitData

A pointer to the hitdata containing information on which manipulator was hit.
Returns:
The display state indicating whether no redraw, a full redraw, or a post redraw is needed.
Default Implementation:
{return kNoRedrawNeeded; }

Reimplemented in SimpleManipulator.

        {return kNoRedrawNeeded; }
virtual void OnMouseMove ( TimeValue  t,
ViewExp pVpt,
IPoint2 m,
DWORD  flags,
ManipHitData pHitData 
) [inline, virtual]
Remarks:
This method gets called when the mouse is pressed down and moves within the manipulator context. It is the method that does the actual manipulator. It is up to the manipulator code to turn the mouse position into a new value for the parameter(s) being manipulated.
Parameters:
TimeValue t

The time to display the object.

ViewExp* pVpt

An interface that may be used to call methods associated with the viewports.

IPoint2& m

The location of the tooltip.

DWORD flags

Not used, should be set to 0.

ManipHitData* pHitData

A pointer to the hitdata containing information on which manipulator was hit.
Default Implementation:
{ }

Reimplemented in SimpleManipulator, MSPluginSimpleManipulator, and MSSimpleManipulatorXtnd.

{}
virtual void OnButtonDown ( TimeValue  t,
ViewExp pVpt,
IPoint2 m,
DWORD  flags,
ManipHitData pHitData 
) [inline, virtual]
Remarks:
This method gets called when the mouse buttons is first pressed down within the manipulator context.
Parameters:
TimeValue t

The time to display the object.

ViewExp* pVpt

An interface that may be used to call methods associated with the viewports.

IPoint2& m

The location of the tooltip.

DWORD flags

Not used, should be set to 0.

ManipHitData* pHitData

A pointer to the hitdata containing information on which manipulator was hit.
Default Implementation:
{ }

Reimplemented in SimpleManipulator, MSPluginSimpleManipulator, and MSSimpleManipulatorXtnd.

{}
virtual void OnButtonUp ( TimeValue  t,
ViewExp pVpt,
IPoint2 m,
DWORD  flags,
ManipHitData pHitData 
) [inline, virtual]
Remarks:
This method gets called when the mouse buttons is released within the manipulator context, and thus signals the end of the manipulation.
Parameters:
TimeValue t

The time to display the object.

ViewExp* pVpt

An interface that may be used to call methods associated with the viewports.

IPoint2& m

The location of the tooltip.

DWORD flags

Not used, should be set to 0.

ManipHitData* pHitData

A pointer to the hitdata containing information on which manipulator was hit.
Default Implementation:
{ }

Reimplemented in SimpleManipulator, MSPluginSimpleManipulator, and MSSimpleManipulatorXtnd.

{}
virtual INode* GetINode ( ) [inline, virtual]
Remarks:
This method returns a pointer to the INode that is currently being manipulated.
Default Implementation:
{ return mpINode; }
{ return mpINode; }
virtual ManipExport void DeleteThis ( ) [virtual]
Remarks:
This method deletes the manipulator instance.
Default Implementation:
{ delete this; }

Reimplemented from Animatable.

Reimplemented in MSPluginSimpleManipulator.


Member Data Documentation

INode* mpINode [protected]

Manipulator Manipulator Manipulator Manipulator Manipulator Manipulator Manipulator Manipulator Manipulator Manipulator
Manipulator Manipulator Manipulator Manipulator Manipulator Manipulator Manipulator Manipulator Manipulator Manipulator