Rhino C++ API  8.6
Public Member Functions | Protected Member Functions | List of all members
CRhRdkLightManagerSupport Class Referenceabstract

#include <RhRdkLightManagerSupport.h>

Inheritance diagram for CRhRdkLightManagerSupport:
CRhRdkExtension CRhinoEventWatcher CRhRdkObject CRhRdkLightManagerSupport_BuiltIn

Public Member Functions

 CRhRdkLightManagerSupport ()
 
virtual ~CRhRdkLightManagerSupport ()
 
virtual bool DeleteLight (CRhinoDoc &doc, const ON_Light &light, bool bUndelete=false) const
 
virtual void * EVF (const wchar_t *, void *) override
 
virtual void GetLights (const CRhinoDoc &doc, ON_ObjectArray< ON_Light > &lights) const
 
virtual bool GetLightSolo (CRhinoDoc &doc, const ON_UUID &id) const
 
virtual void GroupLights (CRhinoDoc &doc, ON_ObjectArray< ON_Light > &lights) const
 
virtual UUID InterfaceId (void) const override
 
bool IsActive (void) const
 
virtual bool IsInSoloStorage (const CRhinoDoc &doc, const ON_UUID &lightId) const
 
virtual ON_wString LightDescription (const CRhinoDoc &doc, const ON_Light &light) const
 
virtual bool LightFromId (const CRhinoDoc &doc, const ON_UUID &uuid, ON_Light &light) const
 
virtual bool LightFromObject (const CRhinoObject &object, ON_Light &light) const
 
virtual int LightsInSoloStorage (const CRhinoDoc &doc) const
 
virtual void ModifyLight (CRhinoDoc &doc, const ON_Light &light) const
 
virtual unsigned int ObjectSerialNumberFromLight (const CRhinoDoc &doc, const ON_Light &light) const
 
virtual void OnCustomLightEvent (const CRhinoDoc &doc, CRhinoEventWatcher::light_event, const ON_Light &light) const
 
virtual bool OnEditLight (CRhinoDoc &doc, ON_ObjectArray< ON_Light > &light) const
 
virtual UUID RenderEngineId (void) const =0
 
virtual bool RestoreFromSolo (CRhinoDoc &doc, const ON_UUID &lightId) const
 
virtual bool SaveToSoloStorage (CRhinoDoc &doc, const ON_UUID &lightId) const
 
virtual bool SetLightSolo (CRhinoDoc &doc, const ON_UUID &id, bool bSolo) const
 
virtual void UnGroup (CRhinoDoc &doc, ON_ObjectArray< ON_Light > &lights) const
 
- Public Member Functions inherited from CRhRdkExtension
 CRhRdkExtension ()
 
virtual ~CRhRdkExtension ()
 
virtual UUID PlugInId (void) const =0
 
bool Unregister (void)
 
- Public Member Functions inherited from CRhRdkObject
 CRhRdkObject ()
 
virtual ~CRhRdkObject ()
 
void operator delete (void *buf)
 
void operator delete[] (void *buf)
 
void * operator new (size_t size)
 
void * operator new[] (size_t size)
 
- Public Member Functions inherited from CRhinoEventWatcher
 CRhinoEventWatcher ()
 
 CRhinoEventWatcher (bool headlessDocAware, bool headlessAppAware)
 
virtual ~CRhinoEventWatcher ()
 
virtual void AliasTableEvent (CRhinoEventWatcher::alias_event event, const CRhinoAppAliasList &alias_table, int alias_index, const CRhinoCommandAlias *old_settings)
 
virtual int DeleteLayerCheck (CRhinoDoc &doc, ON_SimpleArray< int > &layer_index_list, bool bQuiet)
 
virtual void DimStyleTableEvent (CRhinoEventWatcher::dimstyle_event event, const CRhinoDimStyleTable &dimstyle_table, int dimstyle_index, const ON_DimStyle *old_settings)
 
void Enable (BOOL32 b=TRUE)
 
virtual void Event (event_id id, unsigned int iParam1, int iParam2, const void *ptrParam1, const void *ptrParam2)
 OBSOLETE - NEVER USE THIS. More...
 
virtual void GroupTableEvent (CRhinoEventWatcher::group_event event, const CRhinoGroupTable &group_table, int group_index, const ON_Group *old_settings)
 
virtual void HatchPatternTableEvent (CRhinoEventWatcher::hatchpattern_event event, const CRhinoHatchPatternTable &hatchpattern_table, int hatchpattern_index, const ON_HatchPattern *old_settings)
 
virtual void InstanceDefinitionTableEvent (CRhinoEventWatcher::idef_event event, const CRhinoInstanceDefinitionTable &idef_table, int idef_index, const ON_InstanceDefinition *old_settings)
 
bool IsEnabled () const
 
bool IsHeadlessAppAware () const
 
bool IsHeadlessDocAware () const
 
virtual void LayerTableEvent (CRhinoEventWatcher::layer_event event, const CRhinoLayerTable &layer_table, int layer_index, const ON_Layer *old_settings)
 
virtual void LinetypeTableEvent (CRhinoEventWatcher::linetype_event event, const CRhinoLinetypeTable &linetype_table, int linetype_index, const ON_Linetype *old_settings)
 
virtual void MaterialTableEvent (CRhinoEventWatcher::material_event event, const CRhinoMaterialTable &material_table, int material_index, const ON_Material *old_settings)
 
virtual void OnActiveDocumentChanged (CRhinoDoc *doc)
 
virtual void OnAppSettingsChanged (const CRhinoAppSettings &new_app_settings)
 
virtual void OnBeginCommand (const CRhinoCommand &command, const CRhinoCommandContext &context)
 
virtual void OnBeginOpenDocument (CRhinoDoc &doc, const wchar_t *filename, BOOL32 bMerge, BOOL32 bReference)
 
virtual void OnBeginSaveDocument (CRhinoDoc &doc, const wchar_t *filename, BOOL32 bExportSelected)
 
virtual void OnCloseDocument (CRhinoDoc &doc)
 
virtual void OnCloseRhino (class CRhinoApp &app)
 
virtual void OnCreateView (CRhinoView *rhino_view)
 
virtual void OnDeselectAllObjects (CRhinoDoc &doc, int count)
 
virtual void OnDeselectObject (CRhinoDoc &doc, const CRhinoObject &object)
 
virtual void OnDeselectObjects (CRhinoDoc &doc, const ON_SimpleArray< const CRhinoObject * > &objects)
 
virtual void OnDestroyView (CRhinoView *rhino_view)
 
virtual void OnDocumentPropertiesChanged (CRhinoDoc &doc)
 
virtual void OnEnableEventWatcher (BOOL32 b)
 
virtual void OnEndCommand (const CRhinoCommand &command, const CRhinoCommandContext &context, CRhinoCommand::result rc)
 
virtual void OnEndOpenDocument (CRhinoDoc &doc, const wchar_t *filename, BOOL32 bMerge, BOOL32 bReference)
 
virtual void OnEndSaveDocument (CRhinoDoc &doc, const wchar_t *filename, BOOL32 bExportSelected)
 
virtual void OnInitRhino (class CRhinoApp &app)
 
virtual void OnNewDocument (CRhinoDoc &doc)
 
virtual void OnPurgeObject (CRhinoDoc &doc, CRhinoObject &object)
 
virtual void OnRenameView (CRhinoView *rhino_view)
 
virtual void OnSelectObject (CRhinoDoc &doc, const CRhinoObject &object)
 
virtual void OnSelectObjects (CRhinoDoc &doc, const ON_SimpleArray< const CRhinoObject * > &objects)
 
virtual void OnSetActiveView (CRhinoView *rhino_view)
 
virtual void OnUnitsChangedWithScaling (CRhinoDoc &doc, double scale)
 
virtual void OnUpdateObjectMesh (CRhinoDoc &doc, CRhinoObject &object, ON::mesh_type mesh_type)
 
void Register ()
 
unsigned int SerialNumber () const
 
virtual void TextureMappingTableEvent (CRhinoEventWatcher::texture_mapping_event event, const CRhinoTextureMappingTable &texture_mapping_table, int texture_mapping_index, const ON_TextureMapping *old_settings)
 
virtual void UndoEvent (CRhinoEventWatcher::undo_event event, unsigned int undo_record_serialnumber, const CRhinoCommand *cmd)
 
void UnRegister ()
 

Protected Member Functions

virtual void LightTableEvent (CRhinoEventWatcher::light_event event, const CRhinoLightTable &light_table, int light_index, const ON_Light *old_settings) override
 
virtual const CRhinoObjectObjectFromLight (const CRhinoDoc &doc, const ON_Light &light) const
 
virtual void OnAddObject (CRhinoDoc &doc, CRhinoObject &object) override
 
virtual void OnDeleteObject (CRhinoDoc &doc, CRhinoObject &object) override
 
virtual void OnModifyObjectAttributes (CRhinoDoc &doc, CRhinoObject &object, const CRhinoObjectAttributes &old_attributes) override
 
virtual void OnObjectReplaced (unsigned int rhino_doc_serial_number, unsigned int deleted_object_sn, unsigned int added_object_sn) override
 
virtual void OnReplaceObject (CRhinoDoc &doc, CRhinoObject &old_object, CRhinoObject &new_object) override
 
virtual void OnUnDeleteObject (CRhinoDoc &doc, CRhinoObject &object) override
 

Additional Inherited Members

- Public Types inherited from CRhinoEventWatcher
enum  alias_event {
  alias_added, alias_deleted, alias_undeleted, alias_modified,
  alias_sorted, alias_current
}
 
enum  dimstyle_event {
  dimstyle_added, dimstyle_deleted, dimstyle_undeleted, dimstyle_modified,
  dimstyle_sorted, dimstyle_current
}
 
enum  event_id { event_id_none = 0, event_id_force_4byte_size = 0xFFFFFFFF }
 OBSOLETE - NEVER USE THIS. More...
 
enum  font_event {
  font_added, font_deleted, font_undeleted, font_modified,
  font_sorted, font_current
}
 
enum  group_event {
  group_added, group_deleted, group_undeleted, group_modified,
  group_sorted
}
 
enum  hatchpattern_event {
  hatchpattern_added, hatchpattern_deleted, hatchpattern_undeleted, hatchpattern_modified,
  hatchpattern_sorted, hatchpattern_current
}
 
enum  idef_event {
  idef_added, idef_deleted, idef_undeleted, idef_modified,
  idef_sorted
}
 
enum  layer_event {
  layer_added, layer_deleted, layer_undeleted, layer_modified,
  layer_sorted, layer_current
}
 
enum  light_event {
  light_added, light_deleted, light_undeleted, light_modified,
  light_sorted
}
 
enum  linetype_event {
  linetype_added, linetype_deleted, linetype_undeleted, linetype_modified,
  linetype_sorted, linetype_current
}
 
enum  material_event {
  material_added, material_deleted, material_undeleted, material_modified,
  material_sorted, material_current
}
 
enum  text_style_event : unsigned int {
  text_style_added, text_style_deleted, text_style_undeleted, text_style_modified,
  text_style_sorted, text_style_current
}
 
enum  texture_mapping_event {
  texture_mapping_added, texture_mapping_deleted, texture_mapping_undeleted, texture_mapping_modified,
  texture_mapping_sorted, texture_mapping_current
}
 
enum  undo_event {
  no_undo_event = 0, begin_recording, end_recording, begin_undo,
  end_undo, begin_redo, end_redo, before_begin_recording,
  before_end_recording, purge_record = 86
}
 
- Static Public Member Functions inherited from CRhRdkObject
static void CheckMemory (void)
 
static void PopulateDebuggingInfo (void)
 

Constructor & Destructor Documentation

◆ CRhRdkLightManagerSupport()

CRhRdkLightManagerSupport::CRhRdkLightManagerSupport ( )

◆ ~CRhRdkLightManagerSupport()

virtual CRhRdkLightManagerSupport::~CRhRdkLightManagerSupport ( )
virtual

Member Function Documentation

◆ DeleteLight()

virtual bool CRhRdkLightManagerSupport::DeleteLight ( CRhinoDoc doc,
const ON_Light light,
bool  bUndelete = false 
) const
virtual

◆ EVF()

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

Emergency virtual function for future expansion.

Reimplemented from CRhRdkObject.

◆ GetLights()

virtual void CRhRdkLightManagerSupport::GetLights ( const CRhinoDoc doc,
ON_ObjectArray< ON_Light > &  lights 
) const
virtual

Return the light list - default behaviour is to retrieve the lights from CRhinoDoc::m_light_table. Custom lights should have unique m_light_id.

◆ GetLightSolo()

virtual bool CRhRdkLightManagerSupport::GetLightSolo ( CRhinoDoc doc,
const ON_UUID id 
) const
virtual

◆ GroupLights()

virtual void CRhRdkLightManagerSupport::GroupLights ( CRhinoDoc doc,
ON_ObjectArray< ON_Light > &  lights 
) const
virtual

◆ InterfaceId()

virtual UUID CRhRdkLightManagerSupport::InterfaceId ( void  ) const
overridevirtual

Returns the unique interface id of this extension.

Implements CRhRdkExtension.

◆ IsActive()

bool CRhRdkLightManagerSupport::IsActive ( void  ) const

◆ IsInSoloStorage()

virtual bool CRhRdkLightManagerSupport::IsInSoloStorage ( const CRhinoDoc doc,
const ON_UUID lightId 
) const
virtual

◆ LightDescription()

virtual ON_wString CRhRdkLightManagerSupport::LightDescription ( const CRhinoDoc doc,
const ON_Light light 
) const
virtual

◆ LightFromId()

virtual bool CRhRdkLightManagerSupport::LightFromId ( const CRhinoDoc doc,
const ON_UUID uuid,
ON_Light light 
) const
virtual

Default implementation searches the CRhinoDoc::m_light_table

◆ LightFromObject()

virtual bool CRhRdkLightManagerSupport::LightFromObject ( const CRhinoObject object,
ON_Light light 
) const
virtual

The default implementation is to check if the object is a CRhinoLight, and if it is, return the ON_Light.

◆ LightsInSoloStorage()

virtual int CRhRdkLightManagerSupport::LightsInSoloStorage ( const CRhinoDoc doc) const
virtual

◆ LightTableEvent()

virtual void CRhRdkLightManagerSupport::LightTableEvent ( CRhinoEventWatcher::light_event  event,
const CRhinoLightTable light_table,
int  light_index,
const ON_Light old_settings 
)
overrideprotectedvirtual

/ Description: / LightTableEvent() is called whenever the light table is changed. / / Parameters: / event - [in] type of event / light_table - [in] light table / light_index - [in] light of light / If the event is light_sorted, then light_index is 0. / old_settings - [in] If the event is light_modified, / then the old light definition is / passed here. Otherwise, this parameter is NULL. / WARNING: Never modify the Rhino document in a LightTableEvent() override. If you need to change the Rhino document or post update messages to controls, then your LightTableEvent() override should record what happened in an efficient way and then make any changes that are required in a CRhinoIsIdle.Notify() override.

Reimplemented from CRhinoEventWatcher.

◆ ModifyLight()

virtual void CRhRdkLightManagerSupport::ModifyLight ( CRhinoDoc doc,
const ON_Light light 
) const
virtual

◆ ObjectFromLight()

virtual const CRhinoObject* CRhRdkLightManagerSupport::ObjectFromLight ( const CRhinoDoc doc,
const ON_Light light 
) const
protectedvirtual

◆ ObjectSerialNumberFromLight()

virtual unsigned int CRhRdkLightManagerSupport::ObjectSerialNumberFromLight ( const CRhinoDoc doc,
const ON_Light light 
) const
virtual

Default implementation searchs the CRhinoDoc::m_light_table and compares ON_Light::m_light_id

◆ OnAddObject()

virtual void CRhRdkLightManagerSupport::OnAddObject ( CRhinoDoc doc,
CRhinoObject object 
)
overrideprotectedvirtual

Object events / Description: / Called if a new object is added to the document. / / Parameters: / doc - [in] object's document / object - [in] new object WARNING: Never modify the Rhino document in a OnAddObject() override. If you need to change the Rhino document or post update messages to controls, then your OnAddObject() override should record what happened in an efficient way and then make any changes that are required in a CRhinoIsIdle.Notify() override.

Reimplemented from CRhinoEventWatcher.

◆ OnCustomLightEvent()

virtual void CRhRdkLightManagerSupport::OnCustomLightEvent ( const CRhinoDoc doc,
CRhinoEventWatcher::light_event  ,
const ON_Light light 
) const
virtual

◆ OnDeleteObject()

virtual void CRhRdkLightManagerSupport::OnDeleteObject ( CRhinoDoc doc,
CRhinoObject object 
)
overrideprotectedvirtual

/ Description: / Called if an object is deleted. At some later point / the object can be un-deleted. / / Parameters: / doc - [in] object's document / object - [in] object that was deleted. WARNING: Never modify the Rhino document in a OnDeleteObject() override. If you need to change the Rhino document or post update messages to controls, then your OnDeleteObject() override should record what happened in an efficient way and then make any changes that are required in a CRhinoIsIdle.Notify() override.

Reimplemented from CRhinoEventWatcher.

◆ OnEditLight()

virtual bool CRhRdkLightManagerSupport::OnEditLight ( CRhinoDoc doc,
ON_ObjectArray< ON_Light > &  light 
) const
virtual

◆ OnModifyObjectAttributes()

virtual void CRhRdkLightManagerSupport::OnModifyObjectAttributes ( CRhinoDoc doc,
CRhinoObject object,
const CRhinoObjectAttributes old_attributes 
)
overrideprotectedvirtual

/ Description: / Called if an object's attributes change. / / Parameters: / doc - [in] object's document / object - [in] object whose attributes were changed. The new / attributes are object.Attributes(). / old_attributes - [in] attributes before the change. WARNING: Never modify the Rhino document in a OnModifyObjectAttributes() override. If you need to change the Rhino document or post update messages to controls, then your OnModifyObjectAttributes() override should record what happened in an efficient way and then make any changes that are required in a CRhinoIsIdle.Notify() override.

Reimplemented from CRhinoEventWatcher.

◆ OnObjectReplaced()

virtual void CRhRdkLightManagerSupport::OnObjectReplaced ( unsigned int  rhino_doc_serial_number,
unsigned int  deleted_object_sn,
unsigned int  added_object_sn 
)
overrideprotectedvirtual

Description: When an object is replaced by calling CRhinoDoc::ReplaceObject(), the following CRhinoEventWatcher event notifications are sent:

CRhinoEventWatcher::OnReplaceObject(doc,objA,objB)

If the object being replace is selected, then a CRhinoEventWatcher::OnDeselectObject(objA) notification occurs.

CRhinoEventWatcher::OnDeleteObject(objA)

If a new object is being added, then a CRhinoEventWatcher::OnAddObject objB) notification occurs. If a previous relace object is being undone, then a CRhinoEventWatcher::OnUndeleteObject (objB) occurs.

If the object being replace is selected, then a CRhinoEventWatcher::OnSelectObject(objB) notification occurs

CRhinoEventWatcher::OnObjectReplaced(doc,objA,objB)

Parameters: rhino_doc_serial_number - [in] Serial number of the document. Use CRhinoDoc::FromRuntimeSerialNumber(rhino_doc_serial_number) to get a pointer to the document. Always check for nullptr before dereferencing the returned value. Never modify the document in the callback.

deleted_object_sn - [in] The value of the deleted object's CRhinoObject.RuntimeSerialNumber(). Depending on Rhino application state and settings, this object may no longer exist or may continue to exist for an undetermined duration to permit a possible future undo operation. Use CRhinoObjec::FromRuntimeSerialNumber( rhino_doc_serial_number, deleted_object_sn ) to get a pointer to the object. Always check for nullptr before dereferencing the returned value. Never modify this object.

added_object_sn - [in] The value of the new object's CRhinoObject.RuntimeSerialNumber() Use CRhinoObjec::FromRuntimeSerialNumber( rhino_doc_serial_number, added_object_sn ) to get a pointer to the object. Always check for nullptr before dereferencing the returned value. Never modify this object.

static const CRhinoObject* FromRuntimeSerialNumber( unsigned int rhino_doc_runtime_serial_number, unsigned int rhino_object_runtime_serial_number );

WARNING: Never modify any object or other Rhino document values in a OnObjectReplaced() override. If you need to change the Rhino document or post update messages to controls, then your OnObjectReplaced() override should record what happened in an efficient way and then make any changes that are required in a CRhinoIsIdle.Notify() override.

Reimplemented from CRhinoEventWatcher.

◆ OnReplaceObject()

virtual void CRhRdkLightManagerSupport::OnReplaceObject ( CRhinoDoc doc,
CRhinoObject old_object,
CRhinoObject new_object 
)
overrideprotectedvirtual

Description: Called if an object is about to be replaced.

Parameters: doc - [in] object's document old_object - [in] existing object - about to be deleted. At the time OnReplaceObject() is called, old_object has not been deleted. new_object - [in] new object - about to be added. At the time OnReplaceObject() is called, new_object has not been added to doc.

Remarks: If both CRhinoDoc::UndoActive() or CRhinoDoc::RedoActive() are false, then immediatedly after OnReplaceObject(doc,old_object,new_object) is called there will be a call to OnDeleteObject(doc,old_object) and then a call to OnAddObject(doc,new_object).

If either CRhinoDoc::UndoActive() and CRhinoDoc::RedoActive() are true, then immediatedly after OnReplaceObject(doc,old_object,new_object) is called there will be a call to OnDeleteObject(doc,old_object) and then a call to OnUnDeleteObject(doc,new_object).

WARNING: Never modify the Rhino document in a OnReplaceObject() override. If you need to change the Rhino document or post update messages to controls, then your OnReplaceObject() override should record what happened in an efficient way and then make any changes that are required in a CRhinoIsIdle.Notify() override.

Reimplemented from CRhinoEventWatcher.

◆ OnUnDeleteObject()

virtual void CRhRdkLightManagerSupport::OnUnDeleteObject ( CRhinoDoc doc,
CRhinoObject object 
)
overrideprotectedvirtual

/ Description: / Called if an object is un-deleted. / / Parameters: / doc - [in] object's document / object - [in] object tha was deleted and is now active. WARNING: Never modify the Rhino document in a OnUnDeleteObject() override. If you need to change the Rhino document or post update messages to controls, then your OnUnDeleteObject() override should record what happened in an efficient way and then make any changes that are required in a CRhinoIsIdle.Notify() override.

Reimplemented from CRhinoEventWatcher.

◆ RenderEngineId()

virtual UUID CRhRdkLightManagerSupport::RenderEngineId ( void  ) const
pure virtual

◆ RestoreFromSolo()

virtual bool CRhRdkLightManagerSupport::RestoreFromSolo ( CRhinoDoc doc,
const ON_UUID lightId 
) const
virtual

◆ SaveToSoloStorage()

virtual bool CRhRdkLightManagerSupport::SaveToSoloStorage ( CRhinoDoc doc,
const ON_UUID lightId 
) const
virtual

◆ SetLightSolo()

virtual bool CRhRdkLightManagerSupport::SetLightSolo ( CRhinoDoc doc,
const ON_UUID id,
bool  bSolo 
) const
virtual

◆ UnGroup()

virtual void CRhRdkLightManagerSupport::UnGroup ( CRhinoDoc doc,
ON_ObjectArray< ON_Light > &  lights 
) const
virtual