Rhino C++ API  8.7
Classes | Public Member Functions | Static Public Member Functions | List of all members
RhRdk::CustomRenderMeshes::IRenderMeshProvider Class Referenceabstract

An IMeshProvider delivers custom render meshes (in the form of IRenderMeshes). Typically the class will also derive from CRhRdkExtension and be registered with the RDK using RhRdkAddExtension, forming a collection of providers which the IManager will cycle through to produce the final render mesh. Each IMeshProvider::HasCustomMeshes will be called and if it returns true, a call to CustomMeshes will be made. It is up to the provider to cache its own primitives - the IRenderMeshes::ProviderTracking class is provided for that. A provider may optionally return a collection of non-object Ids that it will provide custom render meshes for. An example of this is Grasshopper, which which will typically return a collection of the Ids of each CustomPreview component. Override this class if you are a plug-in developer intending to supply a custom set of meshes for a given object, or objectId. Examples of IMeshProviders are CurvePiping, EdgeSoftening, Displacement, Shutlining, Grasshopper's CustomPreview component. More...

#include <IRhRdkCustomRenderMeshes.h>

Classes

class  IProgress
 

Public Member Functions

virtual ~IRenderMeshProvider ()
 
virtual void * EVF (const wchar_t *, void *)=0
 Emergency virtual function for future expansion More...
 
virtual CRhRdkVariant GetParameter (const CRhinoDoc &doc, const ObjectId &object, const wchar_t *wszParamName) const =0
 Runtime access to specific parameters on for a given objectId relating to this provider. More...
 
virtual bool HasCustomRenderMeshes (ON::mesh_type mt, const ON_Viewport &vp, const CRhinoDoc &doc, const ObjectId &objectId, ON__UINT32 &flags, const CRhinoPlugIn *requestingPlugIn, const CDisplayPipelineAttributes *pAttributes) const =0
 Determine if custom primitives will be supplied for a particular object. This function should return as quickly as possible. More...
 
virtual ON_wString Name (void) const =0
 The localized name of the provider for UI display. More...
 
virtual std::vector< ObjectIdNonObjectIds (void) const =0
 A provider may optionally return a collection of non-object Ids that it will provide custom render meshes for. An example of this is Grasshopper, which which will typically return a collection of the Ids of each CustomPreview component. More...
 
virtual std::unique_ptr< IProgressProgress (const CRhinoDoc &, const std::vector< ObjectId > *pOptionalObjects) const =0
 
virtual MeshProviderId ProviderId (void) const =0
 Each provider has a unique identifier. More...
 
virtual std::shared_ptr< const IRenderMeshesRenderMeshes (ON::mesh_type mt, const ON_Viewport &vp, const CRhinoDoc &doc, const ObjectId &objectId, const CRhRdkObjectAncestry &ancestry_only_for_by_parent_attributes, ON__UINT32 &flags, std::shared_ptr< const IRenderMeshes > crmIn, const CRhinoPlugIn *requestingPlugIn, const CDisplayPipelineAttributes *pAttributes) const =0
 Returns a set of render primitives for a given ObjectId. More...
 
virtual void SetParameter (const CRhinoDoc &doc, const ObjectId &object, const wchar_t *wszParamName, const CRhRdkVariant &value)=0
 Runtime access to set specific parameters on for a given objectId relating to this provider. More...
 

Static Public Member Functions

static ON_UUID InterfaceId (void)
 The ICustomPrimitiveProvider interface Id to return in CRhRdkExtension::InterfaceId. Typically implemented as return ICustomPrimitiveProvider::InterfaceId(); More...
 

Detailed Description

An IMeshProvider delivers custom render meshes (in the form of IRenderMeshes). Typically the class will also derive from CRhRdkExtension and be registered with the RDK using RhRdkAddExtension, forming a collection of providers which the IManager will cycle through to produce the final render mesh. Each IMeshProvider::HasCustomMeshes will be called and if it returns true, a call to CustomMeshes will be made. It is up to the provider to cache its own primitives - the IRenderMeshes::ProviderTracking class is provided for that. A provider may optionally return a collection of non-object Ids that it will provide custom render meshes for. An example of this is Grasshopper, which which will typically return a collection of the Ids of each CustomPreview component. Override this class if you are a plug-in developer intending to supply a custom set of meshes for a given object, or objectId. Examples of IMeshProviders are CurvePiping, EdgeSoftening, Displacement, Shutlining, Grasshopper's CustomPreview component.

Constructor & Destructor Documentation

◆ ~IRenderMeshProvider()

virtual RhRdk::CustomRenderMeshes::IRenderMeshProvider::~IRenderMeshProvider ( )
inlinevirtual

Member Function Documentation

◆ EVF()

virtual void* RhRdk::CustomRenderMeshes::IRenderMeshProvider::EVF ( const wchar_t *  ,
void *   
)
pure virtual

Emergency virtual function for future expansion

Parameters
wszFuncThe named function
pvPrivate data
Returns
Private data in the form of a void*

◆ GetParameter()

virtual CRhRdkVariant RhRdk::CustomRenderMeshes::IRenderMeshProvider::GetParameter ( const CRhinoDoc doc,
const ObjectId object,
const wchar_t *  wszParamName 
) const
pure virtual

Runtime access to specific parameters on for a given objectId relating to this provider.

Parameters
docThe Rhino document of interest.
objectThe objectId for which the parameter should be supplied.
wszParamNameThe name of the parameter.
Returns
The value of the parameter for the specified ObjectId.

◆ HasCustomRenderMeshes()

virtual bool RhRdk::CustomRenderMeshes::IRenderMeshProvider::HasCustomRenderMeshes ( ON::mesh_type  mt,
const ON_Viewport vp,
const CRhinoDoc doc,
const ObjectId objectId,
ON__UINT32 flags,
const CRhinoPlugIn requestingPlugIn,
const CDisplayPipelineAttributes pAttributes 
) const
pure virtual

Determine if custom primitives will be supplied for a particular object. This function should return as quickly as possible.

Parameters
vpThe view being rendered.
docThe Rhino document of interest.
objectIdThe objectId for which the primitives should be supplied.
flagsSee IManager::Flags
requestingPlugInThe requesting plug-in - typically the render plug-in requesting the meshes.
pAttributesThe display attributes currently being used - nullptr if this is production rendering.
Returns
True if RenderMeshes will return a set of custom primitives, otherwise false. RenderMeshes may still return an empty collection - in case of cancelation something similar.

◆ InterfaceId()

static ON_UUID RhRdk::CustomRenderMeshes::IRenderMeshProvider::InterfaceId ( void  )
static

The ICustomPrimitiveProvider interface Id to return in CRhRdkExtension::InterfaceId. Typically implemented as return ICustomPrimitiveProvider::InterfaceId();

Returns
The IMeshProvider interface Id

◆ Name()

virtual ON_wString RhRdk::CustomRenderMeshes::IRenderMeshProvider::Name ( void  ) const
pure virtual

The localized name of the provider for UI display.

Returns
The name of the provider for UI display.

◆ NonObjectIds()

virtual std::vector<ObjectId> RhRdk::CustomRenderMeshes::IRenderMeshProvider::NonObjectIds ( void  ) const
pure virtual

A provider may optionally return a collection of non-object Ids that it will provide custom render meshes for. An example of this is Grasshopper, which which will typically return a collection of the Ids of each CustomPreview component.

Returns
A collection of non-object Ids for which this provider may provide custom meshes.

◆ Progress()

virtual std::unique_ptr<IProgress> RhRdk::CustomRenderMeshes::IRenderMeshProvider::Progress ( const CRhinoDoc ,
const std::vector< ObjectId > *  pOptionalObjects 
) const
pure virtual

◆ ProviderId()

virtual MeshProviderId RhRdk::CustomRenderMeshes::IRenderMeshProvider::ProviderId ( void  ) const
pure virtual

Each provider has a unique identifier.

Returns
The uuid of this provider.

◆ RenderMeshes()

virtual std::shared_ptr<const IRenderMeshes> RhRdk::CustomRenderMeshes::IRenderMeshProvider::RenderMeshes ( ON::mesh_type  mt,
const ON_Viewport vp,
const CRhinoDoc doc,
const ObjectId objectId,
const CRhRdkObjectAncestry ancestry_only_for_by_parent_attributes,
ON__UINT32 flags,
std::shared_ptr< const IRenderMeshes crmIn,
const CRhinoPlugIn requestingPlugIn,
const CDisplayPipelineAttributes pAttributes 
) const
pure virtual

Returns a set of render primitives for a given ObjectId.

Parameters
vpThe view being rendered.
docThe Rhino document of interest.
objectIdThe objectId for which the meshes should be supplied.
ancestry_only_for_by_parent_attributesThe ancestry of the object - ie, block references referring to this definition.
This is only used to handle ByParent attributes, and should not be used to transform geometry.
flagsSee IManager::Flags
crmInThe previous set of primitives. These may be the original render meshes on the object. They may also be empty - in the case of a non-object id - or non-meshable geometry.
requestingPlugInThe requesting plug-in - typically the render plug-in requesting the meshes.
pAttributesThe display attributes currently being used - nullptr if this is production rendering.
Returns
Returns a set of custom render primitives for a given ObjectId.

◆ SetParameter()

virtual void RhRdk::CustomRenderMeshes::IRenderMeshProvider::SetParameter ( const CRhinoDoc doc,
const ObjectId object,
const wchar_t *  wszParamName,
const CRhRdkVariant value 
)
pure virtual

Runtime access to set specific parameters on for a given objectId relating to this provider.

Parameters
docThe Rhino document of interest.
objectThe objectId for which the parameter should be supplied.
wszParamNameThe value of the parameter for the specified ObjectId.
valueThe value to set.