Class ISimpleManipulator

3DS Max Plug-In SDK

Class ISimpleManipulator

See Also: Class FPMixinInterface, Class SimpleManipulator Class Interface, Class PolyShape, Class Mesh, Class Point3, Class Point2, Class ViewExp, Class IColorManager, Class Ray, Class ManipHitData, List of Marker Types

class ISimpleManipulator : public FPMixinInterface

Description:

This class is available in release 4.0 and later only.

The ISimpleManipulator class is an interface to SimpleManipulators with built-in ParamBlock2 support and a variety of additionally useful methods.

Methods:

public:

Prototype:

virtual void ClearPolyShapes()=0;

Remarks:

Implemented by the system.

Removes all of the current gizmos in the manipulator. This is normally called at the top of UpdateShapes() to clear out any previous gizmos before creating new ones.

Prototype:

virtual void AppendPolyShape(PolyShape* pPolyShape, DWORD flags = 0, Point3& unselColor = GetUIColor(COLOR_SEL_GIZMOS), Point3& selColor = GetSubSelColor())=0;

Remarks:

Implemented by the system.

This method adds a new PolyShape gizmo to the manipulator. The shape is defined in the local coordinates of the node that owns the manipulator.

Parameters:

PolyShape* pPolyShape

A pointer to the poly shape to add.

DWORD flags = 0

The flags can have one or more of the following values:

kGizmoDontDisplay

Instruct the gizmo not to display. It will still hit-test.

kGizmoDontHitTest

Instruct the gizmo not to do any hit testing. It will still display.

kGizmoScaleToViewport

Instruct the gizmo to scale itself to have a constant size in the viewport. In this case the system will use the ManipulatorGizmo::mGizmoSize to determine how big the manipulator should be. It interprets mGizmoSize as pixels in this case.

Point3& unselColor = GetUIColor(COLOR_SEL_GIZMOS)

The color of the gizmo when unselected.

Point3& selColor = GetSubSelColor()

The color of the gizmo when selected.

Prototype:

virtual void AppendGizmo(GizmoShape* pGizmoShape, DWORD flags = 0, Point3& unselColor = GetUIColor(COLOR_SEL_GIZMOS), Point3& selColor = GetSubSelColor())=0;

Remarks:

Implemented by the system.

This method adds a new GizmoShape to the manipulator. The shape is defined in the local coordinates of the node that owns the manipulator.

Parameters:

GizmoShape* pGizmoShape

A pointer to the gizmo shape to add.

DWORD flags = 0

The flags can have one or more of the following values:

kGizmoDontDisplay

Instruct the gizmo not to display. It will still hit-test.

kGizmoDontHitTest

Instruct the gizmo not to do any hit testing. It will still display.

kGizmoScaleToViewport

Instruct the gizmo to scale itself to have a constant size in the viewport. In this case the system will use the ManipulatorGizmo::mGizmoSize to determine how big the manipulator should be. It interprets mGizmoSize as pixels in this case.

Point3& unselColor = GetUIColor(COLOR_SEL_GIZMOS)

The color of the gizmo when unselected.

Point3& selColor = GetSubSelColor()

The color of the gizmo when selected.

Prototype:

virtual void AppendMesh(Mesh* pMesh, DWORD flags = 0, Point3& unselColor = GetUIColor(COLOR_SEL_GIZMOS), Point3& selColor = GetSubSelColor())=0;

Remarks:

Implemented by the system.

This method adds a new mesh to the manipulator. The mesh is defined in the local coordinates of the node that owns the manipulator.

Parameters:

Mesh* pMesh

A pointer to the mesh to add.

DWORD flags = 0

The flags can have one or more of the following values:

kGizmoDontDisplay

Instruct the gizmo not to display. It will still hit-test.

kGizmoDontHitTest

Instruct the gizmo not to do any hit testing. It will still display.

kGizmoScaleToViewport

Instruct the gizmo to scale itself to have a constant size in the viewport. In this case the system will use the ManipulatorGizmo::mGizmoSize to determine how big the manipulator should be. It interprets mGizmoSize as pixels in this case.

Point3& unselColor = GetUIColor(COLOR_SEL_GIZMOS)

The color of the gizmo when unselected.

Point3& selColor = GetSubSelColor()

The color of the gizmo when selected.

Prototype:

virtual void AppendMarker(MarkerType markerType, Point3& position,DWORD flags = 0, Point3& unselColor = GetUIColor(COLOR_SEL_GIZMOS), Point3& selColor = GetSubSelColor())=0;

Remarks:

Implemented by the system.

This method adds a new marker to the manipulator.

Parameters:

MarkerType markerType

The marker type to add.

Point3& position

The position of the marker.

DWORD flags = 0

The flags can have one or more of the following values:

kGizmoDontDisplay

Instruct the gizmo not to display. It will still hit-test.

kGizmoDontHitTest

Instruct the gizmo not to do any hit testing. It will still display.

kGizmoScaleToViewport

Instruct the gizmo to scale itself to have a constant size in the viewport. In this case the system will use the ManipulatorGizmo::mGizmoSize to determine how big the manipulator should be. It interprets mGizmoSize as pixels in this case.

Point3& unselColor = GetUIColor(COLOR_SEL_GIZMOS)

The color of the gizmo when unselected.

Point3& selColor = GetSubSelColor()

The color of the gizmo when selected.

Prototype:

virtual void AppendText(TCHAR* pText, Point3& position, DWORD flags = 0, Point3& unselColor = GetUIColor(COLOR_SEL_GIZMOS), Point3& selColor = GetSubSelColor())=0;

Remarks:

Implemented by the system.

This method adds a new text entry to the manipulator.

Parameters:

TCHAR* pText

The string containing the text to add.

Point3& position

The position of the text.

DWORD flags = 0

The flags can have one or more of the following values:

kGizmoDontDisplay

Instruct the gizmo not to display. It will still hit-test.

kGizmoDontHitTest

Instruct the gizmo not to do any hit testing. It will still display.

kGizmoScaleToViewport

Instruct the gizmo to scale itself to have a constant size in the viewport. In this case the system will use the ManipulatorGizmo::mGizmoSize to determine how big the manipulator should be. It interprets mGizmoSize as pixels in this case.

Point3& unselColor = GetUIColor(COLOR_SEL_GIZMOS)

The color of the gizmo when unselected.

Point3& selColor = GetSubSelColor()

The color of the gizmo when selected.

Prototype:

virtual MouseState GetMouseState()=0;

Remarks:

This method returns the current status of the mouse.

Return Value:

One of the following values:

kMouseIdle

The mouse is idle, manipulator not active and the mouse is not over it.

kMouseDragging

The mouse is currently dragging the manipulator.

kMouseOverManip

The mouse is over the manipulator, but it is not being dragged.

Prototype:

virtual void GetLocalViewRay(ViewExp* pVpt, IPoint2& m, Ray& viewRay)=0;

Remarks:

This method gets the view ray going through the given screen coordinate. The result is in local coordinates of the owning INode.

Parameters:

ViewExp* pVpt

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

IPoint2& m

The screen coordinate.

Ray& viewRay

The returned local view ray.

Prototype:

virtual void UpdateShapes(TimeValue t, TSTR& toolTip)=0;

Remarks:

Implemented by the Plug-In.

This method gets called whenever the manipulator needs to update its gizmos. This is implemented by the manipulator to create the gizmos based on the current state of the node being manipulated.

Parameters:

TimeValue t

The time value at which the shapes should be updated.

TSTR& toolTip

The tooltip string.

Prototype:

virtual void OnMouseMove(TimeValue t, ViewExp* pVpt, IPoint2& m, DWORD flags, ManipHitData* pHitData)=0;

Remarks:

This method gets called when the mouse moves 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 screen coordinates of the mouse.

DWORD flags

Not used, should be set to 0.

ManipHitData* pHitData

A pointer to the hitdata containing information on which manipulator was hit.