Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes

SimpleManipulator Class Reference

Search for all occurrences

Detailed Description

See also:
Class Manipulator, Class ISimpleManipulator, Class PolyShape, Class GizmoShape, Class ReferenceTarget, Class IParamBlock2, Class INode, Class Mesh, Class Point3, Class Point2, Class ViewExp, Class IColorManager, Class Ray, Class ManipHitData, List of Marker Types

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

The SimpleManipulator class provides a framework for implementing many common manipulators. It provides the following services:

It supports an arbitrary number of gizmos made from PolyShape and/or Mesh objects.

It creates and maintains tool tips in the viewport.

It does hit testing, display and bounding box computations of the gizmos.

It maintains an IParamBlock2 for the parameters of the Manipulator.

This class maintains a pointer to a parameter block. If the client of SimpleManipulator uses a single parameter block then SimpleManipulator can manage all the methods associated with SubAnims and References for the client.

If the client of SimpleManipulator maintains several parameter blocks then the client must implement the methods NumSubs(), SubAnim(i), SubAnimName(i), NumRefs(), GetReference(i) and SetReference(i) and call the SimpleManipulator methods when 'i' refers to the parameters maintained by SimpleManipulator.

Samples of Manipulators can be found in the SDK, /MAXSDK/SAMPLES/MANIPULATORS.

The Function Publishing interface to SimpleManipulators is defined as:

#define SIMPLE_MANIP_INTERFACE Interface_ID(0x617c41d4, 0x6af06a5f)

The following functions are not part of this class but are available for use with it in the making of gizmo objects:

#include <manipulator.h>

Inheritance diagram for SimpleManipulator:
Inheritance graph
[legend]

List of all members.

Public Member Functions

ManipExport  SimpleManipulator ()
ManipExport  SimpleManipulator (INode *pNode)
ManipExport  ~SimpleManipulator ()
ManipExport int  NumRefs ()
  Returns the total number of references this ReferenceMaker can hold.
ManipExport RefTargetHandle  GetReference (int i)
  Returns the 'i-th' reference.
ManipExport RefResult  NotifyRefChanged (Interval changeInt, RefTargetHandle hTarget, PartID &partID, RefMessage message)
  Receives and responds to messages.
ManipExport ObjectState  Eval (TimeValue time)
  This method is called to evaluate the object and return the result as an ObjectState.
void  InitNodeName (MSTR &s)
  Implemented by the System.
ManipExport Interval  ObjectValidity (TimeValue t)
  This method returns the validity interval of the object as a whole at the specified time.
ManipExport void  GetWorldBoundBox (TimeValue t, INode *inode, ViewExp *vpt, Box3 &box)
  This method returns the world space bounding box for Objects (see below for the Sub-object gizmo or Modifiers gizmo version).
ManipExport void  GetLocalBoundBox (TimeValue t, INode *inode, ViewExp *vpt, Box3 &box)
ManipExport void  GetDeformBBox (TimeValue t, Box3 &box, Matrix3 *tm, BOOL useSel)
  This method computes the bounding box in the objects local coordinates or the optional space defined by tm.
ManipExport void  BeginEditParams (IObjParam *ip, ULONG flags, Animatable *prev)
ManipExport void  EndEditParams (IObjParam *ip, ULONG flags, Animatable *next)
ManipExport void  GetClassName (MSTR &s)
  Retrieves the name of the plugin class.
ManipExport int  NumSubs ()
ManipExport Animatable SubAnim (int i)
ManipExport MSTR  SubAnimName (int i)
ManipExport BaseInterface GetInterface (Interface_ID id)
ManipExport int  HitTest (TimeValue t, INode *pNode, int type, int crossing, int flags, IPoint2 *pScreenPoint, ViewExp *pVpt)
ManipExport int  Display (TimeValue t, INode *pNode, ViewExp *pVpt, int flags)
ManipExport void  ClearPolyShapes ()
ManipExport void  AppendPolyShape (PolyShape *pPolyShape, DWORD flags, Point3 &unselColor, Point3 &selColor=ColorMan()->GetColorAsPoint3(kManipulatorsSelected))
ManipExport void  AppendGizmo (GizmoShape *pGizmoShape, DWORD flags, Point3 &unselColor, Point3 &selColor=ColorMan()->GetColorAsPoint3(kManipulatorsSelected))
ManipExport void  AppendMesh (Mesh *pMesh, DWORD flags, Point3 &unselColor, Point3 &selColor=ColorMan()->GetColorAsPoint3(kManipulatorsSelected))
ManipExport void  AppendMarker (MarkerType markerType, Point3 &position, DWORD flags, Point3 &unselColor, Point3 &selColor=ColorMan()->GetColorAsPoint3(kManipulatorsSelected))
ManipExport void  AppendText (MCHAR *pText, Point3 &position, DWORD flags, Point3 &unselColor, Point3 &selColor=ColorMan()->GetColorAsPoint3(kManipulatorsSelected))
ManipExport MSTR GetManipName ()
ManipExport void  SetGizmoScale (float gizmoScale)
ManipExport MSTR GetToolTip ()
ManipExport void  SetToolTipWnd (HWND hWnd)
ManipExport void  SetToolTipTimer (UINT timer)
ManipExport UINT  GetToolTipTimer ()
ManipExport HWND  GetToolTipWnd ()
ManipExport IParamBlock2 GetPBlock ()
virtual void  UpdateShapes (TimeValue t, MSTR &toolTip)=0
virtual ManipExport void  ManipulatorSelected ()
ManipExport void  SetManipTarget (RefTargetHandle hTarg)
ManipExport RefTargetHandle  GetManipTarget ()
ManipExport void  SetMouseState (MouseState state)
ManipExport MouseState  GetMouseState ()
ManipExport void  OnButtonDown (TimeValue t, ViewExp *pVpt, IPoint2 &m, DWORD flags, ManipHitData *pHitData)
ManipExport void  OnMouseMove (TimeValue t, ViewExp *pVpt, IPoint2 &m, DWORD flags, ManipHitData *pHitData)
ManipExport void  OnButtonUp (TimeValue t, ViewExp *pVpt, IPoint2 &m, DWORD flags, ManipHitData *pHitData)
ManipExport DisplayState  MouseEntersObject (TimeValue t, ViewExp *pVpt, IPoint2 &m, ManipHitData *pHitData)
ManipExport DisplayState  MouseLeavesObject (TimeValue t, ViewExp *pVpt, IPoint2 &m, ManipHitData *pHitData)
ManipExport IPoint2 GetTipPos ()
ManipExport void  GetLocalViewRay (ViewExp *pVpt, IPoint2 &m, Ray &viewRay)
ManipExport void  Invalidate ()
BOOL  UseSelectionBrackets ()
  This method allows an object to choose whether or not it will display selection brackets in shaded viewports.
ManipExport void  UnRegisterViewChange (BOOL fromDelete=FALSE)
void  RegisterViewChange ()
void  SetResettingFlag (BOOL val)
BOOL  GetResettingFlag ()
ManipExport void  KillToolTip ()
ManipExport Point3  GetUnselectedColor ()
ManipExport BOOL  ActiveViewOnly ()

Static Public Attributes

static ManipExport const int  kNoneSelected

Protected Member Functions

virtual ManipExport void  SetReference (int i, RefTargetHandle rtarg)
  Stores a ReferenceTarget as its 'i-th' reference`.

Protected Attributes

int  mDispSelectedIndex
MSTR  mToolTip
float  mGizmoScale
IParamBlock2 mpPblock
Interval  mValid
RefTargetHandle  mhTarget
MouseState  mState
BOOL  mActiveViewOnly
BOOL  mResetting

Constructor & Destructor Documentation

ManipExport SimpleManipulator ( )
Remarks:
Constructor.
ManipExport SimpleManipulator ( INode pNode )
Remarks:
Constructor.
ManipExport ~SimpleManipulator ( )
Remarks:
Destructor.

Member Function Documentation

ManipExport int NumRefs ( ) [virtual]

Returns the total number of references this ReferenceMaker can hold.

The plugin implements this method to indicate the total number of of references it can make. This includes all references whether they are NULL (inactive) or non-NULL (active) at the time when this method is called. A plugin can hold a variable number of references, thus the return value of this method is not to be cached and reused by client code.

Returns:
The total number of references this plugin can hold. The default implementation is return 0.

Reimplemented from ReferenceMaker.

Reimplemented in MSPluginSimpleManipulator, and MSSimpleManipulatorXtnd.

ManipExport RefTargetHandle GetReference ( int  i ) [virtual]

Returns the 'i-th' reference.

The plugin implements this method to return its 'i-th' reference. The plug-in simply keeps track of its references using an integer index for each one. This method is normally called by the system.

Parameters:
i - The index of the reference to retrieve. Valid values are from 0 to NumRefs()-1.
Returns:
The reference handle of the 'i-th' reference. Note that different calls to this method with the same 'i' value can result in different reference handles being retrieved, as the plugin changes the scene objects it references as its 'i-th' reference.

Reimplemented from ReferenceMaker.

Reimplemented in MSPluginSimpleManipulator, and MSSimpleManipulatorXtnd.

virtual ManipExport void SetReference ( int  i,
RefTargetHandle  rtarg 
) [protected, virtual]

Stores a ReferenceTarget as its 'i-th' reference`.

The plugin implements this method to store the reference handle passed to it as its 'i-th' reference. In its implementation of this method, the plugin should simply assign the reference handle passed in as a parameter to the member variable that holds the 'i-th' reference. Other reference handling methods such as ReferenceMaker::DeleteReference(), or ReferenceMaker::ReplaceReference() should not be called from within this method. The plugin itself or other plugins should not call this method directly. The system will call this method when a new reference is created or an existing one is replaced by calling ReferenceMaker::ReplaceReference().

Parameters:
i - The index of the reference to store. Valid values are from 0 to NumRefs()-1.
rtarg - The reference handle to store.

Reimplemented from ReferenceMaker.

Reimplemented in MSPluginSimpleManipulator, and MSSimpleManipulatorXtnd.

ManipExport RefResult NotifyRefChanged ( Interval  changeInt,
RefTargetHandle  hTarget,
PartID partID,
RefMessage  message 
) [virtual]

Receives and responds to messages.

A plugin which makes references must implement a method to receive and respond to messages broadcast by its dependents. This is done by implementing NotifyRefChanged(). The plugin developer usually implements this method as a switch statement where each case is one of the messages the plugin needs to respond to. The Method StdNotifyRefChanged calls this, which can change the partID to new value. If it doesn't depend on the particular message& partID, it should return REF_DONTCARE.

  • For developer that need to update a dialog box with data about an object you reference note the following related to this method: This method may be called many times. For instance, say you have a dialog box that displays data about an object you reference. This method will get called many time during the drag operations on that object. If you updated the display every time you'd wind up with a lot of 'flicker' in the dialog box. Rather than updating the dialog box each time, you should just invalidate the window in response to the NotifyRefChanged() call. Then, as the user drags the mouse your window will still receive paint messages. If the scene is complex the user may have to pause (but not let up on the mouse) to allow the paint message to go through since they have a low priority. This is the way many windows in 3ds Max work.
Parameters:
changeInt - This is the interval of time over which the message is active. Currently, all plug-ins will receive FOREVER for this interval.
hTarget - This is the handle of the reference target the message was sent by. The reference maker uses this handle to know specifically which reference target sent the message.
partID - This contains information specific to the message passed in. Some messages don't use the partID at all. See the section List of Reference Messages for more information about the meaning of the partID for some common messages.
message - The message parameters passed into this method is the specific message which needs to be handled.
Returns:
The return value from this method is of type RefResult. This is usually REF_SUCCEED indicating the message was processed. Sometimes, the return value may be REF_STOP. This return value is used to stop the message from being propagated to the dependents of the item.

Implements ReferenceMaker.

Reimplemented in MSPluginSimpleManipulator.

ManipExport ObjectState Eval ( TimeValue  t ) [virtual]

This method is called to evaluate the object and return the result as an ObjectState.

When the system has a pointer to an object it doesn't know if it's a procedural object or a derived object. So it calls Eval() on it and gets back an ObjectState. A derived object managed by the system may have to call Eval() on its input for example. A plug-in (like a procedural object) typically just returns itself. A plug-in that does not just return itself is the Morph Object (/MAXSDK/SAMPLES/OBJECTS/MORPHOBJ.CPP). This object uses a morph controller to compute a new object and fill in an ObjectState which it returns.

Parameters:
t Specifies the time to evaluate the object.
Returns:
The result of evaluating the object as an ObjectState.
Sample Code:
Typically this method is implemented as follows:
    { return ObjectState(this); }

Implements Object.

void InitNodeName ( MSTR s ) [inline, virtual]

Implemented by the System.

Sets the default node name to "Helper".

Reimplemented from HelperObject.

{s = GetObjectName();}
ManipExport Interval ObjectValidity ( TimeValue  t ) [virtual]

This method returns the validity interval of the object as a whole at the specified time.

Parameters:
t The time to compute the validity interval.
Default Implementation:
{ return FOREVER; }
Returns:
The validity interval of the object.

Reimplemented from Object.

ManipExport void GetWorldBoundBox ( TimeValue  t,
INode inode,
ViewExp vp,
Box3 box 
) [virtual]

This method returns the world space bounding box for Objects (see below for the Sub-object gizmo or Modifiers gizmo version).

The bounding box returned by this method does not need to be precise. It should however be calculated rapidly. The object can handle this by transforming the 8 points of its local bounding box into world space and take the minimums and maximums of the result. Although this isn't necessarily the tightest bounding box of the objects points in world space, it is close enough.

Parameters:
t The time to compute the bounding box.
inode The node to calculate the bounding box for.
vp An interface pointer that can be used to call methods associated with the viewports.
box Contains the returned bounding box.

Reimplemented from BaseObject.

Reimplemented in MSSimpleManipulatorXtnd.

ManipExport void GetLocalBoundBox ( TimeValue  t,
INode inode,
ViewExp vp,
Box3 box 
) [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.

Implements Manipulator.

Reimplemented in MSSimpleManipulatorXtnd.

ManipExport void GetDeformBBox ( TimeValue  t,
Box3 box,
Matrix3 tm,
BOOL  useSel 
) [virtual]

This method computes the bounding box in the objects local coordinates or the optional space defined by tm.

Note: If you are looking for a precise bounding box, use this method and pass in the node's object TM (INode::GetObjectTM()) as the matrix.

Parameters:
t The time to compute the box.
box A reference to a box the result is stored in.
tm This is an alternate coordinate system used to compute the box. If the tm is not NULL this matrix should be used in the computation of the result.
useSel If TRUE, the bounding box of selected sub-elements should be computed; otherwise the entire object should be used.

Reimplemented from Object.

ManipExport void BeginEditParams ( IObjParam ip,
ULONG  flags,
Animatable prev 
) [virtual]
Remarks:
This method is called by the system when the user may edit the item's (object, modifier, controller, etc.) parameters.
Parameters:
ip Interface pointer. The developer can use it to call methods such as AddRollupPage(). Note that this pointer is only valid between BeginEditParams() and EndEditParams(). It should not be used outside this interval.
flags Describe which branch of the command panel or dialog the item is being edited in. The following are possible values:

BEGIN_EDIT_CREATE
Indicates an item is being edited in the create branch.

BEGIN_EDIT_MOTION
Indicates a controller is being edited in the motion branch.

BEGIN_EDIT_HIERARCHY
Indicates a controller is being edited in the Pivot subtask of the hierarchy branch.

BEGIN_EDIT_IK
Indicates a controller is being edited in the IK subtask of the hierarchy branch.

BEGIN_EDIT_LINKINFO
Indicates a controller is being edited in the Link Info subtask of the hierarchy branch.

prev Pointer to an Animatable object. This parameter may be used in the motion and hierarchy branches of the command panel. This pointer allows a plug-in to look at the ClassID of the previous item that was being edited, and if it is the same as this item, to not replace the entire UI in the command panel, but simply update the values displayed in the UI fields. This prevents the UI from 'flickering' when the current item begins its edit. For example, if you are in the motion branch and are looking at an item's PRS controller values, and then select another item that is displayed with a PRS controller, the UI will not change - only the values displayed in the fields will change. If however you selected a target camera that has a lookat controller (not a PRS controller) the UI will change because a different set of parameters need to be displayed. Note that for items that are edited in the modifier branch this field can be ignored.

Reimplemented from Animatable.

Reimplemented in MSPluginSimpleManipulator, and MSSimpleManipulatorXtnd.

ManipExport void EndEditParams ( IObjParam ip,
ULONG  flags,
Animatable next 
) [virtual]
Remarks:
This method is called when the user is finished editing an objects parameters. The system passes a flag into the EndEditParams() method to indicate if the rollup page should be removed. If this flag is TRUE, the plug-in must un-register the rollup page, and delete it from the panel.
Parameters:
ip An interface pointer. The developer may use the interface pointer to call methods such as DeleteRollupPage().

flags The following flag may be set:

END_EDIT_REMOVEUI
If TRUE, the item's user interface should be removed.

next Animatable pointer. Can be used in the motion and hierarchy branches of the command panel. It allows a plug-in to look at the ClassID of the next item that was being edited, and if it is the same as this item, to not replace the entire UI in the command panel. Note that for items that are edited in the modifier branch this field can be ignored.

Reimplemented from Animatable.

Reimplemented in MSPluginSimpleManipulator, and MSSimpleManipulatorXtnd.

ManipExport void GetClassName ( MSTR s ) [inline, virtual]

Retrieves the name of the plugin class.

This name is usually used internally for debugging purposes. For Material plug-ins this method is used to put up the material "type" name in the Material Editor.

Parameters:
s Reference to a string filled in with the name of the plugin class

Reimplemented from ReferenceTarget.

Reimplemented in MSPluginSimpleManipulator, and MSSimpleManipulatorXtnd.

{s = GetObjectName();}      
ManipExport int NumSubs ( ) [inline, virtual]
Remarks:
The system uses a virtual array mechanism to access the sub-anims of a plug-in. This method returns the total number of sub-anims maintained by the plug-in. If a plug-in is using a parameter block to manage its parameters it should just return 1 for all the parameters directed by the parameter block.
Returns:
The number of sub-anims used by the plug-in.
Default Implementation:
{ return 0; }

Reimplemented from Animatable.

Reimplemented in MSPluginSimpleManipulator, and MSSimpleManipulatorXtnd.

{ return 1; }
ManipExport Animatable* SubAnim ( int  i ) [inline, virtual]
Remarks:
This method returns a pointer to the 'i-th' sub-anim. If a plug-in is using a parameter block to manage all its parameters it should just return a pointer to the parameter block itself from this method. This method may return NULL so developers need to check the return value before calling other sub anim methods (such as SubAnimName()).
Parameters:
i This is the index of the sub-anim to return.
Default Implementation:
{ return NULL };

Reimplemented from Animatable.

Reimplemented in MSPluginSimpleManipulator, and MSSimpleManipulatorXtnd.

{ UNUSED_PARAM(i); return mpPblock; }
ManipExport MSTR SubAnimName ( int  i ) [virtual]
Remarks:
This method returns the name of the 'i-th' sub-anim to appear in track view. The system has no idea what name to assign to the sub-anim (it only knows it by the virtual array index), so this method is called to retrieve the name to display. Developer need to make sure the 'i-th' SubAnim() is non-NULL or this method will fail.
Parameters:
i The index of the parameter name to return
Returns:
The name of the 'i-th' parameter.

Reimplemented from Animatable.

Reimplemented in MSPluginSimpleManipulator, and MSSimpleManipulatorXtnd.

ManipExport BaseInterface* GetInterface ( Interface_ID  id ) [virtual]
Remarks:
Returns a pointer to the interface whose ID is specified.
Parameters:
Interface_ID id

The ID of the interface to return.
Default Implementation:
{ return NULL; }

Reimplemented from FPMixinInterface.

ManipExport int HitTest ( TimeValue  t,
INode pNode,
int  type,
int  crossing,
int  flags,
IPoint2 pScreenPoint,
ViewExp pVpt 
) [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.

Implements Manipulator.

Reimplemented in MSSimpleManipulatorXtnd.

ManipExport int Display ( TimeValue  t,
INode pNode,
ViewExp pVpt,
int  flags 
) [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.

Implements Manipulator.

Reimplemented in MSSimpleManipulatorXtnd.

ManipExport void ClearPolyShapes ( ) [virtual]
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.

Implements ISimpleManipulator.

ManipExport void AppendPolyShape ( PolyShape pPolyShape,
DWORD  flags,
Point3 unselColor,
Point3 selColor = ColorMan()->GetColorAsPoint3(kManipulatorsSelected) 
) [virtual]
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;

Tells the gizmo not to display. It will still hit test it.

kGizmoDontHitTest;

Tells the gizmo not to hit test. It will still display.

kGizmoScaleToViewport;

Tells the gizmo to scale itself to have a constant size in the viewport. In this case, the system uses the ManipulatorGizmo::mGizmoSize to determine how big the manipulator should be. It interprets mGizmoSize as pixels it this case. This flag only applies to mesh gizmo currently.

Point3& unselColor = GetUIColor(COLOR_SEL_GIZMOS)

The color of the gizmo when unselected.

Point3& selColor = GetSubSelColor()

The color of the gizmo when selected.

Implements ISimpleManipulator.

ManipExport void AppendGizmo ( GizmoShape pGizmoShape,
DWORD  flags,
Point3 unselColor,
Point3 selColor = ColorMan()->GetColorAsPoint3(kManipulatorsSelected) 
) [virtual]
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;

Tells the gizmo not to display. It will still hit test it.

kGizmoDontHitTest;

Tells the gizmo not to hit test. It will still display.

kGizmoScaleToViewport;

Tells the gizmo to scale itself to have a constant size in the viewport. In this case, the system uses the ManipulatorGizmo::mGizmoSize to determine how big the manipulator should be. It interprets mGizmoSize as pixels it this case. This flag only applies to mesh gizmo currently.

Point3& unselColor = GetUIColor(COLOR_SEL_GIZMOS)

The color of the gizmo when unselected.

Point3& selColor = GetSubSelColor()

The color of the gizmo when selected.

Implements ISimpleManipulator.

ManipExport void AppendMesh ( Mesh pMesh,
DWORD  flags,
Point3 unselColor,
Point3 selColor = ColorMan()->GetColorAsPoint3(kManipulatorsSelected) 
) [virtual]
Remarks:
Implemented by the system.

This method adds a new Mesh to the manipulator. The shape 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;

Tells the gizmo not to display. It will still hit test it.

kGizmoDontHitTest;

Tells the gizmo not to hit test. It will still display.

kGizmoScaleToViewport;

Tells the gizmo to scale itself to have a constant size in the viewport. In this case, the system uses the ManipulatorGizmo::mGizmoSize to determine how big the manipulator should be. It interprets mGizmoSize as pixels it this case. This flag only applies to mesh gizmo currently.

Point3& unselColor = GetUIColor(COLOR_SEL_GIZMOS)

The color of the gizmo when unselected.

Point3& selColor = GetSubSelColor()

The color of the gizmo when selected.

Implements ISimpleManipulator.

ManipExport void AppendMarker ( MarkerType  markerType,
Point3 position,
DWORD  flags,
Point3 unselColor,
Point3 selColor = ColorMan()->GetColorAsPoint3(kManipulatorsSelected) 
) [virtual]
Remarks:
Implemented by the system.

This method adds a new Marker to the manipulator. The shape is defined in the local coordinates of the node that owns the manipulator.
Parameters:
MarkerType markerType

The marker type for marker gizmos. See the List of Marker Types

Point3& position

The position of the marker.

DWORD flags = 0

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

kGizmoDontDisplay;

Tells the gizmo not to display. It will still hit test it.

kGizmoDontHitTest;

Tells the gizmo not to hit test. It will still display.

kGizmoScaleToViewport;

Tells the gizmo to scale itself to have a constant size in the viewport. In this case, the system uses the ManipulatorGizmo::mGizmoSize to determine how big the manipulator should be. It interprets mGizmoSize as pixels it this case. This flag only applies to mesh gizmo currently.

Point3& unselColor = GetUIColor(COLOR_SEL_GIZMOS)

The color of the gizmo when unselected.

Point3& selColor = GetSubSelColor()

The color of the gizmo when selected.

Implements ISimpleManipulator.

ManipExport void AppendText ( MCHAR *  pText,
Point3 position,
DWORD  flags,
Point3 unselColor,
Point3 selColor = ColorMan()->GetColorAsPoint3(kManipulatorsSelected) 
) [virtual]
Remarks:
Implemented by the system.

This method adds a new Text to the manipulator. The shape is defined in the local coordinates of the node that owns the manipulator.
Parameters:
MCHAR* pText

The text string to add.

Point3& position

The position of the text.

DWORD flags = 0

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

kGizmoDontDisplay;

Tells the gizmo not to display. It will still hit test it.

kGizmoDontHitTest;

Tells the gizmo not to hit test. It will still display.

kGizmoScaleToViewport;

Tells the gizmo to scale itself to have a constant size in the viewport. In this case, the system uses the ManipulatorGizmo::mGizmoSize to determine how big the manipulator should be. It interprets mGizmoSize as pixels it this case. This flag only applies to mesh gizmo currently.

Point3& unselColor = GetUIColor(COLOR_SEL_GIZMOS)

The color of the gizmo when unselected.

Point3& selColor = GetSubSelColor()

The color of the gizmo when selected.

Implements ISimpleManipulator.

ManipExport MSTR& GetManipName ( ) [inline, virtual]
Remarks:
Implemented by the system.

This method returns the manipulator name.

Implements Manipulator.

{return mToolTip; }
ManipExport void SetGizmoScale ( float  gizmoScale ) [inline]
Remarks:
Implemented by the system.

This method allows you to set the scale of the gizmo.
Parameters:
float gizmoScale

The scale factor.
{ mGizmoScale = gizmoScale; }
ManipExport MSTR& GetToolTip ( ) [inline]
Remarks:
Implemented by the system.

This method returns the tooltip string. Used internally.
Default Implementation:
{ return mToolTip; }
{ return mToolTip; }
ManipExport void SetToolTipWnd ( HWND  hWnd ) [inline]
Remarks:
Implemented by the system.

Used internally.
{ mToolTipWnd = hWnd; }
ManipExport void SetToolTipTimer ( UINT  timer ) [inline]
Remarks:
Implemented by the system.

Used internally.

{ mToolTipTimer = timer; }
ManipExport UINT GetToolTipTimer ( ) [inline]
Remarks:
Implemented by the system.

Used internally.
{ return mToolTipTimer; }
ManipExport HWND GetToolTipWnd ( ) [inline]
Remarks:
Implemented by the system.

Used internally.
{ return mToolTipWnd; }
ManipExport IParamBlock2* GetPBlock ( ) [inline]
Remarks:
Implemented by the system.

This method returns a pointer to the parameter block.
Default Implementation:
{ return mpPblock; }

These must be implemented in the sub-class of SimpleManipulator
{ return mpPblock; }
virtual void UpdateShapes ( TimeValue  t,
MSTR toolTip 
) [pure virtual]
Remarks:
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 at which to update the shape.

MSTR& toolTip

The tool tip text to update.

Implements ISimpleManipulator.

Implemented in MSPluginSimpleManipulator, and MSSimpleManipulatorXtnd.

virtual ManipExport void ManipulatorSelected ( ) [inline, virtual]
Remarks:
Implemented by the system.

Used internally.
Default Implementation:
{}
{};
ManipExport void SetManipTarget ( RefTargetHandle  hTarg )
Remarks:
Implemented by the system.

This tells the SimpleManipulator to make a reference to hTarg. This is normally called in the contructor of a manipulator to set a reference to whatever is being manipulated.
Parameters:
RefTargetHandle hTarg

The handle to the reference target.
ManipExport RefTargetHandle GetManipTarget ( ) [inline]
Remarks:
This method returns the handle to the manipulator reference target.
Default Implementation:
{ return mhTarget; }

{ return mhTarget; }
ManipExport void SetMouseState ( MouseState  state ) [inline]
Remarks:
This method sets the state of the mouse.
Parameters:
MouseState state

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.
Default Implementation:
{ mState = state; }
{ mState = state; }
ManipExport MouseState GetMouseState ( ) [inline, virtual]
Remarks:
Implemented by the system.

This method returns the state of the mouse, which is one of the following values: kMouseIdle, kMouseDragging, or kMouseOverManip.
Default Implementation:
{ return mState; }

Implements ISimpleManipulator.

{ return mState; }
ManipExport void OnButtonDown ( TimeValue  t,
ViewExp pVpt,
IPoint2 m,
DWORD  flags,
ManipHitData pHitData 
) [virtual]
Remarks:
Implemented by the system.

This method gets called when the mouse buttons is pressed within the manipulator context. Used internally.
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.

Reimplemented from Manipulator.

Reimplemented in MSPluginSimpleManipulator, and MSSimpleManipulatorXtnd.

ManipExport void OnMouseMove ( TimeValue  t,
ViewExp pVpt,
IPoint2 m,
DWORD  flags,
ManipHitData pHitData 
) [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. It also updates the tooltip with the current value of the parameter.
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.

Reimplemented from Manipulator.

Reimplemented in MSPluginSimpleManipulator, and MSSimpleManipulatorXtnd.

ManipExport void OnButtonUp ( TimeValue  t,
ViewExp pVpt,
IPoint2 m,
DWORD  flags,
ManipHitData pHitData 
) [virtual]
Remarks:
Implemented by the system.

This method gets called when the mouse buttons is released within the manipulator context. Used internally.
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.

Reimplemented from Manipulator.

Reimplemented in MSPluginSimpleManipulator, and MSSimpleManipulatorXtnd.

ManipExport DisplayState MouseEntersObject ( TimeValue  t,
ViewExp pVpt,
IPoint2 m,
ManipHitData pHitData 
) [virtual]
Remarks:
Implemented by the system.

This method gets called when the mouse enters the manipulator object. Used interlally.
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.

Reimplemented from Manipulator.

ManipExport DisplayState MouseLeavesObject ( TimeValue  t,
ViewExp pVpt,
IPoint2 m,
ManipHitData pHitData 
) [virtual]
Remarks:
Implemented by the system.

This method gets called when the mouse leaves the manipulator object. Used internally.
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.

Reimplemented from Manipulator.

ManipExport IPoint2& GetTipPos ( ) [inline]
Remarks:
Implemented by the system.

This method returns the position of the tooltip. Used internally.
Default Implementation:
{ return mToolTipPos; }
{ return mToolTipPos; }
ManipExport void GetLocalViewRay ( ViewExp pVpt,
IPoint2 m,
Ray viewRay 
) [virtual]
Remarks:
This method is normally called from a manipualtor's OnMouseMove method. It computes a ray that passes through the given mouse point in the given viewport. The result is in the local coordinates of the node owning the manipulator.
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.

Implements ISimpleManipulator.

ManipExport void Invalidate ( ) [inline]
Remarks:
This method invalidates the validity interval.
Default Implementation:
{ mValid = NEVER; }
{ mValid = NEVER; }
BOOL UseSelectionBrackets ( ) [inline, virtual]

This method allows an object to choose whether or not it will display selection brackets in shaded viewports.

The method will return FALSE if no selection brackets are displayed or TRUE if it does display selection brackets.

Reimplemented from Object.

{ return FALSE; }
ManipExport void UnRegisterViewChange ( BOOL  fromDelete = FALSE )
Remarks:
This method unregisters the notifications so changes in the view are no longer registered.
void RegisterViewChange ( )
void SetResettingFlag ( BOOL  val ) [inline]
Remarks:
Used internally.
{ mResetting = val; }
BOOL GetResettingFlag ( ) [inline]
Remarks:
Used internally.
{ return mResetting; }
ManipExport void KillToolTip ( )
Remarks:
This method will destroy the tooltip and its timer and cleans up.
ManipExport Point3 GetUnselectedColor ( )
Remarks:
This method returns the color of the gizmo when unselected.
ManipExport BOOL ActiveViewOnly ( ) [inline]

Member Data Documentation

ManipExport const int kNoneSelected [static]
int mDispSelectedIndex [protected]
MSTR mToolTip [protected]
float mGizmoScale [protected]
IParamBlock2* mpPblock [protected]
Interval mValid [protected]
MouseState mState [protected]
BOOL mActiveViewOnly [protected]
BOOL mResetting [protected]

SimpleManipulator SimpleManipulator SimpleManipulator SimpleManipulator SimpleManipulator SimpleManipulator SimpleManipulator SimpleManipulator SimpleManipulator SimpleManipulator
SimpleManipulator SimpleManipulator SimpleManipulator SimpleManipulator SimpleManipulator SimpleManipulator SimpleManipulator SimpleManipulator SimpleManipulator SimpleManipulator