Public Member Functions | Static Public Member Functions

MSPluginHelper Class Reference

Search for all occurrences

#include <mxsPlugin.h>

Inheritance diagram for MSPluginHelper:
Inheritance graph
[legend]

List of all members.

Public Member Functions

  MSPluginHelper ()
  MSPluginHelper (MSPluginClass *pc, BOOL loading)
  ~MSPluginHelper ()
RefTargetHandle  Clone (RemapDir &remap)
  This method is used by 3ds Max to clone an object.
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.

Static Public Member Functions

static RefTargetHandle  create (MSPluginClass *pc, BOOL loading)

Constructor & Destructor Documentation

MSPluginHelper ( ) [inline]
{ }
MSPluginHelper ( MSPluginClass *  pc,
BOOL  loading 
)
~MSPluginHelper ( ) [inline]

Member Function Documentation

static RefTargetHandle create ( MSPluginClass *  pc,
BOOL  loading 
) [static]
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 ReferenceTarget.

Reimplemented in MSHelperXtnd.

int UsesWireColor ( ) [inline, virtual]

Implemented by the System.

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

Reimplemented from HelperObject.

Reimplemented in MSHelperXtnd.

{ return HelperObject::UsesWireColor(); }   // TRUE if the object color is used for display
BOOL NormalAlignVector ( TimeValue  t,
Point3 pt,
Point3 norm 
) [inline, 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 HelperObject.

Reimplemented in MSHelperXtnd.

{ return HelperObject::NormalAlignVector(t, pt, norm); }

MSPluginHelper MSPluginHelper MSPluginHelper MSPluginHelper MSPluginHelper MSPluginHelper MSPluginHelper MSPluginHelper MSPluginHelper MSPluginHelper
MSPluginHelper MSPluginHelper MSPluginHelper MSPluginHelper MSPluginHelper MSPluginHelper MSPluginHelper MSPluginHelper MSPluginHelper MSPluginHelper