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

The core of the custom render mesh delivery system - and instance defines a single mesh or other primitive (sphere, plane, box or cone). Each instance has a shared mesh/primitive and a transform, along with a material, mapping channels (at the mesh and instance level). More...

#include <IRhRdkCustomRenderMeshes.h>

Classes

class  IGeometry
 The IGeometry is class that collects all of the pure geometry information together for an instance. Essentially - the mesh/primitive along with the caching information for the display and an Id to differentiate meshes from each other without having to check their CRC. More...
 

Public Member Functions

virtual ~IInstance (void)
 
virtual ON_BoundingBox BoundingBox (bool transformed) const =0
 The bounding box for this instance. More...
 
virtual void * EVF (const wchar_t *wszFunc, void *pv)=0
 Emergency virtual function for future expansion More...
 
virtual const IGeometryGeometry (void) const =0
 Return the geometry for this instance. More...
 
virtual IGeometryGeometry (void)=0
 Return the geometry for this instance. More...
 
virtual std::shared_ptr< const MappingChannelsInstanceMappingChannels (void) const =0
 For per-instance mapping channels. This overrides the mapping channels supplied by the geometry typically this will be nullptr. If these channels are in use, they are specified in geometry space. More...
 
virtual bool IsRequestingPlugInDependent (void) const =0
 If this instance will change depending on the requesting plug-in. More...
 
virtual bool IsViewDependent (void) const =0
 If this instance will change depending on the view direction. More...
 
virtual std::shared_ptr< IInstanceMakeCopy (void) const =0
 Make a copy of the instance that can be modified - note, that the meshes/geometry themselves are still const and cannot be modified. The modifyable parts are the transform and the mapping channels. More...
 
virtual std::shared_ptr< const CRhRdkMaterialMaterial (void) const =0
 Return the material for this instance. More...
 
virtual ObjectId Object (void) const =0
 Returns the object id this instance was generated from. More...
 
virtual void Transform (const ON_Xform &)=0
 Transform this instance. Note that if you're transforming an IRenderMeshes object, use the transform function there as it will update the hash. More...
 
virtual const ON_XformXform (void) const =0
 The transform for this instance. Transform the geometry by this to set its final location in world space. More...
 

Static Public Member Functions

static std::shared_ptr< IInstanceNew (const ObjectId &id, std::shared_ptr< const ON_Mesh > mesh, std::shared_ptr< CRhinoCacheHandle > cacheHandle, const ON_UUID &cacheHandleId, std::shared_ptr< const IRenderMeshes::MappingChannels > meshMappingChannels, std::shared_ptr< const CRhRdkMaterial > material, std::shared_ptr< const IRenderMeshes::MappingChannels > instanceMappingChannels, const ON_Xform &xform, bool IsViewDependent=false, bool IsRequestingPlugInDependent=false)
 Use this function to create a ready made instance object More...
 
static std::shared_ptr< IInstanceNew (std::shared_ptr< const ON_Mesh > mesh, const CRhinoObject &)
 Extremely simple version for "use all object attributes". Typically used when there are no previous meshes. More...
 
static std::shared_ptr< IInstanceNew (std::shared_ptr< const ON_Mesh > mesh, const IInstance &previous)
 Use this function to create a ready made instance object - reusing the materials, mapping and so on from a previous instance object. This is typically used inside a MeshProvider to replace the incoming instance with new geometry. More...
 

Detailed Description

The core of the custom render mesh delivery system - and instance defines a single mesh or other primitive (sphere, plane, box or cone). Each instance has a shared mesh/primitive and a transform, along with a material, mapping channels (at the mesh and instance level).

Constructor & Destructor Documentation

◆ ~IInstance()

virtual RhRdk::CustomRenderMeshes::IRenderMeshes::IInstance::~IInstance ( void  )
inlinevirtual

Member Function Documentation

◆ BoundingBox()

virtual ON_BoundingBox RhRdk::CustomRenderMeshes::IRenderMeshes::IInstance::BoundingBox ( bool  transformed) const
pure virtual

The bounding box for this instance.

Parameters
transformedIf true, the bounding box is returned in world space, if false, in geometry space.
Returns

◆ EVF()

virtual void* RhRdk::CustomRenderMeshes::IRenderMeshes::IInstance::EVF ( const wchar_t *  wszFunc,
void *  pv 
)
pure virtual

Emergency virtual function for future expansion

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

◆ Geometry() [1/2]

virtual const IGeometry& RhRdk::CustomRenderMeshes::IRenderMeshes::IInstance::Geometry ( void  ) const
pure virtual

Return the geometry for this instance.

Returns
Geometry for this instance.

◆ Geometry() [2/2]

virtual IGeometry& RhRdk::CustomRenderMeshes::IRenderMeshes::IInstance::Geometry ( void  )
pure virtual

Return the geometry for this instance.

Returns
Geometry for this instance.

◆ InstanceMappingChannels()

virtual std::shared_ptr<const MappingChannels> RhRdk::CustomRenderMeshes::IRenderMeshes::IInstance::InstanceMappingChannels ( void  ) const
pure virtual

For per-instance mapping channels. This overrides the mapping channels supplied by the geometry typically this will be nullptr. If these channels are in use, they are specified in geometry space.

Returns
Per instance mapping channel collection

◆ IsRequestingPlugInDependent()

virtual bool RhRdk::CustomRenderMeshes::IRenderMeshes::IInstance::IsRequestingPlugInDependent ( void  ) const
pure virtual

If this instance will change depending on the requesting plug-in.

Returns
True if the instance is dependent on the requesting plug-in, otherwise false.

◆ IsViewDependent()

virtual bool RhRdk::CustomRenderMeshes::IRenderMeshes::IInstance::IsViewDependent ( void  ) const
pure virtual

If this instance will change depending on the view direction.

Returns
True if the instance is view dependent, otherwise false.

◆ MakeCopy()

virtual std::shared_ptr<IInstance> RhRdk::CustomRenderMeshes::IRenderMeshes::IInstance::MakeCopy ( void  ) const
pure virtual

Make a copy of the instance that can be modified - note, that the meshes/geometry themselves are still const and cannot be modified. The modifyable parts are the transform and the mapping channels.

Returns

◆ Material()

virtual std::shared_ptr<const CRhRdkMaterial> RhRdk::CustomRenderMeshes::IRenderMeshes::IInstance::Material ( void  ) const
pure virtual

Return the material for this instance.

Returns
Material for this instance.

◆ New() [1/3]

static std::shared_ptr<IInstance> RhRdk::CustomRenderMeshes::IRenderMeshes::IInstance::New ( const ObjectId id,
std::shared_ptr< const ON_Mesh mesh,
std::shared_ptr< CRhinoCacheHandle cacheHandle,
const ON_UUID cacheHandleId,
std::shared_ptr< const IRenderMeshes::MappingChannels meshMappingChannels,
std::shared_ptr< const CRhRdkMaterial material,
std::shared_ptr< const IRenderMeshes::MappingChannels instanceMappingChannels,
const ON_Xform xform,
bool  IsViewDependent = false,
bool  IsRequestingPlugInDependent = false 
)
static

Use this function to create a ready made instance object

Parameters
idThe object Id this mesh came from.
meshThe mesh - can be empty if primitive is not empty
cacheHandleThe cacheHandle to use for this mesh - should be unique to the object managed by the shared_ptr<const ON_Mesh>
cacheHandleIdAn ID that is unique for any given mesh managed by the shared_ptr<const ON_Mesh>
primitiveOptionally the primitive for this instance - can be empty if the mesh is not empty.
meshMappingChannelsThe mesh mapping channels - these must be the same for any given cacheHandleId.
materialThe Material for this instance.
instanceMappingChannelsPer instance mapping channels - overrides the mesh mapping channels. Can be empty (and usually is).
xformThe instance transformation.
IsViewDependentTrue if the instance is view dependent, otherwise false.
IsRequestingPlugInDependentTrue if the instance is dependent on the requesting plug-in, otherwise false.
Returns

◆ New() [2/3]

static std::shared_ptr<IInstance> RhRdk::CustomRenderMeshes::IRenderMeshes::IInstance::New ( std::shared_ptr< const ON_Mesh mesh,
const CRhinoObject  
)
static

Extremely simple version for "use all object attributes". Typically used when there are no previous meshes.

Parameters
mesh
Returns
A new instance object

◆ New() [3/3]

static std::shared_ptr<IInstance> RhRdk::CustomRenderMeshes::IRenderMeshes::IInstance::New ( std::shared_ptr< const ON_Mesh mesh,
const IInstance previous 
)
static

Use this function to create a ready made instance object - reusing the materials, mapping and so on from a previous instance object. This is typically used inside a MeshProvider to replace the incoming instance with new geometry.

Parameters
meshThe mesh
previousThe previous instance from which to copy.
Returns
A new instance object

◆ Object()

virtual ObjectId RhRdk::CustomRenderMeshes::IRenderMeshes::IInstance::Object ( void  ) const
pure virtual

Returns the object id this instance was generated from.

Returns
The object id this instance was generated from.

◆ Transform()

virtual void RhRdk::CustomRenderMeshes::IRenderMeshes::IInstance::Transform ( const ON_Xform )
pure virtual

Transform this instance. Note that if you're transforming an IRenderMeshes object, use the transform function there as it will update the hash.

◆ Xform()

virtual const ON_Xform& RhRdk::CustomRenderMeshes::IRenderMeshes::IInstance::Xform ( void  ) const
pure virtual

The transform for this instance. Transform the geometry by this to set its final location in world space.

Returns
The instance transform