Public Member Functions

MSHelperXtnd Class Reference

Search for all occurrences

#include <mxsPlugin.h>

Inheritance diagram for MSHelperXtnd:
Inheritance graph
[legend]

List of all members.

Public Member Functions

  MSHelperXtnd (MSPluginClass *pc, BOOL loading)
  ~MSHelperXtnd ()
RefTargetHandle  Clone (RemapDir &remap)
  This method is used by 3ds Max to clone an object.
int  Display (TimeValue t, INode *inode, ViewExp *vpt, int flags)
  This is called by the system to have the item display itself (perform a quick render in viewport, using the current TM).
void  GetWorldBoundBox (TimeValue t, INode *inode, ViewExp *vpt, Box3 &abox)
  This method returns the world space bounding box for Objects (see below for the Sub-object gizmo or Modifiers gizmo version).
void  GetLocalBoundBox (TimeValue t, INode *inode, ViewExp *vpt, Box3 &abox)
  This is the object space bounding box, the box in the object's local coordinates.
void  GetDeformBBox (TimeValue t, Box3 &abox, Matrix3 *tm, BOOL useSel)
  This method computes the bounding box in the objects local coordinates or the optional space defined by tm.
int  HitTest (TimeValue t, INode *inode, int type, int crossing, int flags, IPoint2 *p, ViewExp *vpt)
  This method is called to determine if the specified screen point intersects the item.
void  Snap (TimeValue t, INode *inode, SnapInfo *snap, IPoint2 *p, ViewExp *vpt)
  Checks the point passed for a snap and updates the SnapInfo structure.
ObjectState  Eval (TimeValue time)
  This method is called to evaluate the object and return the result as an ObjectState.
Interval  ObjectValidity (TimeValue t)
  This method returns the validity interval of the object as a whole at the specified time.
int  UsesWireColor ()
  Implemented by the System.
BOOL  NormalAlignVector (TimeValue t, Point3 &pt, Point3 &norm)
  Objects that don't support the IntersectRay() method (such as helper objects) can implement this method to provide a default vector for use with the normal align command in 3ds Max.

Constructor & Destructor Documentation

MSHelperXtnd ( MSPluginClass *  pc,
BOOL  loading 
)
~MSHelperXtnd ( ) [inline]

Member Function Documentation

RefTargetHandle Clone ( RemapDir remap ) [virtual]

This method is used by 3ds Max to clone an object.

See also:
CloneRefHierarchy(), class RemapDir This method is called by 3ds Max to have the plugin clone itself. The plug-in's implementation of this method should copy both the data structure and all the data residing in the data structure of this reference target. The plugin should clone all its references as well. Also, the plug-in's implementation of this method must call BaseClone(). In order for classes derived from this class to clone cleanly, the Clone method should just create the new instance, and then call an implementation of BaseClone that clones the references and copies any other necessary data. For example:
            class MyDerivedPlugin
                : public MyBasePlugin
            {
                const int MY_REFERENCE = 1;

                ReferenceTarget* Clone(RemapDir& remap)
                {
                    ReferenceTarget* result = new MyDerivedPlugin();
                    BaseClone(this, result, remap);
                    return result;
                }

                void BaseClone(ReferenceTarget* from, ReferenceTarget* to, RemapDir& remap)
                {
                    if (!to || !from || from == to)
                        return;    
                    MyBasePlugin::BaseClone(from, to, remap);
                    to->ReplaceReference(MY_REFERENCE, remap->CloneRef(from->GetReference(MY_REFERENCE)));
                }
            };

This method should not be directly called by plug-ins. Instead, either RemapDir::CloneRef() or CloneRefHierachy() should be used to perform cloning. These methods ensure that the mapping from the original object to the clone is added to the RemapDir used for cloning, which may be used during backpatch operations

Note:
See the remarks in method BaseClone() below.
Parameters:
remap - A RemapDir instance used for remapping references during a Clone.
Returns:
A pointer to the cloned item.

Reimplemented from MSPluginHelper.

int Display ( TimeValue  t,
INode inode,
ViewExp vpt,
int  flags 
) [virtual]

This is called by the system to have the item display itself (perform a quick render in viewport, using the current TM).

Note: For this method to be called the object's validity interval must be invalid at the specified time t. If the interval is valid, the system may not call this method since it thinks the display is already valid.

Parameters:
t The time to display the object.
inode The node to display.
vpt An interface pointer that may be used to call methods associated with the viewports.
flags See Display Flags.
Returns:
The return value is not currently used.

Reimplemented from MSObjectXtnd< HelperObject, MSPluginHelper >.

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 MSObjectXtnd< HelperObject, MSPluginHelper >.

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

This is the object space bounding box, the box in the object's local coordinates.

The system expects that requesting the object space bounding box will be fast.

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

Reimplemented from MSObjectXtnd< HelperObject, MSPluginHelper >.

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 MSObjectXtnd< HelperObject, MSPluginHelper >.

int HitTest ( TimeValue  t,
INode inode,
int  type,
int  crossing,
int  flags,
IPoint2 p,
ViewExp vpt 
) [virtual]

This method is called to determine if the specified screen point intersects the item.

The method returns nonzero if the item was hit; otherwise 0.

Parameters:
t The time to perform the hit test.
inode A pointer to the node to test.
type The type of hit testing to perform. See Scene and Node Hit Test Types. for details.
crossing The state of the crossing setting. If TRUE crossing selection is on.
flags The hit test flags. See Scene and Node Hit Testing Flags for details.
p The screen point to test.
vpt An interface pointer that may be used to call methods associated with the viewports.
Returns:
Nonzero if the item was hit; otherwise 0.

Reimplemented from MSObjectXtnd< HelperObject, MSPluginHelper >.

void Snap ( TimeValue  t,
INode inode,
SnapInfo snap,
IPoint2 p,
ViewExp vpt 
) [virtual]

Checks the point passed for a snap and updates the SnapInfo structure.

Note:
Developers wanting to find snap points on an Editable Mesh object should see the method XmeshSnap::Snap() in /MAXSDK/SAMPLES/SNAPS/XMESH/XMESH.CPP.
Parameters:
t The time to check.
inode The node to check.
snap The snap info structure to update.
p The screen point to check.
vpt An interface pointer that may be used to call methods associated with the viewports.

Reimplemented from MSObjectXtnd< HelperObject, MSPluginHelper >.

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); }

Reimplemented from MSObjectXtnd< HelperObject, MSPluginHelper >.

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 MSObjectXtnd< HelperObject, MSPluginHelper >.

int UsesWireColor ( ) [virtual]

Implemented by the System.

Returns TRUE to indicate the object color is used for display.

Reimplemented from MSPluginHelper.

BOOL NormalAlignVector ( TimeValue  t,
Point3 pt,
Point3 norm 
) [virtual]

Objects that don't support the IntersectRay() method (such as helper objects) can implement this method to provide a default vector for use with the normal align command in 3ds Max.

Parameters:
t The time to compute the normal align vector.
pt The point of intersection.
norm The normal at the point of intersection.
Returns:
TRUE if this method is implemented to return the normal align vector; otherwise FALSE.

Reimplemented from MSPluginHelper.


MSHelperXtnd MSHelperXtnd MSHelperXtnd MSHelperXtnd MSHelperXtnd MSHelperXtnd MSHelperXtnd MSHelperXtnd MSHelperXtnd MSHelperXtnd
MSHelperXtnd MSHelperXtnd MSHelperXtnd MSHelperXtnd MSHelperXtnd MSHelperXtnd MSHelperXtnd MSHelperXtnd MSHelperXtnd MSHelperXtnd