3ds Max C++ API Reference
IObjectDisplay2 Class Referenceabstract

To give object plugins better control of display, now object plugins can expose IObjectDisplay2 interface. More...

#include <IObjectDisplay2.h>

+ Inheritance diagram for IObjectDisplay2:

Public Member Functions

GraphicsDriverAPI IObjectDisplay2 ()
 
virtual GraphicsDriverAPI ~IObjectDisplay2 ()
 
virtual GraphicsDriverAPI unsigned long GetObjectDisplayRequirement () const
 Return the object display requirement of this object. More...
 
virtual bool PrepareDisplay (const UpdateDisplayContext &prepareDisplayContext)=0
 An object could be referenced by multiple nodes at the same time, while different node may requires different display of the object (backface cull vs. More...
 
virtual bool UpdatePerNodeItems (const UpdateDisplayContext &updateDisplayContext, UpdateNodeContext &nodeContext, IRenderItemContainer &targetRenderItemContainer)=0
 This function will be called for each owner nodes of a given object plugin. More...
 
virtual GraphicsDriverAPI bool UpdatePerViewItems (const UpdateDisplayContext &updateDisplayContext, UpdateNodeContext &nodeContext, UpdateViewContext &viewContext, IRenderItemContainer &targetRenderItemContainer)
 This function will be called for each viewport and for each owner nodes of a given object plugin. More...
 
virtual GraphicsDriverAPI Interface_ID GetID ()
 
virtual GraphicsDriverAPI BaseInterfaceGetInterface (Interface_ID id)
 
- Public Member Functions inherited from BaseInterface
virtual UtilExport ~BaseInterface ()
 Destructor. More...
 
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=NULL)
 
- Public Member Functions inherited from InterfaceServer
virtual UtilExport ~InterfaceServer ()
 Destructor. More...
 
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. 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

To give object plugins better control of display, now object plugins can expose IObjectDisplay2 interface.

This interface allows object plugins to provide different RenderItem for different nodes and different views.

If an object plugin provides both IObjectDisplay2 and IObjectDisplay interface, only IObjectDisplay2 will be used. IObjectDisplay interface is still supported by Nitrous, however, we don’t suggest plugins to use it anymore. In the future it will be obsoleted.

Constructor & Destructor Documentation

◆ IObjectDisplay2()

◆ ~IObjectDisplay2()

virtual GraphicsDriverAPI ~IObjectDisplay2 ( )
virtual

Member Function Documentation

◆ GetObjectDisplayRequirement()

virtual GraphicsDriverAPI unsigned long GetObjectDisplayRequirement ( ) const
virtual

Return the object display requirement of this object.

◆ PrepareDisplay()

virtual bool PrepareDisplay ( const UpdateDisplayContext prepareDisplayContext)
pure virtual

An object could be referenced by multiple nodes at the same time, while different node may requires different display of the object (backface cull vs.

non-backface cull, vertex color shading vs. material shading, etc.). IObjectDisplay2::PrepareDisplay gives object plugins a chance to prepare display data for all nodes, thus avoid duplicate display data generation for each node or each view. If an object contains a Mesh or MNMesh and wants to display it, then Mesh::PrepareDisplay or MNMesh::PrepareDisplay must be called in this function.

Parameters
prepareDisplayContextThe display context, which contains all the requirements for plugin to generate render items.
Returns
true if prepare successfully, false otherwise.

◆ UpdatePerNodeItems()

virtual bool UpdatePerNodeItems ( const UpdateDisplayContext updateDisplayContext,
UpdateNodeContext nodeContext,
IRenderItemContainer targetRenderItemContainer 
)
pure virtual

This function will be called for each owner nodes of a given object plugin.

Plugins can follow the input node properties, and create appropriate RenderItem. For example, if an object wants to display high-resolution mesh when node is selected, and display low-resolution mesh when node is not selected, it can use this function to create different DisplayItem for different notes.

Parameters
updateDisplayContextThe display context, which contains all the requirements for plugin to generate render items.
nodeContextwhich contains all information required for adding per node relevant render items.
targetRenderItemContainerthe target render item container to which this plugin object will be added.
Returns
true if successful or false otherwise

◆ UpdatePerViewItems()

virtual GraphicsDriverAPI bool UpdatePerViewItems ( const UpdateDisplayContext updateDisplayContext,
UpdateNodeContext nodeContext,
UpdateViewContext viewContext,
IRenderItemContainer targetRenderItemContainer 
)
virtual

This function will be called for each viewport and for each owner nodes of a given object plugin.

If plugin wants to display / hide certain RenderItem for a given view property, plugin can override this function and update RenderItem based on the input view properties.

Note
that this function is optional. If plugin doesn’t have view-dependent RenderItems, it doesn’t need to override this function.
Parameters
updateDisplayContextThe display context, which contains all the requirements for plugin to generate render items.
nodeContextwhich contains all information required for adding per node relevant render items.
viewContextthe view for which render items will be updated
targetRenderItemContainerthe target render item container to which this plugin object will be added.
Returns
true if the plugin has updated any render items for hTargetNode or false otherwise. We STRONGLY suggest return false for performance sake when no any render item has been actually updated.

◆ GetID()

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

Reimplemented from BaseInterface.

◆ GetInterface()

virtual GraphicsDriverAPI BaseInterface* GetInterface ( Interface_ID  id)
virtual
Remarks
Returns a pointer to the interface whose ID is specified.
Parameters:
Interface_ID id

The ID of the interface to return.
Default Implementation:
{ return NULL; }

Reimplemented from BaseInterface.