Rhino C++ API  8.6
Classes | Public Member Functions | List of all members
RhRdk::CustomRenderMeshes::IManager Class Referenceabstract

The interface to the RDK's custom render mesh manager. Do not derive from this class - you can access this functionality using RhRdkCustomRenderMeshManager2 Call the functions on this class to access the custom render meshes to be supplied for any given ObjectId (see ObjectId above). You should call HasCustomMeshes before CustomMeshes to ensure the most efficient access - if HasCustomMeshes returns false, you can assume there are no custom render meshes. This class provides low level access to the custom render meshes - to just get the complete render meshes for an object, prefer IRhRdkSdkRenderMeshIterator / CRhRdkSdkRender::NewRenderMeshIterator, or RhRdk::Realtime2::ChangeQueue. Use these functions if you are a renderer developer who wants to access the custom render meshes provided by IMeshProvider. Note that this will include the built - in displacement edge softening, thickening, shut-lining and curve piping tools, as well as Grasshopper's CustomPreview component (which uses the NonObjectIds method of providing meshes associated with entities that are not actual objects in the document) More...

#include <IRhRdkCustomRenderMeshes.h>

Classes

struct  Flags
 Flags to be passed into and returned from RenderMeshes and HasCustomRenderMeshes.
More...
 

Public Member Functions

virtual ~IManager ()
 
virtual ON_BoundingBox BoundingBox (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, const CRhinoPlugIn *requestingPlugIn=nullptr, const CDisplayPipelineAttributes *pAttributes=nullptr, std::shared_ptr< const IRenderMeshes > optional_initial_primitives=nullptr) const =0
 The bounding box for the complete set of custom render meshes for this object Id. Note that the input parameters are the same as for CustomMeshes because typically this function is implemented by calling CustomMeshes and calculating the bounding box. In that case, it is important to cache the finished primitives at this point rather than calcuating them again for the call to CustomMeshes. More...
 
virtual void * EVF (const wchar_t *, void *)=0
 Emergency virtual function for future expansion More...
 
virtual bool HasCustomRenderMeshes (ON::mesh_type mt, const ON_Viewport &vp, const CRhinoDoc &doc, const ON_UUID &objectId, ON__UINT32 &flags, const CRhinoPlugIn *requestingPlugIn, const CDisplayPipelineAttributes *pAttributes) const =0
 Determine if custom render meshes will be supplied for a particular object. More...
 
virtual std::vector< ObjectIdNonObjectIds (void) const =0
 Providers may optionally return a collection of non-object Ids that they 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. This function returns a complete list of all of the NonObjectIds returned from all registered MeshProviders. More...
 
virtual std::vector< std::unique_ptr< IRenderMeshProvider::IProgress > > Progress (const CRhinoDoc &doc, const std::vector< ObjectId > *pOptionalObjects) const =0
 Get the current progress for either the whole document, or for a collection of objects More...
 
virtual const IRenderMeshProviderProvider (const MeshProviderId &uuidProvider) const =0
 Get an interface to a specific Mesh provider previously registered with the RDK using RhRdkAddExtension. 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, const CRhinoPlugIn *requestingPlugIn=nullptr, const CDisplayPipelineAttributes *pAttributes=nullptr, std::shared_ptr< const IRenderMeshes > optional_initial_primitives=nullptr) const =0
 Returns a complete set of custom render meshes (primitives) for a given ObjectId. More...
 
virtual ON__UINT32 RenderMeshesHash (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, const CRhinoPlugIn *requestingPlugIn=nullptr, const CDisplayPipelineAttributes *pAttributes=nullptr, std::shared_ptr< const IRenderMeshes > optional_initial_primitives=nullptr) const =0
 Returns a Hash which identifies a particular state of the custom meshes for rendering purposes. Note that this includes the hashing of material and mapping if they are returned as empty in IRenderMeshes. More...
 

Detailed Description

The interface to the RDK's custom render mesh manager. Do not derive from this class - you can access this functionality using RhRdkCustomRenderMeshManager2 Call the functions on this class to access the custom render meshes to be supplied for any given ObjectId (see ObjectId above). You should call HasCustomMeshes before CustomMeshes to ensure the most efficient access - if HasCustomMeshes returns false, you can assume there are no custom render meshes. This class provides low level access to the custom render meshes - to just get the complete render meshes for an object, prefer IRhRdkSdkRenderMeshIterator / CRhRdkSdkRender::NewRenderMeshIterator, or RhRdk::Realtime2::ChangeQueue. Use these functions if you are a renderer developer who wants to access the custom render meshes provided by IMeshProvider. Note that this will include the built - in displacement edge softening, thickening, shut-lining and curve piping tools, as well as Grasshopper's CustomPreview component (which uses the NonObjectIds method of providing meshes associated with entities that are not actual objects in the document)

Constructor & Destructor Documentation

◆ ~IManager()

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

Member Function Documentation

◆ BoundingBox()

virtual ON_BoundingBox RhRdk::CustomRenderMeshes::IManager::BoundingBox ( 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,
const CRhinoPlugIn requestingPlugIn = nullptr,
const CDisplayPipelineAttributes pAttributes = nullptr,
std::shared_ptr< const IRenderMeshes optional_initial_primitives = nullptr 
) const
pure virtual

The bounding box for the complete set of custom render meshes for this object Id. Note that the input parameters are the same as for CustomMeshes because typically this function is implemented by calling CustomMeshes and calculating the bounding box. In that case, it is important to cache the finished primitives at this point rather than calcuating them again for the call to CustomMeshes.

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
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 meshes (primitives) for a given ObjectId.
Parameters
optional_initial_primitivesOptionally a custom set of initial primitives. If this parameter is empty, the standard render meshes for the object will be used, or an empty set of primitives will be used where they are not available. This is typically used in meshing exporters, which produce specific meshes for the output rather than using the render meshes.
Returns
The bounding box for the complete custom meshes.

◆ EVF()

virtual void* RhRdk::CustomRenderMeshes::IManager::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*

◆ HasCustomRenderMeshes()

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

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

Parameters
vpThe viewport being rendered
docThe Rhino document associated with the objectId
objectIdThe objectId for which the meshes 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,

◆ NonObjectIds()

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

Providers may optionally return a collection of non-object Ids that they 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. This function returns a complete list of all of the NonObjectIds returned from all registered MeshProviders.

Returns
A collection of non-object Ids for which any provider may supply custom meshes.

◆ Progress()

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

Get the current progress for either the whole document, or for a collection of objects

Parameters
docThe document for which you are requesting the progress.
pOptionalObjectsOptionally an array of objects - if nullptr, then the progress report is for the entire document.
Returns

◆ Provider()

virtual const IRenderMeshProvider* RhRdk::CustomRenderMeshes::IManager::Provider ( const MeshProviderId uuidProvider) const
pure virtual

Get an interface to a specific Mesh provider previously registered with the RDK using RhRdkAddExtension.

Parameters
uuidProviderIdentifies the provider required.
Returns
A pointer to the interface of the specified provider, or nullptr if not found.

◆ RenderMeshes()

virtual std::shared_ptr<const IRenderMeshes> RhRdk::CustomRenderMeshes::IManager::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,
const CRhinoPlugIn requestingPlugIn = nullptr,
const CDisplayPipelineAttributes pAttributes = nullptr,
std::shared_ptr< const IRenderMeshes optional_initial_primitives = nullptr 
) const
pure virtual

Returns a complete set of custom render meshes (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
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 meshes (primitives) for a given ObjectId.
Parameters
optional_initial_primitivesOptionally a custom set of initial primitives. If this parameter is empty, the standard render meshes for the object will be used, or an empty set of primitives will be used where they are not available. This is typically used in meshing exporters, which produce specific meshes for the output rather than using the render meshes.
Returns
Returns a complete set of custom render meshes (primitives) for a given ObjectId.

◆ RenderMeshesHash()

virtual ON__UINT32 RhRdk::CustomRenderMeshes::IManager::RenderMeshesHash ( 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,
const CRhinoPlugIn requestingPlugIn = nullptr,
const CDisplayPipelineAttributes pAttributes = nullptr,
std::shared_ptr< const IRenderMeshes optional_initial_primitives = nullptr 
) const
pure virtual

Returns a Hash which identifies a particular state of the custom meshes for rendering purposes. Note that this includes the hashing of material and mapping if they are returned as empty in IRenderMeshes.

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
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 meshes (primitives) for a given ObjectId.
Parameters
optional_initial_primitivesOptionally a custom set of initial primitives. If this parameter is empty, the standard render meshes for the object will be used, or an empty set of primitives will be used where they are not available. This is typically used in meshing exporters, which produce specific meshes for the output rather than using the render meshes.
Returns
A Hash which identifies a particular state of the custom meshes for rendering purposes