Rhino C++ API  8.14
Public Member Functions | List of all members
CRhRdkObjectDataAccess Class Reference

#include <RhRdkObjectDataAccess.h>

Public Member Functions

 CRhRdkObjectDataAccess (const CRhinoDoc &doc, const UUID &uuidRhinoObject)
 
 CRhRdkObjectDataAccess (const CRhinoLayer *pRhinoLayer)
 
 CRhRdkObjectDataAccess (const CRhinoObject *pRhinoObject)
 
RDK_DEPRECATED CRhRdkObjectDataAccess (const UUID &uuidRhinoObject)
 
virtual ~CRhRdkObjectDataAccess ()
 
RDK_DECAL_CRC AddDecal (const IRhRdkDecal &decal) const
 
virtual void * EVF (const wchar_t *wszFunc, void *pvData)
 
virtual bool GetUsedMappingChannels (ON_SimpleArray< int > &arrayOut) const
 
virtual bool Mapping (int iChannelId, ON_TextureMapping &mappingOut, ON_Xform &xformLocalOut) const
 
virtual UUID MaterialInstanceId (void) const
 
virtual CRhRdkDecalIteratorNewDecalIterator (const UUID &uuidRenderEngine=RhinoApp().GetDefaultRenderApp()) const
 
virtual UUID ObjectMaterial (const CRhRdkObjectAncestry *) const
 
virtual bool RemoveAllDecals (void) const
 
virtual bool RemoveDecal (RDK_DECAL_CRC id) const
 
virtual bool SetMaterialInstanceId (const CRhRdkMaterial *pMaterial) const
 
bool SetMaterialInstanceId (const CRhRdkMaterial *pMaterial, bool bClearPerFace) const
 
virtual bool SetMaterialInstanceId (const UUID &uuidMaterialInstance) const
 
void SetVerifyInstanceId (bool b)
 

Detailed Description

This class provides a means of accessing data associated with a Rhino object or layer.

Constructor & Destructor Documentation

◆ ~CRhRdkObjectDataAccess()

virtual CRhRdkObjectDataAccess::~CRhRdkObjectDataAccess ( )
virtual

◆ CRhRdkObjectDataAccess() [1/4]

CRhRdkObjectDataAccess::CRhRdkObjectDataAccess ( const CRhinoDoc doc,
const UUID &  uuidRhinoObject 
)

Construct to access data of Rhino object by object uuid.

◆ CRhRdkObjectDataAccess() [2/4]

RDK_DEPRECATED CRhRdkObjectDataAccess::CRhRdkObjectDataAccess ( const UUID &  uuidRhinoObject)

Deprecated; not document-aware.

◆ CRhRdkObjectDataAccess() [3/4]

CRhRdkObjectDataAccess::CRhRdkObjectDataAccess ( const CRhinoObject pRhinoObject)

Construct to access data of Rhino object by object pointer.

◆ CRhRdkObjectDataAccess() [4/4]

CRhRdkObjectDataAccess::CRhRdkObjectDataAccess ( const CRhinoLayer pRhinoLayer)

Construct to access data of Rhino layer by layer pointer.

Member Function Documentation

◆ AddDecal()

RDK_DECAL_CRC CRhRdkObjectDataAccess::AddDecal ( const IRhRdkDecal decal) const

Add a new decal to the object.

Returns
RDK_NIL_DECAL_CRC if the decal was not added, or any other valid crc if successful.
Note
Your implementation of IRhRdkDecal does not need to support CRC() or Color(). The data you supply will be copied from your object and stored in the RDK's own implementation of IRhRdkDecal. You will be passed a valid decal crc that you can use to find that decal later.

◆ EVF()

virtual void* CRhRdkObjectDataAccess::EVF ( const wchar_t *  wszFunc,
void *  pvData 
)
virtual

Emergency virtual function for future expansion.

◆ GetUsedMappingChannels()

virtual bool CRhRdkObjectDataAccess::GetUsedMappingChannels ( ON_SimpleArray< int > &  arrayOut) const
virtual

Get an array of used mapping channel ids.

Parameters
arrayOutis filled with 1-based channel identifiers.
Returns
true if successful, else false.

◆ Mapping()

virtual bool CRhRdkObjectDataAccess::Mapping ( int  iChannelId,
ON_TextureMapping mappingOut,
ON_Xform xformLocalOut 
) const
virtual

Get the mapping and local xform for a channel.

Parameters
iChannelIdis the channel identifier (1-based).
mappingOutreceives a copy of the mapping.
xformLocalOutreceives the local transform associated with the channel.
Returns
true if successful, else false.

◆ MaterialInstanceId()

virtual UUID CRhRdkObjectDataAccess::MaterialInstanceId ( void  ) const
virtual
Returns
Instance id of RDK material associated with the object. Internal use - consider using ObjectMaterial.

◆ NewDecalIterator()

virtual CRhRdkDecalIterator* CRhRdkObjectDataAccess::NewDecalIterator ( const UUID &  uuidRenderEngine = RhinoApp().GetDefaultRenderApp()) const
virtual
Returns
An iterator for accessing decals or null if this object is not connected to a valid Rhino object.
Note
This is designed to be called by renderers so it only returns visible decals. The caller shall delete the iterator.

◆ ObjectMaterial()

virtual UUID CRhRdkObjectDataAccess::ObjectMaterial ( const CRhRdkObjectAncestry ) const
virtual
Returns
the material associated with this object, depending on the material source.
Note
Currently, 'By Parent' is not implemented.

◆ RemoveAllDecals()

virtual bool CRhRdkObjectDataAccess::RemoveAllDecals ( void  ) const
virtual

Remove all decals from the object.

Returns
true if this object is connected to a valid Rhino object, else false.

◆ RemoveDecal()

virtual bool CRhRdkObjectDataAccess::RemoveDecal ( RDK_DECAL_CRC  id) const
virtual

Remove the specified decal from the object.

Returns
true if the decal was removed, false if the decal does not exist, or if this object is not connected to a valid Rhino object.

◆ SetMaterialInstanceId() [1/3]

virtual bool CRhRdkObjectDataAccess::SetMaterialInstanceId ( const CRhRdkMaterial pMaterial) const
virtual

Set an RDK material to be associated with the object or layer.

Parameters
pMaterialis a pointer to the material.
Returns
true if successful, else false.

◆ SetMaterialInstanceId() [2/3]

bool CRhRdkObjectDataAccess::SetMaterialInstanceId ( const CRhRdkMaterial pMaterial,
bool  bClearPerFace 
) const

Set an RDK material to be associated with the object.

Parameters
pMaterialis a pointer to the material.
bClearPerFaceif true will cause per-face materials to be cleared. Otherwise they will be retained. Only makes sense for objects, not layers.
Returns
true if successful, else false.

◆ SetMaterialInstanceId() [3/3]

virtual bool CRhRdkObjectDataAccess::SetMaterialInstanceId ( const UUID &  uuidMaterialInstance) const
virtual

Set an RDK material to be associated with the object or layer.

Parameters
uuidMaterialInstanceis the instance id of the material.
Returns
true if successful, else false.

◆ SetVerifyInstanceId()

void CRhRdkObjectDataAccess::SetVerifyInstanceId ( bool  b)

By default, content instance ids are verified as existing in the document. In certain cases this verification may not be required. It can be disabled and re-enabled by calling this method.