Rhino C++ API  8.7
Public Member Functions | Static Public Member Functions | List of all members
IRhRdkCustomRenderMeshes Class Referenceabstract

#include <IRhRdkCustomRenderMeshManager.h>

Inheritance diagram for IRhRdkCustomRenderMeshes:
CRhRdkCustomRenderMeshes IRhRdkCustomRenderMeshes2 IRhRdkCustomRenderMeshes3

Public Member Functions

virtual ~IRhRdkCustomRenderMeshes ()
 
virtual void Add (const ON_Cone &cone, const ON_Plane &truncation, const CRhRdkMaterial *pMaterial)=0
 
virtual void Add (const ON_PlaneSurface &plane, const CRhRdkMaterial *pMaterial)=0
 
virtual void Add (const ON_PlaneSurface &plane, const ON_Interval &cz, const CRhRdkMaterial *pMaterial)=0
 
virtual void Add (const ON_Sphere &sphere, const CRhRdkMaterial *pMaterial)=0
 
virtual void Add (ON_Mesh *pMesh, const CRhRdkMaterial *pMaterial)=0
 
virtual const CRhRdkObjectAncestryAncestry (void) const =0
 
virtual bool Box (int iIndex, ON_PlaneSurface &plane, ON_Interval &z_interval) const =0
 
virtual bool Cone (int iIndex, ON_Cone &cone, ON_Plane &truncation) const =0
 
virtual void ConvertMeshesToTriangles (void)=0
 
virtual int Count (void) const =0
 
virtual void * EVF (const wchar_t *, void *)=0
 
virtual const ON_XformGetInstanceTransform (void) const =0
 
virtual const CRhRdkMaterialMaterial (int iIndex) const =0
 
virtual const ON_MeshMesh (int iIndex) const =0
 
virtual const CRhinoObjectObject (void) const =0
 
virtual bool Plane (int iIndex, ON_PlaneSurface &plane) const =0
 
virtual RhRdkRenderMeshPrimitiveTypes PrimitiveType (int iIndex) const =0
 
virtual UUID ProviderId (void) const =0
 
virtual void SetAutoDeleteMaterialsOn (void)=0
 
virtual void SetAutoDeleteMeshesOn (void)=0
 
virtual void SetInstanceTransform (const ON_Xform &xformInstance)=0
 
virtual void SetProviderId (const UUID &uuidRMP)=0
 
virtual void SetUseObjectsMappingChannels (bool bSet)=0
 
virtual bool Sphere (int iIndex, ON_Sphere &sphere) const =0
 
virtual bool UseObjectsMappingChannels (void) const =0
 

Static Public Member Functions

static void Delete (IRhRdkCustomRenderMeshes *)
 
static IRhRdkCustomRenderMeshesNew (const CRhinoObject *pObject)
 

Detailed Description

This interface is a collection of custom render meshes for a particular Rhino object. It is used by the custom render mesh provider platform.

See also
IRhRdkCustomRenderMeshProvider.

Constructor & Destructor Documentation

◆ ~IRhRdkCustomRenderMeshes()

virtual IRhRdkCustomRenderMeshes::~IRhRdkCustomRenderMeshes ( )
inlinevirtual

Member Function Documentation

◆ Add() [1/5]

virtual void IRhRdkCustomRenderMeshes::Add ( const ON_Cone cone,
const ON_Plane truncation,
const CRhRdkMaterial pMaterial 
)
pure virtual

Add primitive (possibly truncated) cone and material.

Parameters
coneis the cone to add as defined in ON_Cone.
truncationis the plane used to cut the cone (the non-apex end is kept). Should be equal to cone.plane if not truncated.
pMaterialis the material to add. Can be NULL if not needed. If SetAutoDeleteMaterialsOn has been called prior to calling Add, the material will be copied.

Implemented in CRhRdkCustomRenderMeshes.

◆ Add() [2/5]

virtual void IRhRdkCustomRenderMeshes::Add ( const ON_PlaneSurface plane,
const CRhRdkMaterial pMaterial 
)
pure virtual

Add primitive finite plane and material.

Parameters
planeis the plane to add.
pMaterialis the material to add. Can be NULL if not needed. If SetAutoDeleteMaterialsOn has been called prior to calling Add, the material will be copied.

Implemented in CRhRdkCustomRenderMeshes.

◆ Add() [3/5]

virtual void IRhRdkCustomRenderMeshes::Add ( const ON_PlaneSurface plane,
const ON_Interval cz,
const CRhRdkMaterial pMaterial 
)
pure virtual

Add primitive box and material.

Parameters
planeis the plane of the box to add.
czis the z-interval of the box.
pMaterialis the material to add. Can be NULL if not needed. If SetAutoDeleteMaterialsOn has been called prior to calling Add, the material will be copied.

Implemented in CRhRdkCustomRenderMeshes.

◆ Add() [4/5]

virtual void IRhRdkCustomRenderMeshes::Add ( const ON_Sphere sphere,
const CRhRdkMaterial pMaterial 
)
pure virtual

Add primitive sphere and material.

Parameters
sphereis the sphere to add.
pMaterialis the material to add. Can be NULL if not needed. If SetAutoDeleteMaterialsOn has been called prior to calling Add, the material will be copied.

Implemented in CRhRdkCustomRenderMeshes.

◆ Add() [5/5]

virtual void IRhRdkCustomRenderMeshes::Add ( ON_Mesh pMesh,
const CRhRdkMaterial pMaterial 
)
pure virtual

Add mesh and material.

Parameters
pMeshis the mesh to add.
pMaterialis the material to add. Can be NULL if not needed. If SetAutoDeleteMaterialsOn has been called prior to calling Add, the material will be copied.

Implemented in CRhRdkCustomRenderMeshes.

◆ Ancestry()

virtual const CRhRdkObjectAncestry* IRhRdkCustomRenderMeshes::Ancestry ( void  ) const
pure virtual

◆ Box()

virtual bool IRhRdkCustomRenderMeshes::Box ( int  iIndex,
ON_PlaneSurface plane,
ON_Interval z_interval 
) const
pure virtual

Get a box by its index.

Parameters
iIndexis the geometry index which must be >= 0 and < Count().
planeis the base of the box geometry if the function returns true.
z_intervalis the height of the box geometry if the function returns true.
Returns
true if the geometry at the index is a box. false if not, or iIndex is out of range.

Implemented in CRhRdkCustomRenderMeshes.

◆ Cone()

virtual bool IRhRdkCustomRenderMeshes::Cone ( int  iIndex,
ON_Cone cone,
ON_Plane truncation 
) const
pure virtual

Get a truncated cone by its index.

Parameters
iIndexis the geometry index which must be >= 0 and < Count().
coneis the untruncated conical geometry if the function returns true.
truncationis the planar truncation of the cone if the function returns true.
Returns
true if the geometry at the index is a cone. false if not, or iIndex is out of range.

Implemented in CRhRdkCustomRenderMeshes.

◆ ConvertMeshesToTriangles()

virtual void IRhRdkCustomRenderMeshes::ConvertMeshesToTriangles ( void  )
pure virtual

Convert all meshes to triangles if they contain quads.

Implemented in CRhRdkCustomRenderMeshes.

◆ Count()

virtual int IRhRdkCustomRenderMeshes::Count ( void  ) const
pure virtual
Returns
Number of mesh/material pairs that are in the collection.

Implemented in CRhRdkCustomRenderMeshes.

◆ Delete()

static void IRhRdkCustomRenderMeshes::Delete ( IRhRdkCustomRenderMeshes )
static

Delete a IRhRdkCustomRenderMeshes object.

◆ EVF()

virtual void* IRhRdkCustomRenderMeshes::EVF ( const wchar_t *  ,
void *   
)
pure virtual

Emergency virtual function for future expansion. "AddMesh" - new implementation of AddMesh that also supoprts instancing. pv = struct { ON_Mesh*; const CRhRdkMaterial*; ON_Xform*; }

Implemented in CRhRdkCustomRenderMeshes.

◆ GetInstanceTransform()

virtual const ON_Xform& IRhRdkCustomRenderMeshes::GetInstanceTransform ( void  ) const
pure virtual
Returns
The transformation that the meshes have undergone from their original location in instance space. i.e., The mesh should not be transformed by this, but other transformable data (such as primitive mapping types) should have this applied before using them.

Implemented in CRhRdkCustomRenderMeshes.

◆ Material()

virtual const CRhRdkMaterial* IRhRdkCustomRenderMeshes::Material ( int  iIndex) const
pure virtual

Get a material by its index.

Parameters
iIndexis the material index which must be >= 0 and < Count().
Returns
A pointer to the material or NULL if iIndex is out of range.

Implemented in CRhRdkCustomRenderMeshes.

◆ Mesh()

virtual const ON_Mesh* IRhRdkCustomRenderMeshes::Mesh ( int  iIndex) const
pure virtual

Get a mesh by its index.

Parameters
iIndexis the mesh index which must be >= 0 and < Count().
Returns
A pointer to the mesh or NULL if iIndex is out of range.
Note
This always returns a mesh even if this is a primitive type other than mesh; i.e., a suitable mesh is created on the fly.

Implemented in CRhRdkCustomRenderMeshes.

◆ New()

static IRhRdkCustomRenderMeshes* IRhRdkCustomRenderMeshes::New ( const CRhinoObject pObject)
static

Create a new render mesh collection. Use this instead of creating a CRhRdkCustomRenderMeshes object (that class is now deprecated).

Parameters
pObjectis the object to which these custom render meshes apply or null if the render meshes are for the document based custom render mesh.
Returns
a new object that supports the IRhRdkCustomRenderMeshes interface. Call IRhRdkCustomRenderMeshes2::Promote to get IRhRdkCustomRenderMeshes2

◆ Object()

virtual const CRhinoObject* IRhRdkCustomRenderMeshes::Object ( void  ) const
pure virtual
Returns
A pointer to the Rhino object.

Implemented in CRhRdkCustomRenderMeshes.

◆ Plane()

virtual bool IRhRdkCustomRenderMeshes::Plane ( int  iIndex,
ON_PlaneSurface plane 
) const
pure virtual

Get a plane by its index.

Parameters
iIndexis the geometry index which must be >= 0 and < Count().
planeis the plane geometry if the function returns true.
Returns
true if the geometry at the index is a plane. false if not, or iIndex is out of range.

Implemented in CRhRdkCustomRenderMeshes.

◆ PrimitiveType()

virtual RhRdkRenderMeshPrimitiveTypes IRhRdkCustomRenderMeshes::PrimitiveType ( int  iIndex) const
pure virtual
Returns
The primitive type supported by the mesh. Usually just mesh.

Implemented in CRhRdkCustomRenderMeshes.

◆ ProviderId()

virtual UUID IRhRdkCustomRenderMeshes::ProviderId ( void  ) const
pure virtual
Returns
The id of the provider that called SetProviderId().

Implemented in CRhRdkCustomRenderMeshes.

◆ SetAutoDeleteMaterialsOn()

virtual void IRhRdkCustomRenderMeshes::SetAutoDeleteMaterialsOn ( void  )
pure virtual

The provider should call this to make the object automatically delete all materials when they are no longer needed. If called, it must be called before calling Add().

Implemented in CRhRdkCustomRenderMeshes.

◆ SetAutoDeleteMeshesOn()

virtual void IRhRdkCustomRenderMeshes::SetAutoDeleteMeshesOn ( void  )
pure virtual

The provider should call this to make the object automatically delete all meshes when they are no longer needed. If called, it must be called before calling Add().

Implemented in CRhRdkCustomRenderMeshes.

◆ SetInstanceTransform()

virtual void IRhRdkCustomRenderMeshes::SetInstanceTransform ( const ON_Xform xformInstance)
pure virtual

Providers should set this information -

See also
GetInstanceTransform() for more information.

Implemented in CRhRdkCustomRenderMeshes.

◆ SetProviderId()

virtual void IRhRdkCustomRenderMeshes::SetProviderId ( const UUID &  uuidRMP)
pure virtual

The provider should call this to identify itself. It must be called before calling Add().

Implemented in CRhRdkCustomRenderMeshes.

◆ SetUseObjectsMappingChannels()

virtual void IRhRdkCustomRenderMeshes::SetUseObjectsMappingChannels ( bool  bSet)
pure virtual

The provider calls this with true if the texture mapping will be taken from the Rhino object. Otherwise it calls this with false. Then the texture mapping will use the TCs on the mesh only.

Implemented in CRhRdkCustomRenderMeshes.

◆ Sphere()

virtual bool IRhRdkCustomRenderMeshes::Sphere ( int  iIndex,
ON_Sphere sphere 
) const
pure virtual

Get a sphere by its index.

Parameters
iIndexis the geometry index which must be >= 0 and < Count().
sphereis the spherical geometry if the function returns true.
Returns
true if the geometry at the index is a sphere. false if not, or iIndex is out of range.

Implemented in CRhRdkCustomRenderMeshes.

◆ UseObjectsMappingChannels()

virtual bool IRhRdkCustomRenderMeshes::UseObjectsMappingChannels ( void  ) const
pure virtual
Returns
true if the texture mapping will be taken from the Rhino object. Otherwise the texture mapping will use the TCs on the mesh only.

Implemented in CRhRdkCustomRenderMeshes.