Rhino C++ API  8.7
Classes | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
RhRdk::Realtime2::ChangeQueue Class Reference

#include <RhRdk_RCE_Queue2.h>

Classes

class  ClippingPlane
 
class  DynamicObject
 
class  GroundPlane
 
class  Light
 
class  MappingChannel
 
class  MappingChannels
 
class  Material
 
class  Mesh
 
class  MeshInstance
 
class  Skylight
 

Public Member Functions

 ChangeQueue (const ChangeQueue &)=delete
 
 ChangeQueue (const CRhinoDoc &doc, const UUID &uuidPlugInId, const ON_3dmView &view, const CDisplayPipelineAttributes *pAttributes, bool bRespectDisplayAttributes, bool bNotifyChanges)
 
 ChangeQueue (const IRhRdkPreviewSceneServer &ss, const UUID &uuidPlugInId)
 
virtual ~ChangeQueue (void)
 
virtual ON__UINT32 AddContentReference (const CRhRdkContent &content)
 
virtual ON__UINT32 AddMaterialReference (const CRhinoDoc *pDocAssoc, const ON_Material &pMaterial)
 
virtual ON__UINT32 AddMaterialReference (const CRhRdkMaterial &material)
 
virtual bool AddObjectReference (const CRhinoObject &object)
 
virtual void ApplyClippingPlaneChanges (const ON_SimpleArray< const UUID * > &deleted, const ON_SimpleArray< const ClippingPlane * > &addedOrModifiedClippingPlanes) const
 
virtual void ApplyDisplayAttributesChanges (const CDisplayPipelineAttributes *pAttributes) const
 
virtual void ApplyDynamicClippingPlaneChanges (const ON_SimpleArray< const ClippingPlane * > &adpc) const
 
virtual void ApplyDynamicLightChanges (const ON_SimpleArray< const ON_Light * > &lights) const
 
virtual void ApplyDynamicObjectTransforms (const ON_SimpleArray< const DynamicObject * > &dynamicTransforms) const
 
virtual void ApplyEnvironmentChanges (IRhRdkCurrentEnvironment::Usage usage) const
 
virtual void ApplyGroundPlaneChanges (const GroundPlane &gp) const
 
virtual void ApplyLightChanges (const ON_SimpleArray< const Light * > &lights) const
 
virtual void ApplyLinearWorkflowChanges (const IRhRdkLinearWorkflow &lw) const
 
virtual void ApplyMaterialChanges (const ON_SimpleArray< const Material * > &materials) const
 
virtual void ApplyMeshChanges (const ON_SimpleArray< const UUID * > &deleted, const ON_SimpleArray< const Mesh * > &addedOrChanged) const
 
virtual void ApplyMeshInstanceChanges (const ON_SimpleArray< ON__UINT32 > &deleted, const ON_SimpleArray< const MeshInstance * > &addedOrChanged) const
 
virtual void ApplyRenderSettingsChanges (const ON_3dmRenderSettings &rs) const
 
virtual void ApplySkylightChanges (const Skylight &skylight) const
 
virtual void ApplySunChanges (const ON_Light &sun) const
 
virtual void ApplyViewChange (const ON_3dmView &view) const
 
virtual bool AreViewsEqual (const ON_3dmView &oldView, const ON_3dmView &newView) const
 
virtual eRhRdkBakingFunctions BakeFor (void) const
 
virtual int BakingSize (const CRhinoObject &object, const CRhRdkMaterial &material, ON_Texture::TYPE channel) const
 
virtual unsigned int ContentRenderCRC (const CRhRdkContent &content, const CRhRdkContent::CRenderCRCFlags &flags, const IRhRdkLinearWorkflow *pLW=nullptr) const
 
virtual bool ConvertCameraBasedLightToWorld (ON_Light &light, const ON_Viewport &vp)
 
virtual void CreateWorld (bool bFlushWhenFinished=true)
 
virtual const CRhRdkEnvironmentEnvironmentFromId (ON__UINT32 id) const
 
const CRhRdkEnvironmentEnvironmentFromOriginalInstanceId (const ON_UUID &id) const
 
virtual ON__UINT32 EnvironmentIdForUsage (IRhRdkCurrentEnvironment::Usage usage) const
 
virtual void Flush (bool bApplyChanges=true)
 
virtual bool HasViewChanged (const ON_UUID &viewportId)
 
virtual bool HasViewChanged (void)
 
virtual void Lock ()
 
virtual void Lock () const
 
virtual const CRhRdkMaterialMaterialFromId (ON__UINT32 id) const
 
const CRhRdkMaterialMaterialFromOriginalInstanceId (const ON_UUID &id) const
 
virtual bool NeedsBakingOnAnyChannel (const CRhinoDoc &doc, const CRhinoObject &, const CInstanceAncestry *pOptionalAncestry=nullptr, const CRhRdkMaterial *pOptionalMaterial=nullptr) const
 
virtual void NotifyBeginUpdates () const
 
virtual void NotifyDynamicUpdatesAreAvailable (void) const
 
virtual void NotifyEndUpdates () const
 
virtual const CRhinoObjectObjectFromId (const ON_UUID &id) const
 
const ChangeQueueoperator= (const ChangeQueue &)=delete
 
class IQueuePoster & Post (void)
 
virtual bool ProvideOriginalObject (void) const
 
const CDisplayPipelineAttributesQueueDisplayAttributes (void) const
 
virtual const GroundPlaneQueueGroundPlane (void) const
 
virtual const ON_3dmRenderSettingsQueueRenderSettings (void) const
 
virtual const ON_BoundingBoxQueueSceneBoundingBox (void) const
 
virtual const SkylightQueueSkylight (void) const
 
virtual const ON_LightQueueSun (void) const
 
virtual const ON_3dmViewQueueView (void) const
 
virtual bool ShouldAggregateMeshes (const CRhinoObject &obj) const
 
virtual const CRhRdkTextureTextureFromId (ON__UINT32 id) const
 
const CRhRdkTextureTextureFromOriginalInstanceId (const ON_UUID &id) const
 
bool TryLock (void)
 
bool TryLock (void) const
 
virtual void Unlock ()
 
virtual void Unlock () const
 

Static Public Member Functions

static bool IsIgnoredObject (const CRhinoObject &)
 
static void SetIgnoredObject (CRhinoObject &)
 

Protected Member Functions

virtual void * EVF (const wchar_t *, void *)
 

Protected Attributes

Impl * m_pImpl = nullptr
 

Constructor & Destructor Documentation

◆ ChangeQueue() [1/3]

RhRdk::Realtime2::ChangeQueue::ChangeQueue ( const CRhinoDoc doc,
const UUID &  uuidPlugInId,
const ON_3dmView view,
const CDisplayPipelineAttributes pAttributes,
bool  bRespectDisplayAttributes,
bool  bNotifyChanges 
)

Construct a ChangeQueue for given parameters

Parameters
docis the Rhino document for which the ChangeQueue is generated.
uuidPlugInIdis the UUID for the plug-in
viewis the ON_3dmView for which this Changeueue tracks viewport manipulations
pAttributesis the display attributes if any
bRespectDisplayAttributestrue if changes to display attributes should be tracked
bNotifyChangestrue if changes should be notified

◆ ChangeQueue() [2/3]

RhRdk::Realtime2::ChangeQueue::ChangeQueue ( const IRhRdkPreviewSceneServer ss,
const UUID &  uuidPlugInId 
)

ChangeQueue constructed for a preview rendering.

◆ ~ChangeQueue()

virtual RhRdk::Realtime2::ChangeQueue::~ChangeQueue ( void  )
virtual

Deconstruct the ChangeQueue, clean up.

◆ ChangeQueue() [3/3]

RhRdk::Realtime2::ChangeQueue::ChangeQueue ( const ChangeQueue )
delete

Member Function Documentation

◆ AddContentReference()

virtual ON__UINT32 RhRdk::Realtime2::ChangeQueue::AddContentReference ( const CRhRdkContent content)
virtual

◆ AddMaterialReference() [1/2]

virtual ON__UINT32 RhRdk::Realtime2::ChangeQueue::AddMaterialReference ( const CRhinoDoc pDocAssoc,
const ON_Material pMaterial 
)
virtual

◆ AddMaterialReference() [2/2]

virtual ON__UINT32 RhRdk::Realtime2::ChangeQueue::AddMaterialReference ( const CRhRdkMaterial material)
virtual

◆ AddObjectReference()

virtual bool RhRdk::Realtime2::ChangeQueue::AddObjectReference ( const CRhinoObject object)
virtual

◆ ApplyClippingPlaneChanges()

virtual void RhRdk::Realtime2::ChangeQueue::ApplyClippingPlaneChanges ( const ON_SimpleArray< const UUID * > &  deleted,
const ON_SimpleArray< const ClippingPlane * > &  addedOrModifiedClippingPlanes 
) const
virtual

Apply the clipping plane changes.

Parameters
deletedarray of UUID of the deleted clipping planes
addedOrModifiedClippingPlanesarray of ClippingPlane* that are added or changed

◆ ApplyDisplayAttributesChanges()

virtual void RhRdk::Realtime2::ChangeQueue::ApplyDisplayAttributesChanges ( const CDisplayPipelineAttributes pAttributes) const
virtual

◆ ApplyDynamicClippingPlaneChanges()

virtual void RhRdk::Realtime2::ChangeQueue::ApplyDynamicClippingPlaneChanges ( const ON_SimpleArray< const ClippingPlane * > &  adpc) const
virtual

Apply the dynamic clipping plane changes.

Parameters
adpcarray of ClippingPlane* for dynamic changes (while dragging).

◆ ApplyDynamicLightChanges()

virtual void RhRdk::Realtime2::ChangeQueue::ApplyDynamicLightChanges ( const ON_SimpleArray< const ON_Light * > &  lights) const
virtual

Apply the dynamic light changes (while dragging).

Parameters
lightsarray of changed lights.

◆ ApplyDynamicObjectTransforms()

virtual void RhRdk::Realtime2::ChangeQueue::ApplyDynamicObjectTransforms ( const ON_SimpleArray< const DynamicObject * > &  dynamicTransforms) const
virtual

Apply the dynamic object transformations as given in the simple array (while dragging).

Parameters
dynamicTransformsarray of dynamic object transforms.

◆ ApplyEnvironmentChanges()

virtual void RhRdk::Realtime2::ChangeQueue::ApplyEnvironmentChanges ( IRhRdkCurrentEnvironment::Usage  usage) const
virtual

Apply the changes for the given environment channel.

Parameters
usagethe environment type that changed.

◆ ApplyGroundPlaneChanges()

virtual void RhRdk::Realtime2::ChangeQueue::ApplyGroundPlaneChanges ( const GroundPlane gp) const
virtual

Apply the given ground plane changes.

Parameters
gpthe GroundPlane& with the new state.

◆ ApplyLightChanges()

virtual void RhRdk::Realtime2::ChangeQueue::ApplyLightChanges ( const ON_SimpleArray< const Light * > &  lights) const
virtual

Apply the given light changes.

Parameters
lightsarray of Light* that have been added, deleted or changed.

◆ ApplyLinearWorkflowChanges()

virtual void RhRdk::Realtime2::ChangeQueue::ApplyLinearWorkflowChanges ( const IRhRdkLinearWorkflow lw) const
virtual

Apply the linear workflow changes.

Parameters
lwthe IRhRdkLinearWorkflow&

◆ ApplyMaterialChanges()

virtual void RhRdk::Realtime2::ChangeQueue::ApplyMaterialChanges ( const ON_SimpleArray< const Material * > &  materials) const
virtual

Apply the given material changes. Note that initial material information always comes through the Mesh* in ApplyMeshChanges.

Parameters
materialsarray of Material* that have been changed.

◆ ApplyMeshChanges()

virtual void RhRdk::Realtime2::ChangeQueue::ApplyMeshChanges ( const ON_SimpleArray< const UUID * > &  deleted,
const ON_SimpleArray< const Mesh * > &  addedOrChanged 
) const
virtual

Apply the given mesh changes.

Parameters
deletedarray of UUIDs of deleted meshes
addedOrChangedarray of meshes that have been added or changed.

◆ ApplyMeshInstanceChanges()

virtual void RhRdk::Realtime2::ChangeQueue::ApplyMeshInstanceChanges ( const ON_SimpleArray< ON__UINT32 > &  deleted,
const ON_SimpleArray< const MeshInstance * > &  addedOrChanged 
) const
virtual

Apply the given mesh instance changes.

Parameters
deletedarray of instance ids of deleted mesh instances
addedOrChangedarray of MeshInstance that have been added or changed

◆ ApplyRenderSettingsChanges()

virtual void RhRdk::Realtime2::ChangeQueue::ApplyRenderSettingsChanges ( const ON_3dmRenderSettings rs) const
virtual

Apply the given render settings changes.

Parameters
rsthe ON_3dmRenderSettings& with the new state.

◆ ApplySkylightChanges()

virtual void RhRdk::Realtime2::ChangeQueue::ApplySkylightChanges ( const Skylight skylight) const
virtual

Apply the given skylight changes.

Parameters
skylightthe Skylight with the new state

◆ ApplySunChanges()

virtual void RhRdk::Realtime2::ChangeQueue::ApplySunChanges ( const ON_Light sun) const
virtual

Apply the given sun changes.

Parameters
sunan ON_Light representing the sun.

◆ ApplyViewChange()

virtual void RhRdk::Realtime2::ChangeQueue::ApplyViewChange ( const ON_3dmView view) const
virtual

Apply changes to the view. The given view has the new state.

Parameters
viewthe new view status.

◆ AreViewsEqual()

virtual bool RhRdk::Realtime2::ChangeQueue::AreViewsEqual ( const ON_3dmView oldView,
const ON_3dmView newView 
) const
virtual

◆ BakeFor()

virtual eRhRdkBakingFunctions RhRdk::Realtime2::ChangeQueue::BakeFor ( void  ) const
virtual

◆ BakingSize()

virtual int RhRdk::Realtime2::ChangeQueue::BakingSize ( const CRhinoObject object,
const CRhRdkMaterial material,
ON_Texture::TYPE  channel 
) const
virtual

◆ ContentRenderCRC()

virtual unsigned int RhRdk::Realtime2::ChangeQueue::ContentRenderCRC ( const CRhRdkContent content,
const CRhRdkContent::CRenderCRCFlags flags,
const IRhRdkLinearWorkflow pLW = nullptr 
) const
virtual

◆ ConvertCameraBasedLightToWorld()

virtual bool RhRdk::Realtime2::ChangeQueue::ConvertCameraBasedLightToWorld ( ON_Light light,
const ON_Viewport vp 
)
virtual

Utility function to convert the default light to a more useful world-based light. Only use if your renderer doesn't support camera-based lighting. You should only call this during a flush, where a camera based light has been posted.

Parameters
lightthe light to convert.
vpthe viewport to use as camera.
Returns
true if successfull, else false

◆ CreateWorld()

virtual void RhRdk::Realtime2::ChangeQueue::CreateWorld ( bool  bFlushWhenFinished = true)
virtual

Call this to force the entire model through the queue.

◆ EnvironmentFromId()

virtual const CRhRdkEnvironment* RhRdk::Realtime2::ChangeQueue::EnvironmentFromId ( ON__UINT32  id) const
virtual

Return the CRhRdkEnvironment for given hash.

Parameters
idthe hash of the environment.
Returns
CRhRdkEnvironment if found, else nullptr.

◆ EnvironmentFromOriginalInstanceId()

const CRhRdkEnvironment* RhRdk::Realtime2::ChangeQueue::EnvironmentFromOriginalInstanceId ( const ON_UUID id) const

◆ EnvironmentIdForUsage()

virtual ON__UINT32 RhRdk::Realtime2::ChangeQueue::EnvironmentIdForUsage ( IRhRdkCurrentEnvironment::Usage  usage) const
virtual

Get the hash for environment based on usage. Can be used with EnvironmentFromId.

Parameters
usagethe usage type
Returns
the hash

◆ EVF()

virtual void* RhRdk::Realtime2::ChangeQueue::EVF ( const wchar_t *  ,
void *   
)
protectedvirtual

◆ Flush()

virtual void RhRdk::Realtime2::ChangeQueue::Flush ( bool  bApplyChanges = true)
virtual

Call this to update your renderer world and flash out the change queue.o The "Apply" functions will be called if bApplyChanges is true in order with the queue data, and then the data will be deleted. Once function exits, none of the data you were passed in the Apply functions is available.

You should not call functions in the Rhino document during the Apply functions unless you are rendering on the main thread.

Parameters
bApplyChangestrue if you want the Apply functions to be called.

◆ HasViewChanged() [1/2]

virtual bool RhRdk::Realtime2::ChangeQueue::HasViewChanged ( const ON_UUID viewportId)
virtual

Returns true if the viewport with UUID has changed.

Parameters
viewportIdthe UUID of the viewport.

◆ HasViewChanged() [2/2]

virtual bool RhRdk::Realtime2::ChangeQueue::HasViewChanged ( void  )
virtual

Returns true if the related viewport has changed.

◆ IsIgnoredObject()

static bool RhRdk::Realtime2::ChangeQueue::IsIgnoredObject ( const CRhinoObject )
static

true if given object is ignored.

◆ Lock() [1/2]

virtual void RhRdk::Realtime2::ChangeQueue::Lock ( )
virtual

Implement to handle the locking of the view that is running your display mode.

◆ Lock() [2/2]

virtual void RhRdk::Realtime2::ChangeQueue::Lock ( ) const
virtual

Implement to handle the locking of the view that is running your display mode.

◆ MaterialFromId()

virtual const CRhRdkMaterial* RhRdk::Realtime2::ChangeQueue::MaterialFromId ( ON__UINT32  id) const
virtual

Return the CRhRdkMaterial for given hash.

Parameters
idthe hash of the material.
Returns
CRhRdkMaterial if found, else nullptr.

◆ MaterialFromOriginalInstanceId()

const CRhRdkMaterial* RhRdk::Realtime2::ChangeQueue::MaterialFromOriginalInstanceId ( const ON_UUID id) const

◆ NeedsBakingOnAnyChannel()

virtual bool RhRdk::Realtime2::ChangeQueue::NeedsBakingOnAnyChannel ( const CRhinoDoc doc,
const CRhinoObject ,
const CInstanceAncestry *  pOptionalAncestry = nullptr,
const CRhRdkMaterial pOptionalMaterial = nullptr 
) const
virtual

Return bool if you need any of the mesh effects baked.

◆ NotifyBeginUpdates()

virtual void RhRdk::Realtime2::ChangeQueue::NotifyBeginUpdates ( ) const
virtual

This function is called when the ChangeQueue receives a new change.

◆ NotifyDynamicUpdatesAreAvailable()

virtual void RhRdk::Realtime2::ChangeQueue::NotifyDynamicUpdatesAreAvailable ( void  ) const
virtual

This function is called when an immediate updates is required (view changes, dynamic object changes. Respond as quickly as you can).

◆ NotifyEndUpdates()

virtual void RhRdk::Realtime2::ChangeQueue::NotifyEndUpdates ( ) const
virtual

This function is called when the ChangeQueue has completed handling changes.

◆ ObjectFromId()

virtual const CRhinoObject* RhRdk::Realtime2::ChangeQueue::ObjectFromId ( const ON_UUID id) const
virtual

◆ operator=()

const ChangeQueue& RhRdk::Realtime2::ChangeQueue::operator= ( const ChangeQueue )
delete

◆ Post()

class IQueuePoster& RhRdk::Realtime2::ChangeQueue::Post ( void  )

◆ ProvideOriginalObject()

virtual bool RhRdk::Realtime2::ChangeQueue::ProvideOriginalObject ( void  ) const
virtual

Return true if you need the original geometry objects (mesh, light, clippingplane).

◆ QueueDisplayAttributes()

const CDisplayPipelineAttributes* RhRdk::Realtime2::ChangeQueue::QueueDisplayAttributes ( void  ) const

Get the display pipeline attributes from the queue.

Returns
CDisplayPipelineAttributes* or nullptr

◆ QueueGroundPlane()

virtual const GroundPlane* RhRdk::Realtime2::ChangeQueue::QueueGroundPlane ( void  ) const
virtual

Get the ground plane data from the queue.

Returns
GroundPlane* or nullptr if no ground plane.

◆ QueueRenderSettings()

virtual const ON_3dmRenderSettings* RhRdk::Realtime2::ChangeQueue::QueueRenderSettings ( void  ) const
virtual

Get the ON_3dmRenderSettings.

Returns
ON_3dmRenderSettings* or nullptr.

◆ QueueSceneBoundingBox()

virtual const ON_BoundingBox* RhRdk::Realtime2::ChangeQueue::QueueSceneBoundingBox ( void  ) const
virtual

Get the bounding box of the scene from the queue.

Returns
ON_BoundingBox&

◆ QueueSkylight()

virtual const Skylight* RhRdk::Realtime2::ChangeQueue::QueueSkylight ( void  ) const
virtual

Get the skylight from the queue.

Returns
Skylight*, or nullptr if no skylight.

◆ QueueSun()

virtual const ON_Light* RhRdk::Realtime2::ChangeQueue::QueueSun ( void  ) const
virtual

Get the sun from the queue.

Returns
ON_Light* or nullptr

◆ QueueView()

virtual const ON_3dmView* RhRdk::Realtime2::ChangeQueue::QueueView ( void  ) const
virtual

Get the view from the queue.

Returns
ON_3dmView* or nullptr

◆ SetIgnoredObject()

static void RhRdk::Realtime2::ChangeQueue::SetIgnoredObject ( CRhinoObject )
static

Ignore given object.

◆ ShouldAggregateMeshes()

virtual bool RhRdk::Realtime2::ChangeQueue::ShouldAggregateMeshes ( const CRhinoObject obj) const
virtual

Return true if you want the meshes aggregated for given object.

◆ TextureFromId()

virtual const CRhRdkTexture* RhRdk::Realtime2::ChangeQueue::TextureFromId ( ON__UINT32  id) const
virtual

Return the CRhRdkTexture for given hash.

Parameters
idthe hash of the texture.
Returns
CRhRdkTexture if found, else nullptr.

◆ TextureFromOriginalInstanceId()

const CRhRdkTexture* RhRdk::Realtime2::ChangeQueue::TextureFromOriginalInstanceId ( const ON_UUID id) const

◆ TryLock() [1/2]

bool RhRdk::Realtime2::ChangeQueue::TryLock ( void  )

◆ TryLock() [2/2]

bool RhRdk::Realtime2::ChangeQueue::TryLock ( void  ) const

◆ Unlock() [1/2]

virtual void RhRdk::Realtime2::ChangeQueue::Unlock ( )
virtual

Implement to handle the unlocking of the view that is running your display model.

◆ Unlock() [2/2]

virtual void RhRdk::Realtime2::ChangeQueue::Unlock ( ) const
virtual

Implement to handle the unlocking of the view that is running your display model.

Member Data Documentation

◆ m_pImpl

Impl* RhRdk::Realtime2::ChangeQueue::m_pImpl = nullptr
protected