3ds Max C++ API Reference
IRenderGeometry Class Referenceabstract

IRenderGeometry is a representation of a geometry. More...

#include <IRenderGeometry.h>

+ Inheritance diagram for IRenderGeometry:

Public Member Functions

virtual void Display (DrawContext &drawContext, int start, int count, int lod)=0
 This function might be called multiple times in a frame, such as when we use shadow maps. More...
 
virtual PrimitiveType GetPrimitiveType ()=0
 Get the type of primitives in the geometry. More...
 
virtual void SetPrimitiveType (PrimitiveType type)=0
 Sets type of primitives in the geometry. More...
 
virtual size_t GetPrimitiveCount ()=0
 Number of primitives the mesh represents. More...
 
virtual size_t GetVertexCount ()=0
 Number of vertices in the mesh. More...
 
virtual int GetStartPrimitive () const =0
 Get start primitive of this geometry. More...
 
virtual MaterialRequiredStreamsGetSteamRequirement ()=0
 Get the stream requirement of this render geometry. More...
 
virtual VertexBufferHandleArrayGetVertexBuffers ()=0
 Get the vertex streams of this geometry. More...
 
virtual IndexBufferHandleGetIndexBuffer ()=0
 Get index buffer of this geometry. 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 ()
 

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

Detailed Description

IRenderGeometry is a representation of a geometry.

Member Function Documentation

◆ Display()

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

This function might be called multiple times in a frame, such as when we use shadow maps.

Inherited classes need to use in the pipeline context to render the geometry. It's recommend to prepare the geometry data in another function like the constructor, and only do rendering tasks in the Display() function. Furthermore, sub-classes are not allowed to change current material parameters. So for multiple material instance, you should use multiple render items to store them. Note: the vertex buffers' format must match current stream requirement in pipeline context. /param drawContext the context for display /param start start primitive to render /param count primitive count to render /param lod current lod value from adaptive degradation system

Implemented in SimpleRenderGeometry.

◆ GetPrimitiveType()

virtual PrimitiveType GetPrimitiveType ( )
pure virtual

Get the type of primitives in the geometry.

/return the geometry's primitive type

Implemented in SimpleRenderGeometry.

◆ SetPrimitiveType()

virtual void SetPrimitiveType ( PrimitiveType  type)
pure virtual

Sets type of primitives in the geometry.

/param type the geometry's primitive type

Implemented in SimpleRenderGeometry.

◆ GetPrimitiveCount()

virtual size_t GetPrimitiveCount ( )
pure virtual

Number of primitives the mesh represents.

/return geometry's primitive count

Implemented in SimpleRenderGeometry.

◆ GetVertexCount()

virtual size_t GetVertexCount ( )
pure virtual

Number of vertices in the mesh.

/return number of vertices in the mesh.

Implemented in SimpleRenderGeometry.

◆ GetStartPrimitive()

virtual int GetStartPrimitive ( ) const
pure virtual

Get start primitive of this geometry.

Returns
The index of the start primitive.

Implemented in SimpleRenderGeometry.

◆ GetSteamRequirement()

virtual MaterialRequiredStreams& GetSteamRequirement ( )
pure virtual

Get the stream requirement of this render geometry.

To optimize performance, it's better to create a requirement-geometry mapping. And make the render geometry read-only after created.

Returns
the stream requirement which this geometry built with.

Implemented in SimpleRenderGeometry.

◆ GetVertexBuffers()

virtual VertexBufferHandleArray& GetVertexBuffers ( )
pure virtual

Get the vertex streams of this geometry.

Returns
vertex streams of this geometry

Implemented in SimpleRenderGeometry.

◆ GetIndexBuffer()

virtual IndexBufferHandle& GetIndexBuffer ( )
pure virtual

Get index buffer of this geometry.

Returns
index buffer of this geometry. Might be invalid if the geometry doesn't need index buffer

Implemented in SimpleRenderGeometry.