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

IRenderMeshes is a collection of geometry instances for a given ObjectId typically returned by the Custom Render Mesh system. It provides STL compatible iterators. As each set of primitives is returned by the PrimitiveProviders in turn, the running hash is updated with new information about the mesh modifications that have been made along the way. More...

#include <IRhRdkCustomRenderMeshes.h>

Classes

struct  ConstantIterator
 STL style constant iterator for iterating over the render primitives collection. More...
 
class  IInstance
 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...
 
class  IMappingChannel
 Replacement for ON_MappingChannel that actually carries the ON_TextureMapping around with it instead of storing it in a document table - meaning that it can be passed off to non-document threads and still access the data correctly. More...
 
struct  Iterator
 STL style iterator for iterating over the render primitives collection. More...
 
class  ProviderTracking
 A handy helper class for implementing caching in MeshProviders. The ProviderTracking class is a collection of per-document ITracker objects. Embed a ProviderTracking object in your MeshProvider to implement a simple cache. More...
 

Public Types

using ConstantReverseIterator = std::reverse_iterator< ConstantIterator >
 
using MappingChannels = std::vector< std::shared_ptr< IMappingChannel > >
 Defines a collection of mapping channels that will be carried around by instances or meshes. More...
 
using ReverseIterator = std::reverse_iterator< Iterator >
 

Public Member Functions

virtual ~IRenderMeshes ()
 
virtual void AddInstance (std::shared_ptr< IInstance > instance)=0
 Adds a new instance to the render primitives collection. More...
 
virtual ConstantIterator begin () const =0
 
virtual Iterator begin ()=0
 
virtual ON_BoundingBox BoundingBox (void) const =0
 The bounding box for this IRenderMeshes, always in world space. More...
 
virtual ConstantIterator cbegin () const =0
 
virtual ConstantIterator cend () const =0
 
virtual ConstantReverseIterator crbegin () const =0
 
virtual ConstantReverseIterator crend () const =0
 
virtual CRhinoDocDocument (void) const =0
 Each IRenderMeshes is associated with a specific document. More...
 
virtual ConstantIterator end () const =0
 
virtual Iterator end ()=0
 
virtual void * EVF (const wchar_t *, void *)=0
 Emergency virtual function for future expansion More...
 
virtual ON__UINT32 Hash (void) const =0
 The running hash for this set of render primitives. Usually calculated by a set of parameters in the MeshProvider and based on an initial hash delivered by the first set of primitives. More...
 
virtual size_t InstanceCount () const =0
 The number of instance objects in this collection. More...
 
virtual std::shared_ptr< IRenderMeshesMakeCopy (void) const =0
 Create a copy of the render meshes that can be modified without risk of modifying the cached/document meshes. More...
 
virtual ObjectId ObjectId (void) const =0
 The ObjectId with which this IRenderMeshes object is associated. More...
 
virtual const MeshProviderIdProviderId (void) const =0
 The MeshProvider that created this collection - if this is the first in the stack, typically this will be ON_nil_uuid. More...
 
virtual ReverseIterator rbegin ()=0
 
virtual ReverseIterator rend ()=0
 
void SetHash (ON__UINT32)
 Sets the running hash for this set of render primitives. Usually calculated by a set of parameters in the MeshProvider and based on an initial hash delivered by the first set of primitives. Note - implemented using EVF(L"SetHash", ON__UINT32*) More...
 
virtual void Transform (const ON_Xform &)=0
 Transform this set of render primitives. More...
 

Static Public Member Functions

static std::shared_ptr< IRenderMeshesNew (const CRhinoDoc &doc, const ObjectId &objectId, const MeshProviderId &providerId, ON__UINT32 runningHash)
 Create a new render primitives collection. More...
 
static ON__UINT32 ObjectHash (const CRhinoObject &)
 The function used to create the initial hash from the object when creating the initial set of primitives. More...
 

Public Attributes

friend ConstantIterator
 
friend ConstantReverseIterator
 
friend Iterator
 
friend ReverseIterator
 

Detailed Description

IRenderMeshes is a collection of geometry instances for a given ObjectId typically returned by the Custom Render Mesh system. It provides STL compatible iterators. As each set of primitives is returned by the PrimitiveProviders in turn, the running hash is updated with new information about the mesh modifications that have been made along the way.

Member Typedef Documentation

◆ ConstantReverseIterator

◆ MappingChannels

Defines a collection of mapping channels that will be carried around by instances or meshes.

◆ ReverseIterator

Constructor & Destructor Documentation

◆ ~IRenderMeshes()

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

Member Function Documentation

◆ AddInstance()

virtual void RhRdk::CustomRenderMeshes::IRenderMeshes::AddInstance ( std::shared_ptr< IInstance instance)
pure virtual

Adds a new instance to the render primitives collection.

Parameters
instanceThe instance to be added.

◆ begin() [1/2]

virtual ConstantIterator RhRdk::CustomRenderMeshes::IRenderMeshes::begin ( ) const
pure virtual

◆ begin() [2/2]

virtual Iterator RhRdk::CustomRenderMeshes::IRenderMeshes::begin ( )
pure virtual

◆ BoundingBox()

virtual ON_BoundingBox RhRdk::CustomRenderMeshes::IRenderMeshes::BoundingBox ( void  ) const
pure virtual

The bounding box for this IRenderMeshes, always in world space.

Returns
The bounding box for this IRenderMeshes, always in world space.

◆ cbegin()

virtual ConstantIterator RhRdk::CustomRenderMeshes::IRenderMeshes::cbegin ( ) const
pure virtual

◆ cend()

virtual ConstantIterator RhRdk::CustomRenderMeshes::IRenderMeshes::cend ( ) const
pure virtual

◆ crbegin()

virtual ConstantReverseIterator RhRdk::CustomRenderMeshes::IRenderMeshes::crbegin ( ) const
pure virtual

◆ crend()

virtual ConstantReverseIterator RhRdk::CustomRenderMeshes::IRenderMeshes::crend ( ) const
pure virtual

◆ Document()

virtual CRhinoDoc* RhRdk::CustomRenderMeshes::IRenderMeshes::Document ( void  ) const
pure virtual

Each IRenderMeshes is associated with a specific document.

Returns
The document with which this IRenderMeshes object is associated.

◆ end() [1/2]

virtual ConstantIterator RhRdk::CustomRenderMeshes::IRenderMeshes::end ( ) const
pure virtual

◆ end() [2/2]

virtual Iterator RhRdk::CustomRenderMeshes::IRenderMeshes::end ( )
pure virtual

◆ EVF()

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

◆ Hash()

virtual ON__UINT32 RhRdk::CustomRenderMeshes::IRenderMeshes::Hash ( void  ) const
pure virtual

The running hash for this set of render primitives. Usually calculated by a set of parameters in the MeshProvider and based on an initial hash delivered by the first set of primitives.

Returns
The running hash for this IRenderMeshes.

◆ InstanceCount()

virtual size_t RhRdk::CustomRenderMeshes::IRenderMeshes::InstanceCount ( ) const
pure virtual

The number of instance objects in this collection.

Returns

◆ MakeCopy()

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

Create a copy of the render meshes that can be modified without risk of modifying the cached/document meshes.

Returns

◆ New()

static std::shared_ptr<IRenderMeshes> RhRdk::CustomRenderMeshes::IRenderMeshes::New ( const CRhinoDoc doc,
const ObjectId objectId,
const MeshProviderId providerId,
ON__UINT32  runningHash 
)
static

Create a new render primitives collection.

Parameters
docThe Rhino document with which this collection will be associated.
objectIdThe ObjectId that this collection is for.
providerIdThe MeshProvider that created this collection - if this is the first in the stack, typically this will be ON_nil_uuid.
runningHashThe running hash of this collection - each MeshProvider will update the hash with its own modification hash.
Returns

◆ ObjectHash()

static ON__UINT32 RhRdk::CustomRenderMeshes::IRenderMeshes::ObjectHash ( const CRhinoObject )
static

The function used to create the initial hash from the object when creating the initial set of primitives.

◆ ObjectId()

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

The ObjectId with which this IRenderMeshes object is associated.

Returns
The objectId for which this collection of primitives is built.

◆ ProviderId()

virtual const MeshProviderId& RhRdk::CustomRenderMeshes::IRenderMeshes::ProviderId ( void  ) const
pure virtual

The MeshProvider that created this collection - if this is the first in the stack, typically this will be ON_nil_uuid.

Returns
The MeshProvider that created this collection - if this is the first in the stack, typically this will be ON_nil_uuid.

◆ rbegin()

virtual ReverseIterator RhRdk::CustomRenderMeshes::IRenderMeshes::rbegin ( )
pure virtual

◆ rend()

virtual ReverseIterator RhRdk::CustomRenderMeshes::IRenderMeshes::rend ( )
pure virtual

◆ SetHash()

void RhRdk::CustomRenderMeshes::IRenderMeshes::SetHash ( ON__UINT32  )

Sets the running hash for this set of render primitives. Usually calculated by a set of parameters in the MeshProvider and based on an initial hash delivered by the first set of primitives. Note - implemented using EVF(L"SetHash", ON__UINT32*)

◆ Transform()

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

Transform this set of render primitives.

Member Data Documentation

◆ ConstantIterator

◆ ConstantReverseIterator

◆ Iterator

◆ ReverseIterator