Rhino C++ API  8.14
Public Member Functions | List of all members
CRhRdkCustomRenderMeshProvider Class Referenceabstract

#include <IRhRdkCustomRenderMeshManager.h>

Inheritance diagram for CRhRdkCustomRenderMeshProvider:
CRhRdkExtension CRhRdkObject

Public Member Functions

virtual ON_BoundingBox BoundingBox (const ON_Viewport &vp, const CRhinoObject *pObject, const CRhinoDoc &doc, const UUID &uuidRequestingPlugIn, const CDisplayPipelineAttributes *pAttributes) const =0
 
virtual bool BuildCustomMeshes (const ON_Viewport &vp, const UUID &uuidRequestingPlugIn, const CRhinoDoc &doc, IRhRdkCustomRenderMeshes &crmInOut, const CDisplayPipelineAttributes *pAttributes, bool bWillBuildCustomMeshCheck=true) const =0
 
virtual void * EVF (const wchar_t *, void *) override
 
virtual CRhRdkVariant GetParameter (const CRhinoObject &object, const wchar_t *wszParamName) const =0
 
virtual UUID InterfaceId (void) const final override
 
virtual bool IsPreviewAndStandardSameMesh (void) const =0
 
virtual bool IsRequestingPlugInDependent (void) const =0
 
virtual bool IsViewDependent (void) const =0
 
virtual ON_wString Name (void) const =0
 
virtual UUID ProviderId (void) const =0
 
virtual void SetParameter (const CRhinoObject &object, const wchar_t *wszParamName, const CRhRdkVariant &value)=0
 
virtual bool WillBuildCustomMesh (const ON_Viewport &vp, const CRhinoObject *pObject, const CRhinoDoc &doc, const UUID &uuidRequestingPlugIn, const CDisplayPipelineAttributes *pAttributes) const =0
 
- Public Member Functions inherited from CRhRdkExtension
 CRhRdkExtension ()
 
virtual ~CRhRdkExtension ()
 
virtual UUID PlugInId (void) const =0
 
bool Unregister (void)
 
- Public Member Functions inherited from CRhRdkObject
 CRhRdkObject ()
 
virtual ~CRhRdkObject ()
 
void operator delete (void *buf)
 
void operator delete[] (void *buf)
 
void * operator new (size_t size)
 
void * operator new[] (size_t size)
 

Additional Inherited Members

- Static Public Member Functions inherited from CRhRdkObject
static void CheckMemory (void)
 
static void PopulateDebuggingInfo (void)
 

Detailed Description

This class allows clients to provide custom render meshes for individual objects in the scene, or per document.

This is the way that displacement works (per object) and the custom preview component in Grasshopper (per document) work to supply render meshes that can be accessed by all rendering engines, using IRhRdkCustomRenderMeshManager.

To supply custom render meshes, derive a class from CRhRdkCustomRenderMeshProvider and register it during plug-in startup in CRhRdkPlugIn::RegisterExtensions.

Member Function Documentation

◆ BoundingBox()

virtual ON_BoundingBox CRhRdkCustomRenderMeshProvider::BoundingBox ( const ON_Viewport vp,
const CRhinoObject pObject,
const CRhinoDoc doc,
const UUID &  uuidRequestingPlugIn,
const CDisplayPipelineAttributes pAttributes 
) const
pure virtual

Returns a bounding box for the custom render meshes for the given object.

Parameters
vpis the viewport being rendered.
uuidRequestingPlugInis the UUID of the RDK plug-in requesting the meshes.
pObjectis the Rhino object of interest.
docis the Rhino document of interest.
pAttributesis the current display attributes for the view we are drawing. nullptr means this is a rendering, not a viewport.
Returns
ON_BoundingBox for the meshes.

◆ BuildCustomMeshes()

virtual bool CRhRdkCustomRenderMeshProvider::BuildCustomMeshes ( const ON_Viewport vp,
const UUID &  uuidRequestingPlugIn,
const CRhinoDoc doc,
IRhRdkCustomRenderMeshes crmInOut,
const CDisplayPipelineAttributes pAttributes,
bool  bWillBuildCustomMeshCheck = true 
) const
pure virtual

Build custom render mesh(es).

Parameters
vpis the viewport being rendered.
docis the Rhino document of interest.
uuidRequestingPlugInis the UUID of the RDK plug-in requesting the meshes.
crmInOutis the collection to fill with the custom meshes.
pAttributesis the current display attributes for the view we are drawing. nullptr means this is a rendering, not a viewport.
bWillBuildCustomMeshCheckdetermines whether this function will call the WillBuildCustomMesh method.
Returns
true if successful, else false.

◆ EVF()

virtual void* CRhRdkCustomRenderMeshProvider::EVF ( const wchar_t *  ,
void *   
)
inlineoverridevirtual

Emergency virtual function for future expansion.

Reimplemented from CRhRdkObject.

◆ GetParameter()

virtual CRhRdkVariant CRhRdkCustomRenderMeshProvider::GetParameter ( const CRhinoObject object,
const wchar_t *  wszParamName 
) const
pure virtual

Get a parameter by name.

◆ InterfaceId()

virtual UUID CRhRdkCustomRenderMeshProvider::InterfaceId ( void  ) const
finaloverridevirtual

Returns the unique interface id of this extension.

Implements CRhRdkExtension.

◆ IsPreviewAndStandardSameMesh()

virtual bool CRhRdkCustomRenderMeshProvider::IsPreviewAndStandardSameMesh ( void  ) const
pure virtual

◆ IsRequestingPlugInDependent()

virtual bool CRhRdkCustomRenderMeshProvider::IsRequestingPlugInDependent ( void  ) const
pure virtual

◆ IsViewDependent()

virtual bool CRhRdkCustomRenderMeshProvider::IsViewDependent ( void  ) const
pure virtual

◆ Name()

virtual ON_wString CRhRdkCustomRenderMeshProvider::Name ( void  ) const
pure virtual
Returns
The name of the provider for UI display.

◆ ProviderId()

virtual UUID CRhRdkCustomRenderMeshProvider::ProviderId ( void  ) const
pure virtual

Each provider has a unique identifier.

Returns
The uuid of this provider.

◆ SetParameter()

virtual void CRhRdkCustomRenderMeshProvider::SetParameter ( const CRhinoObject object,
const wchar_t *  wszParamName,
const CRhRdkVariant value 
)
pure virtual

Set a parameter by name.

◆ WillBuildCustomMesh()

virtual bool CRhRdkCustomRenderMeshProvider::WillBuildCustomMesh ( const ON_Viewport vp,
const CRhinoObject pObject,
const CRhinoDoc doc,
const UUID &  uuidRequestingPlugIn,
const CDisplayPipelineAttributes pAttributes 
) const
pure virtual

Determine if custom render meshes will be built for a particular object.

Parameters
vpis the viewport being rendered.
pObjectis the Rhino object of interest.
docis the Rhino document of interest.
uuidRequestingPlugInis the UUID of the RDK plug-in requesting the meshes.
pAttributesis the current display attributes for the view we are drawing. nullptr means this is a rendering, not a viewport.
Returns
true if BuildCustomMeshes() will build custom render mesh(es) for the given object.