Public Member Functions

MSGeomObjectXtnd Class Reference

Search for all occurrences

#include <mxsPlugin.h>

Inheritance diagram for MSGeomObjectXtnd:
Inheritance graph
[legend]

List of all members.

Public Member Functions

  MSGeomObjectXtnd (MSPluginClass *pc, BOOL loading)
  ~MSGeomObjectXtnd ()
RefTargetHandle  Clone (RemapDir &remap)
  This method is used by 3ds Max to clone an object.
int  IsRenderable ()
  Indicates whether the object may be rendered.
Mesh GetRenderMesh (TimeValue t, INode *inode, View &view, BOOL &needDelete)
  This method should be implemented by all renderable GeomObjects.

Constructor & Destructor Documentation

MSGeomObjectXtnd ( MSPluginClass *  pc,
BOOL  loading 
)
~MSGeomObjectXtnd ( ) [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 MSPluginGeomObject.

int IsRenderable ( ) [inline, virtual]

Indicates whether the object may be rendered.

Some objects such as construction grids and helpers should not be rendered and can return zero.

Returns:
Nonzero if the object may be rendered; otherwise 0.

Reimplemented from MSPluginGeomObject.

{ return delegate->IsRenderable(); }        
Mesh* GetRenderMesh ( TimeValue  t,
INode inode,
View view,
BOOL &  needDelete 
) [inline, virtual]

This method should be implemented by all renderable GeomObjects.

It provides a mesh representation of the object for use by the renderer. Primitives that already have a mesh cached can just return a pointer to it (and set needDelete to FALSE). Implementations of this method which take a long time should periodically call View::CheckForRenderAbort() to see if the user has canceled the render. If canceled, the function can either return NULL, or return a non null pointer with the appropriate value for needDelete. (If needDelete is TRUE a non-null mesh will be deleted.)

Parameters:
t The time to get the mesh.
inode The node in the scene.
view If the renderer calls this method it will pass the view information here. See Class View.
needDelete Set to TRUE if the renderer should delete the mesh, FALSE otherwise.
Returns:
A pointer to the mesh object.

Reimplemented from MSPluginGeomObject.

{ return delegate->GetRenderMesh(t, inode, view, needDelete); }

MSGeomObjectXtnd MSGeomObjectXtnd MSGeomObjectXtnd MSGeomObjectXtnd MSGeomObjectXtnd MSGeomObjectXtnd MSGeomObjectXtnd MSGeomObjectXtnd MSGeomObjectXtnd MSGeomObjectXtnd
MSGeomObjectXtnd MSGeomObjectXtnd MSGeomObjectXtnd MSGeomObjectXtnd MSGeomObjectXtnd MSGeomObjectXtnd MSGeomObjectXtnd MSGeomObjectXtnd MSGeomObjectXtnd MSGeomObjectXtnd