3ds Max C++ API Reference
IHWDrawMesh Class Referenceabstract

This is a wrapper around our low level HW mesh. More...

#include <HWMesh.h>

+ Inheritance diagram for IHWDrawMesh:

Public Member Functions

DllExport IHWDrawMesh ()
 Constructor. More...
 
virtual ~IHWDrawMesh ()
 
virtual void Draw (GraphicsWindow *gw, DWORD attribute)=0
 This draws the mesh to the display using the current render limits. More...
 
virtual void UpdateVertexBuffer (Point3 *vertexList, Point3 *gfxNormalList, Point3 *faceNormalList, BitArray &changedVerts, int count, unsigned int *vertMapList, int *normalsMapList)=0
 Allows you direct access to the low level buffer to change values without recreating the mesh. More...
 
virtual void Release ()=0
 This releases the buffers if the class is no longer referenced by anything. You should not delete this class but call Release on it. More...
 
DllExport void MakeRef ()
 When ever you reference this pointer and want to hang onto it you need to call this. More...
 

Protected Member Functions

DllExport void DecRefCount ()
 You should not typically call this but should call release when you are done with the pointer

. More...
 
DllExport bool CanDelete ()
 returns whether the class can be deleted ie the ref count is zero More...
 

Protected Attributes

int mRefCount
 

Additional Inherited Members

- 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 is a wrapper around our low level HW mesh.

This is a interface around our low level vertex buffer this will allow you to directly update the low level buffers without recreating them, draw the buffers, and also give you access to release the buffers. This hides the actual vertex and index buffer away from the coder since it may be different depending on the device. Each GFX_MESH::HWMesh has a pointer to one of these. It has a simple reference counter to know when to get deleted since these can be batched up to be drawn and could potentially get deleted before the actual draw.

Constructor & Destructor Documentation

◆ IHWDrawMesh()

Constructor.

◆ ~IHWDrawMesh()

virtual ~IHWDrawMesh ( )
inlinevirtual
84 { ; }

Member Function Documentation

◆ Draw()

virtual void Draw ( GraphicsWindow gw,
DWORD  attribute 
)
pure virtual

This draws the mesh to the display using the current render limits.

Parameters
gwthe graphics window to draw the mesh to.
attributeif this mesh contains multiple matIDs this is which matID to draw. The old hwmesh stored multiple matIDs per mesh the new one only has one.

Implemented in HWTupleMeshContainer.

◆ UpdateVertexBuffer()

virtual void UpdateVertexBuffer ( Point3 vertexList,
Point3 gfxNormalList,
Point3 faceNormalList,
BitArray changedVerts,
int  count,
unsigned int vertMapList,
int normalsMapList 
)
pure virtual

Allows you direct access to the low level buffer to change values without recreating the mesh.

Parameters
vertexListThis is a pointer of all the vertices on the mesh. The changed vertices should be in the list
gfxNormalListThis is a pointer of all the gfx normals on the mesh. The changed vertices should be in the list
faceNormalListThis is a pointer of all the face normals on the mesh
changedVertsThis is a bitarray that tags which vertices are changed so we only update those vertices
countThis is number of vertices in vertex List
vertMapListThis is mapping that lets the HW vertex look up which vertex it belongs to
normalsMapListThis is mapping that lets the HW vertex look up which normal it belongs to. If this value is negative it is made positive and then face normallist is used to lookup the normal
This occurs when there is no smoothing group.

Implemented in HWTupleMeshContainer.

◆ Release()

virtual void Release ( )
pure virtual

This releases the buffers if the class is no longer referenced by anything. You should not delete this class but call Release on it.

Implemented in HWTupleMeshContainer.

◆ MakeRef()

DllExport void MakeRef ( )

When ever you reference this pointer and want to hang onto it you need to call this.

◆ DecRefCount()

DllExport void DecRefCount ( )
protected

You should not typically call this but should call release when you are done with the pointer

.

◆ CanDelete()

DllExport bool CanDelete ( )
protected

returns whether the class can be deleted ie the ref count is zero

Member Data Documentation

◆ mRefCount

int mRefCount
protected