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>
|
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...
|
|
|
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 IGeometry & | Geometry (void) const =0 |
| Return the geometry for this instance. More...
|
|
virtual IGeometry & | Geometry (void)=0 |
| Return the geometry for this instance. More...
|
|
virtual std::shared_ptr< const MappingChannels > | InstanceMappingChannels (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_su bool | IsForcedMaterial (void) const |
| The material for this instance should override any display mode materials. Implemented using EVF(L"IsForcedMaterial") 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< IInstance > | MakeCopy (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 CRhRdkMaterial > | Material (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_Xform & | Xform (void) const =0 |
| The transform for this instance. Transform the geometry by this to set its final location in world space. More...
|
|
|
static std::shared_ptr< 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, bool IsRequestingPlugInDependent, bool ForceMaterial) |
| Use this function to create a ready made instance object More...
|
|
static std::shared_ptr< IInstance > | New (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 ON_DEPRECATED_MSG("Use the one above") static std std::shared_ptr< IInstance > | New (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...
|
|
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).
◆ ~IInstance()
virtual RhRdk::CustomRenderMeshes::IRenderMeshes::IInstance::~IInstance |
( |
void |
| ) |
|
|
inlinevirtual |
◆ BoundingBox()
virtual ON_BoundingBox RhRdk::CustomRenderMeshes::IRenderMeshes::IInstance::BoundingBox |
( |
bool |
transformed | ) |
const |
|
pure virtual |
The bounding box for this instance.
- Parameters
-
transformed | If 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
-
wszFunc | The named function |
pv | Private 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
◆ IsForcedMaterial()
virtual_su bool RhRdk::CustomRenderMeshes::IRenderMeshes::IInstance::IsForcedMaterial |
( |
void |
| ) |
const |
The material for this instance should override any display mode materials. Implemented using EVF(L"IsForcedMaterial")
- Returns
- true if the material should be forced..
◆ 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, |
|
|
bool |
IsRequestingPlugInDependent, |
|
|
bool |
ForceMaterial |
|
) |
| |
|
static |
Use this function to create a ready made instance object
- Parameters
-
id | The object Id this mesh came from. |
mesh | The mesh - can be empty if primitive is not empty |
cacheHandle | The cacheHandle to use for this mesh - should be unique to the object managed by the shared_ptr<const ON_Mesh> |
cacheHandleId | An ID that is unique for any given mesh managed by the shared_ptr<const ON_Mesh> |
primitive | Optionally the primitive for this instance - can be empty if the mesh is not empty. |
meshMappingChannels | The mesh mapping channels - these must be the same for any given cacheHandleId. |
material | The Material for this instance. |
instanceMappingChannels | Per instance mapping channels - overrides the mesh mapping channels. Can be empty (and usually is). |
xform | The instance transformation. |
IsViewDependent | True if the instance is view dependent, otherwise false. |
IsRequestingPlugInDependent | True 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
-
- Returns
- A new instance object
◆ New() [3/3]
static ON_DEPRECATED_MSG ("Use the one above") static std 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
-
mesh | The mesh |
previous | The 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