3ds Max C++ API Reference
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
ID3DHWMeshCacheManager Class Referenceabstract

#include <ihardwarerenderer.h>

+ Inheritance diagram for ID3DHWMeshCacheManager:

Public Member Functions

virtual Interface_ID GetID ()
 
virtual LifetimeType LifetimeControl ()
 
virtual void D3DHWMeshCacheManagerReset (BOOL clearBlock=FALSE)=0
 This method resets the list. It removes all the D3D meshes from the manager.
 
virtual BOOL D3DHWMeshCacheManagerAddHWMesh (INode *node, GFX_MESH::IHWDrawMesh *pMesh, Material *mtl, HardwareMaterial *pHWMat, Point3 wireframeColor, Matrix3 *tmOverRide, DWORD attr, DWORD renderLimit)=0
 This method lets users add a D3D mesh to the manager to be drawn.
 
virtual void D3DHWMeshCacheManagerSetRenderLimit (DWORD limit)=0
 This allows you to set a render limit for the HW Mesh cache manager.
 
virtual DWORD D3DHWMeshCacheManagerGetRenderLimit ()=0
 This allows you to get a render limit for the HW Mesh cache manger.
 
virtual void D3DHWMeshCacheManagerRegisterMaterial (HardwareMaterial *pHWMat, Point3 wireframeColor)=0
 This method lets user add a HWMaterial.
 
virtual void D3DHWMeshCacheManagerDeleteHWMesh (GFX_MESH::IHWDrawMesh *pMesh)=0
 This method lets the user remove add a D3D mesh from the manager.
 
virtual void D3DHWMeshCacheManagerDisplay (GraphicsWindow *gw)=0
 This method draws the D3D HW Meshes.
 
virtual int D3DHWMeshCacheManagerTotalBlocksDrawn ()=0
 
- Public Member Functions inherited from BaseInterface
virtual UtilExport ~BaseInterface ()
 Destructor.
 
UtilExport BaseInterfaceGetInterface (Interface_ID id) override
 
virtual UtilExport Interface_ID GetID ()
 
virtual LifetimeType LifetimeControl ()
 
virtual bool RegisterNotifyCallback (InterfaceNotifyCallback *incb)
 
virtual void UnRegisterNotifyCallback (InterfaceNotifyCallback *incb)
 
virtual BaseInterfaceAcquireInterface ()
 
virtual void ReleaseInterface ()
 
virtual void DeleteInterface ()
 
virtual BaseInterfaceCloneInterface (void *remapDir=nullptr)
 
- Public Member Functions inherited from InterfaceServer
virtual UtilExport ~InterfaceServer ()
 Destructor.
 
virtual UtilExport BaseInterfaceGetInterface (Interface_ID id)
 
template<class InterfaceType >
InterfaceType * GetTypedInterface ()
 

Additional Inherited Members

- Public Types inherited from BaseInterface
enum  LifetimeType { noRelease , immediateRelease , wantsRelease , serverControlled }
 
- 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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
static UtilExport voidoperator new[] (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate arrays of objects.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
static UtilExport voidoperator new (size_t size, void *placement_ptr)
 Placement new operator.
 
static UtilExport void operator delete (void *ptr, void *placement_ptr)
 Placement delete operator.
 
static UtilExport voidaligned_malloc (size_t size, size_t alignment)
 Allocates memory on a specified alignment boundary.
 
static UtilExport voidaligned_realloc (void *ptr, size_t size, size_t alignment)
 Reallocates memory on a specified alignment boundary.
 
static UtilExport void aligned_free (void *ptr)
 Frees a block of memory that was allocated with aligned_malloc/aligned_realloc.
 

Detailed Description

Description:
This class is only available in release 10 or later.

This interface provides access to the D3D HWMeshCache Manager. This allows nodes or any other "thing" that needs to display to register a HW Mesh with the manager these hardware meshes are sorted and displayed by material to maximize performance and minimize state switch.
ViewExp *pview = GetCOREInterface()->GetActiveViewport();
GraphicsWindow *gw = pview->getGW();
Definition: GraphicsWindow.h:73
Definition: ihardwarerenderer.h:415
virtual UtilExport BaseInterface * GetInterface(Interface_ID id)
Definition: maxapi.h:798
virtual GraphicsWindow * getGW()=0
CoreExport Interface * GetCOREInterface()
#define D3DHWMESHCACHEMANAGER_INTERFACE_ID
Definition: ihardwarerenderer.h:29

Member Function Documentation

◆ GetID()

virtual Interface_ID GetID ( )
inlinevirtual
Remarks
This method returns the unique interface ID.

Reimplemented from BaseInterface.

◆ LifetimeControl()

virtual LifetimeType LifetimeControl ( )
inlinevirtual
Remarks
This method allows inquiries into the actual lifetime policy of a client and provide a server-controlled delete notify callback.
Returns
One of the following LifetimeTypes:

noRelease

Do not call release, use interface as long as you like. This is the default.

immediateRelease

The interface is only good for one call. The release is implied so a call to release is not required.

wantsRelease

The clients are controlling the lifetime, so the interface needs a Release() when the client has finished.

serverControlled

The server controls the lifetime and will use the InterfaceNotifyCallback to inform the code when it is gone.
Default Implementation:
{ return noRelease; }

Reimplemented from BaseInterface.

421{ return noRelease; }
@ noRelease
Definition: baseinterface.h:104

◆ D3DHWMeshCacheManagerReset()

virtual void D3DHWMeshCacheManagerReset ( BOOL  clearBlock = FALSE)
pure virtual

This method resets the list. It removes all the D3D meshes from the manager.

This method removes all the D3D meshes from the manager. This should be called whenever the manager needs to flushed, for instance file resets, load etc.

Parameters
[in]clearBlock- this will also remove any material list that are present. Typically you do not want to do this so on the next add the data struct will not need to be rebuilt.

◆ D3DHWMeshCacheManagerAddHWMesh()

virtual BOOL D3DHWMeshCacheManagerAddHWMesh ( INode node,
GFX_MESH::IHWDrawMesh pMesh,
Material mtl,
HardwareMaterial *  pHWMat,
Point3  wireframeColor,
Matrix3 *  tmOverRide,
DWORD  attr,
DWORD  renderLimit 
)
pure virtual

This method lets users add a D3D mesh to the manager to be drawn.

This method lets you add a D3D mesh to the manager to be drawn. It will be drawn batched based on the material supplied in the current display mode.

Returns
TRUE if the node was successfully added, otherwise FALSE.
Parameters
[in]node- The inode that owns this d3d mesh, it can be null
[in]pMesh- The handle of the DirectX mesh which is a pointer to a D3DXMesh
[in]mtl- The material for this mesh, can be null
[in]pHWMat- The HardwareMaterial for this mesh, required.
[in]wireframeColor- The color of the wireframe mesh since it can be different than the shaded diffuse color
[in]tmOverRide- The world space transform for the mesh, if null the gw transform will be used
[in]attr- The attribute of this particular mesh typically it is the material ID
[in]renderLimit- The display limit for this particular mesh. See D3DHWMeshCacheManagerSetRenderLimit().

◆ D3DHWMeshCacheManagerSetRenderLimit()

virtual void D3DHWMeshCacheManagerSetRenderLimit ( DWORD  limit)
pure virtual

This allows you to set a render limit for the HW Mesh cache manager.

This allows you to set a render limit for the HW Mesh cache so when you add a mesh to the manager you can filter it by the display limit. This is useful for when the display is swapping draw modes and you only want to batch a certain mode.

Parameters
[in]limitthis is this the limit filter so only objects matching this limit will be added If this is set 0 there will be no filtering

◆ D3DHWMeshCacheManagerGetRenderLimit()

virtual DWORD D3DHWMeshCacheManagerGetRenderLimit ( )
pure virtual

This allows you to get a render limit for the HW Mesh cache manger.

This allows you to get a render limit for the HW Mesh cache so when you add a mesh to the manager you can filter it by the display limit. This is useful for when the display is swapping draw modes and you only want to batch a certain mode.

◆ D3DHWMeshCacheManagerRegisterMaterial()

virtual void D3DHWMeshCacheManagerRegisterMaterial ( HardwareMaterial *  pHWMat,
Point3  wireframeColor 
)
pure virtual

This method lets user add a HWMaterial.

This method lets add a user add a HWMaterial. This is useful if you are preprocessing materials so you can add them as you process them

Parameters
[in]pHWMatthis is the HardwareMaterial for this mesh and must be supplied
[in]wireframeColorthis is color of the wireframe mesh since it can be different than the shaded diffuse color

◆ D3DHWMeshCacheManagerDeleteHWMesh()

virtual void D3DHWMeshCacheManagerDeleteHWMesh ( GFX_MESH::IHWDrawMesh pMesh)
pure virtual

This method lets the user remove add a D3D mesh from the manager.

This method lets the user remove add a D3D mesh from the manager

Parameters
[in]pMeshthis is the handle of the directx mesh to be removed

◆ D3DHWMeshCacheManagerDisplay()

virtual void D3DHWMeshCacheManagerDisplay ( GraphicsWindow gw)
pure virtual

This method draws the D3D HW Meshes.

This method draws the D3D HW Meshes

Parameters
[in]gwwhich is the graphics window to draw to

◆ D3DHWMeshCacheManagerTotalBlocksDrawn()

virtual int D3DHWMeshCacheManagerTotalBlocksDrawn ( )
pure virtual