3ds Max C++ API Reference
IRenderMeshCache Class Referenceabstract

This class maintains a list of the meshes and RenderMeshes used per instance. It acts as a factory class. More...

#include <RTMax.h>

+ Inheritance diagram for IRenderMeshCache:

Public Member Functions

virtual void SetMeshType (IRenderMesh::MeshType type)=0
 Set the type of the mesh cache to maintain;. More...
 
virtual int SetCachedMNMesh (MNMesh *mnMesh, INode *node, TimeValue time, bool &meshChanged)=0
 Fill up the cache with data from 3ds Max. More...
 
virtual int SetCachedMesh (Mesh *mesh, INode *node, TimeValue time, bool &meshChanged)=0
 Fill up the cache with data from 3ds Max. More...
 
virtual int GetCacheSize ()=0
 Get the number of cached mesh. More...
 
virtual IRenderMeshGetActiveRenderMesh (int index)=0
 Get the active render mesh. More...
 
virtual INodeGetActiveNode (int index)=0
 
virtual MeshGetActiveMesh (int index)=0
 
virtual void SetDirectXVersion (UINT version)=0
 
virtual ~IRenderMeshCache ()
 default destructor More...
 
virtual void Release ()=0
 Used to release any data stored by the cache. More...
 
virtual void DeleteRenderMeshCache (INode *node)=0
 Used to delete the cache for a specific node. More...
 

Static Public Member Functions

static DllExport IRenderMeshCacheGetRenderMeshCache ()
 Exported function to access the IRenderMeshCache interface. More...
 
- Static Public Member Functions inherited from MaxHeapOperators
static UtilExport voidoperator new (size_t size)
 Standard new operator used to allocate objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e)
 Standard new operator used to allocate objects if there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate objects that takes the type of memory, filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate arrays of objects. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport void operator delete (void *ptr)
 Standard delete operator used to deallocate an object If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an object If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an object that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, void *placement_ptr)
 Placement new operator. More...
 
static UtilExport void operator delete (void *ptr, void *placement_ptr)
 Placement delete operator. More...
 
static UtilExport voidaligned_malloc (size_t size, size_t alignment)
 Allocates memory on a specified alignment boundary. More...
 
static UtilExport voidaligned_realloc (void *ptr, size_t size, size_t alignment)
 Reallocates memory on a specified alignment boundary. More...
 
static UtilExport void aligned_free (void *ptr)
 Frees a block of memory that was allocated with aligned_malloc/aligned_realloc. More...
 

Detailed Description

This class maintains a list of the meshes and RenderMeshes used per instance. It acts as a factory class.

This is useful for Materials where a single material could be applied to multiple nodes, so a cache is needed so the material can pull the correct mesh data

Constructor & Destructor Documentation

◆ ~IRenderMeshCache()

virtual ~IRenderMeshCache ( )
inlinevirtual

default destructor

731 {}

Member Function Documentation

◆ GetRenderMeshCache()

static DllExport IRenderMeshCache* GetRenderMeshCache ( )
static

Exported function to access the IRenderMeshCache interface.

◆ SetMeshType()

virtual void SetMeshType ( IRenderMesh::MeshType  type)
pure virtual

Set the type of the mesh cache to maintain;.

Parameters
typeSet the type of object to hold. This can be either a mesh or a quad.

◆ SetCachedMNMesh()

virtual int SetCachedMNMesh ( MNMesh mnMesh,
INode node,
TimeValue  time,
bool &  meshChanged 
)
pure virtual

Fill up the cache with data from 3ds Max.

This method needs to be called when the node has actually changed. In 3ds Max 8 and before you could call this method at any time and the method would attempt to cache and maintain the data. However this would not work correctly with a MNMesh type object. Now the method expects to only update itself when the object changes. This is easily achieved by only calling this method when IStdDualVSCallback::InitValid() is called. To simply get the cache position for the node you can call this method with a NULL mnMesh pointer.

Parameters
*mnMeshThe MNMesh to store in the cache. If this is NULL the system will return the cache entry only
*nodeThe node to store in the cache
timeThe time to use in any evaluations
&meshChangedIf the mesh is different to that in the cache, this specifies the case.
Returns
The position in the cache of the mesh/node combo

◆ SetCachedMesh()

virtual int SetCachedMesh ( Mesh mesh,
INode node,
TimeValue  time,
bool &  meshChanged 
)
pure virtual

Fill up the cache with data from 3ds Max.

This method needs to be called when the node has actually changed. In 3ds Max 8 and before you could call this method at any time and the method would attempt to cache and maintain the data. However this would not work correctly with a MNMesh type object. Now the method expects to only update itself when the object changes. This is easily achieved by only calling this method when IStdDualVSCallback::InitValid() is called. To simply get the cache position for the node you can call this method with a NULL mesh pointer.

Parameters
*meshThe mesh to store in the cache. If this is NULL the system will return the cache entry only
*nodeThe node to store in the cache
timeThe time to use in any evaluations
&meshChangedIf the mesh is different to that in the cache, this specifies the case.
Returns
The position in the cache of the mesh/node combo

◆ GetCacheSize()

virtual int GetCacheSize ( )
pure virtual

Get the number of cached mesh.

Returns
The number of cached mesh

◆ GetActiveRenderMesh()

virtual IRenderMesh* GetActiveRenderMesh ( int  index)
pure virtual

Get the active render mesh.

Parameters
indexThe index of the mesh to retrieve
Returns
The IRenderMesh based on the index provided

◆ GetActiveNode()

virtual INode* GetActiveNode ( int  index)
pure virtual
Parameters
indexGet the node for the current cached object
Returns
The INode for the current cache

◆ GetActiveMesh()

virtual Mesh* GetActiveMesh ( int  index)
pure virtual
Parameters
indexGet the mesh for the current cached object
Returns
The INode for the current cache

◆ SetDirectXVersion()

virtual void SetDirectXVersion ( UINT  version)
pure virtual

◆ Release()

virtual void Release ( )
pure virtual

Used to release any data stored by the cache.

◆ DeleteRenderMeshCache()

virtual void DeleteRenderMeshCache ( INode node)
pure virtual

Used to delete the cache for a specific node.