3ds Max C++ API Reference
SimpleRenderGeometry Class Reference

SimpleRenderGeometry is a simple implementation of IRenderGeometry. More...

#include <SimpleRenderGeometry.h>

+ Inheritance diagram for SimpleRenderGeometry:

Public Member Functions

DllExport SimpleRenderGeometry ()
 
virtual DllExport ~SimpleRenderGeometry ()
 
DllExport void Display (DrawContext &drawContext, int start, int count, int lod)
 Display the geometry defined by the index buffer and vertex buffer. More...
 
DllExport PrimitiveType GetPrimitiveType ()
 Get the type of primitives in the geometry. More...
 
DllExport void SetPrimitiveType (PrimitiveType type)
 Sets type of primitives in the geometry. More...
 
DllExport size_t GetPrimitiveCount ()
 Number of primitives the mesh represents. More...
 
DllExport void SetPrimitiveCount (size_t count)
 Set the number of primitives in the geometry. More...
 
virtual DllExport size_t GetVertexCount ()
 Number of vertices in the mesh. More...
 
DllExport MaterialRequiredStreamsGetSteamRequirement ()
 Get the stream requirement of this render geometry. More...
 
DllExport void SetSteamRequirement (const MaterialRequiredStreams &streamFormat)
 Set the stream requirement of this render geometry. More...
 
DllExport IndexBufferHandleGetIndexBuffer ()
 Get index buffer of this geometry. More...
 
DllExport void SetIndexBuffer (const IndexBufferHandle &indexBuffer)
 Set index buffer of this geometry. More...
 
DllExport void AddVertexBuffer (const VertexBufferHandle &vertexBuffer)
 Add a vertex buffer to this geometry. More...
 
DllExport void RemoveVertexBuffer (size_t index)
 Remove the index-th vertex buffer. More...
 
DllExport size_t GetVertexBufferCount () const
 Get the number of vertex buffers. More...
 
DllExport VertexBufferHandle GetVertexBuffer (size_t index) const
 Get the index-th vertex buffer. More...
 
DllExport void SetStartPrimitive (int offset)
 Set the start primitive offset for drawing. More...
 
DllExport int GetStartPrimitive () const
 Get the start primitive offset. More...
 
- Public Member Functions inherited from ARefObject
GraphicsUtilityAPI ARefObject ()
 
virtual GraphicsUtilityAPI long AddRef ()
 from IRefObject, see comments in IRefObject More...
 
virtual GraphicsUtilityAPI long Release ()
 decrease reference count of this object by one, if the decreased reference count equals zero, the object will be deleted. More...
 
GraphicsUtilityAPI IRefObjectQueryInterface (Interface_ID classID)
 Try query an interface from the ref object using a given interface id. More...
 
- Public Member Functions inherited from IRefObject
GraphicsUtilityAPI IRefObject ()
 
virtual GraphicsUtilityAPI ~IRefObject ()
 
- Public Member Functions inherited from BaseInterfaceServer
virtual UtilExport BaseInterfaceGetInterface (Interface_ID id)
 
virtual UtilExport int NumInterfaces () const
 
virtual UtilExport BaseInterfaceGetInterfaceAt (int i) const
 
virtual UtilExport ~BaseInterfaceServer ()
 
- Public Member Functions inherited from InterfaceServer
virtual UtilExport ~InterfaceServer ()
 Destructor. More...
 
template<class InterfaceType >
InterfaceType * GetTypedInterface ()
 

Protected Member Functions

virtual DllExport VertexBufferHandleArrayGetVertexBuffers ()
 Get the vertex streams of this geometry. More...
 
- Protected Member Functions inherited from ARefObject
virtual GraphicsUtilityAPI void DeleteThis ()
 This function will be called when the reference count of an ARefObject equals zero. More...
 
virtual GraphicsUtilityAPI ~ARefObject ()
 

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...
 
- Protected Attributes inherited from BaseInterfaceServer
Tab< BaseInterface * > interfaces
 

Detailed Description

SimpleRenderGeometry is a simple implementation of IRenderGeometry.

SimpleRenderGeometry just contains the vertex buffer array, the index buffer, the primitive type, the vertex count and the stream format. 3rd party developer can directly use this class for simple mesh whose geometry could be defined using vertex buffer and index buffer.

Constructor & Destructor Documentation

◆ SimpleRenderGeometry()

◆ ~SimpleRenderGeometry()

virtual DllExport ~SimpleRenderGeometry ( )
virtual

Member Function Documentation

◆ Display()

DllExport void Display ( DrawContext drawContext,
int  start,
int  count,
int  lod 
)
virtual

Display the geometry defined by the index buffer and vertex buffer.

Parameters
[in]drawContextthe context for display
[in]startstart primitive to render
[in]countprimitive count to render
[in]lodcurrent lod value from adaptive degradation system

Implements IRenderGeometry.

◆ GetPrimitiveType()

DllExport PrimitiveType GetPrimitiveType ( )
virtual

Get the type of primitives in the geometry.

Returns
the geometry's primitive type

Implements IRenderGeometry.

◆ SetPrimitiveType()

DllExport void SetPrimitiveType ( PrimitiveType  type)
virtual

Sets type of primitives in the geometry.

Parameters
[in]typethe geometry's primitive type

Implements IRenderGeometry.

◆ GetPrimitiveCount()

DllExport size_t GetPrimitiveCount ( )
virtual

Number of primitives the mesh represents.

Returns
geometry's primitive count

Implements IRenderGeometry.

◆ SetPrimitiveCount()

DllExport void SetPrimitiveCount ( size_t  count)

Set the number of primitives in the geometry.

Parameters
[in]countthe number of primitives

◆ GetVertexCount()

virtual DllExport size_t GetVertexCount ( )
virtual

Number of vertices in the mesh.

Returns
number of vertices in the mesh.

Implements IRenderGeometry.

◆ GetSteamRequirement()

DllExport MaterialRequiredStreams& GetSteamRequirement ( )
virtual

Get the stream requirement of this render geometry.

Returns
the stream requirement which this geometry built with.

Implements IRenderGeometry.

◆ SetSteamRequirement()

DllExport void SetSteamRequirement ( const MaterialRequiredStreams streamFormat)

Set the stream requirement of this render geometry.

Parameters
[in]streamFormatthe stream requirement which this geometry built with.

◆ GetIndexBuffer()

DllExport IndexBufferHandle& GetIndexBuffer ( )
virtual

Get index buffer of this geometry.

Returns
index buffer of this geometry.

Implements IRenderGeometry.

◆ SetIndexBuffer()

DllExport void SetIndexBuffer ( const IndexBufferHandle indexBuffer)

Set index buffer of this geometry.

Parameters
[in]indexBufferindex buffer of this geometry.

◆ AddVertexBuffer()

DllExport void AddVertexBuffer ( const VertexBufferHandle vertexBuffer)

Add a vertex buffer to this geometry.

Parameters
[in]vertexBufferthe vertex buffer to be added.

◆ RemoveVertexBuffer()

DllExport void RemoveVertexBuffer ( size_t  index)

Remove the index-th vertex buffer.

Parameters
[in]indexthe index of the vertex buffer to be removed

◆ GetVertexBufferCount()

DllExport size_t GetVertexBufferCount ( ) const

Get the number of vertex buffers.

Returns
the number of vertex buffers.

◆ GetVertexBuffer()

DllExport VertexBufferHandle GetVertexBuffer ( size_t  index) const

Get the index-th vertex buffer.

Parameters
[in]indexthe index of the vertex buffer
Returns
the index-th vertex buffer.

◆ SetStartPrimitive()

DllExport void SetStartPrimitive ( int  offset)

Set the start primitive offset for drawing.

Parameters
[in]offsetthis offset will pass to Display() function

◆ GetStartPrimitive()

DllExport int GetStartPrimitive ( ) const
virtual

Get the start primitive offset.

Returns
The index of the start primitive

Implements IRenderGeometry.

◆ GetVertexBuffers()

virtual DllExport VertexBufferHandleArray& GetVertexBuffers ( )
protectedvirtual

Get the vertex streams of this geometry.

Returns
vertex streams of this geometry

Implements IRenderGeometry.