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>
|
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< ObjectId > | NonObjectIds (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< IProgress > | Progress (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 IRenderMeshes > | 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 =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...
|
|
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.
◆ ~IRenderMeshProvider()
virtual RhRdk::CustomRenderMeshes::IRenderMeshProvider::~IRenderMeshProvider |
( |
| ) |
|
|
inlinevirtual |
◆ EVF()
virtual void* RhRdk::CustomRenderMeshes::IRenderMeshProvider::EVF |
( |
const wchar_t * |
, |
|
|
void * |
|
|
) |
| |
|
pure virtual |
Emergency virtual function for future expansion
L"NonDocIdsOnly" = true (returns non nullptr) - HasCustomRenderMeshes will not be called on document resident objects.
- Parameters
-
wszFunc | The named function |
pv | Private 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
-
doc | The Rhino document of interest. |
object | The objectId for which the parameter should be supplied. |
wszParamName | The name of the parameter. |
- Returns
- The value of the parameter for the specified ObjectId.
◆ HasCustomRenderMeshes()
Determine if custom primitives will be supplied for a particular object. This function should return as quickly as possible.
- Parameters
-
vp | The view being rendered. |
doc | The Rhino document of interest. |
objectId | The objectId for which the primitives should be supplied. |
flags | See IManager::Flags |
requestingPlugIn | The requesting plug-in - typically the render plug-in requesting the meshes. |
pAttributes | The 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()
Returns a set of render primitives for a given ObjectId.
- Parameters
-
vp | The view being rendered. |
doc | The Rhino document of interest. |
objectId | The objectId for which the meshes should be supplied. |
ancestry_only_for_by_parent_attributes | The 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. |
flags | See IManager::Flags |
crmIn | The 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. |
requestingPlugIn | The requesting plug-in - typically the render plug-in requesting the meshes. |
pAttributes | The 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
-
doc | The Rhino document of interest. |
object | The objectId for which the parameter should be supplied. |
wszParamName | The value of the parameter for the specified ObjectId. |
value | The value to set. |