Rhino C++ API
8.14
|
#include <rhinoSdkEventWatcher.h>
Public Member Functions | |
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 | LightTableEvent (CRhinoEventWatcher::light_event event, const CRhinoLightTable &light_table, int light_index, const ON_Light *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 | OnAddObject (CRhinoDoc &doc, CRhinoObject &object) |
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 | OnDeleteObject (CRhinoDoc &doc, CRhinoObject &object) |
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 | OnModifyObjectAttributes (CRhinoDoc &doc, CRhinoObject &object, const CRhinoObjectAttributes &old_attributes) |
virtual void | OnNewDocument (CRhinoDoc &doc) |
virtual void | OnObjectReplaced (unsigned int rhino_doc_serial_number, unsigned int deleted_object_sn, unsigned int added_object_sn) |
virtual void | OnPurgeObject (CRhinoDoc &doc, CRhinoObject &object) |
virtual void | OnRenameView (CRhinoView *rhino_view) |
virtual void | OnReplaceObject (CRhinoDoc &doc, CRhinoObject &old_object, CRhinoObject &new_object) |
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 | OnUnDeleteObject (CRhinoDoc &doc, CRhinoObject &object) |
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 () |
Description: This class is a virtual base class that defines the interface for watching events in Rhino. If you want to watch one or more events, derive a class from CRhinoEventWatcher and override the virtual functions that correspond to the events you want to watch.
You will only be notified if your event watcher is registered and enabled. You must explicitly register your event watcher by calling Register() and then enable your event watcher by calling Enable(true).
enum CRhinoEventWatcher::text_style_event : unsigned int |
CRhinoEventWatcher::CRhinoEventWatcher | ( | ) |
CRhinoEventWatcher::CRhinoEventWatcher | ( | bool | headlessDocAware, |
bool | headlessAppAware | ||
) |
Description: By default event watchers are not called for headless docs and headless app scenarios. Use this constructor if you want to make your event watcher be called for these headless cases. Note that there is a good chance that your event watcher can be called on a different thread than expected when dealing with "headless"
|
virtual |
|
virtual |
Description: AliasTableEvent() is called whenever the alias table is changed.
Parameters: event - [in] type of event alias_table - [in] alias table alias_index - [in] index of alias If the event is alias_sorted, then alias_index is 0. old_settings - [in] If the event is alias_modified, then the old alias definition is passed here. Otherwise, this parameter is NULL.
|
virtual |
Description: Asks if a layers can be deleted. Parameters: layer_index_list - [in] indices of layers to be deleted. bQuiet - [in] If bQuiet is true, make a decision and set the return value accordingly.
If bQuiet is false and the plug-in cares, the plug-in should do something like the example.
Example:
int CMyEventWatcher::DeleteLayerCheck( CRhinoDoc& doc, ON_SimpleArray<int>& layer_index_list, bool bQuiet) { const int layer_index_count = layer_index_list.Count(); int delete_count = 0; for ( int i = 0; i < layer_index_count; i++ ) { const int layer_index = layer_index_list[i]; if ( MyPlugInUsesLayer(layer_index) ) { const CRhinoLayer& layer = doc.m_layer_table[layer_index]; ON_wString msg; msg.Format(L"My plug-in uses layer %s. Do you really want to delete it?", layer.LayerName()); const int yn = ::RhinoYesNoMessageBox( msg, L"Delete Layer", (1|2|4|8), ///< Yes, Yes to All, No, No to All, MB_ICONEXCLAMATION | MB_DEFBUTTON3); if( 1 == yn ) {
/ yes delete_count++; continue; } if( 2 == yn ) { / yes to all delete_count += (layer_index_count-i); break; } if( 3 == yn ) { / no layer_index_list[i] = -1; continue; } if( 4 == yn ) { / no to all layer_index_list.SetCount(i); break; } } }
if ( 0 == delete_count ) return 0; if ( layer_index_count == delete_count ) return 1; return 2; }
Returns: 0 - Delete no layers 1 - Delete all layers in list 2 - Delete layers in layer_index_list[]
WARNING: Never modify the Rhino document in a DeleteLayerCheck() override. If you need to change the Rhino document or post update messages to controls, then your DeleteLayerCheck() override should record what happened in an efficient way and then make any changes that are required in a CRhinoIsIdle.Notify() override.
|
virtual |
/ Description: / DimStyleTableEvent() is called whenever the dimstyle table is changed. / / Parameters: / event - [in] type of event / dimstyle_table - [in] dimstyle table / dimstyle_index - [in] index of dimstyle / If the event is dimstyle_sorted, then dimstyle_index is 0. / old_settings - [in] If the event is dimstyle_modified, / then the old dimstyle definition is passed here. / Otherwise, this parameter is NULL. / WARNING: Never modify the Rhino document in a DimStyleTableEvent() override. If you need to change the Rhino document or post update messages to controls, then your DimStyleTableEvent() override should record what happened in an efficient way and then make any changes that are required in a CRhinoIsIdle.Notify() override.
void CRhinoEventWatcher::Enable | ( | BOOL32 | b = TRUE | ) |
Description: You will only be notified if your event watcher is reistered and enabled. You must explicitly register and then enable your even watcher.
Parameters: b - [in] TRUE enables the event watcher and FALSE disables the event watcher.
Returns: TRUE if the event manager is registered and enabled.
Remarks: Enable() is fast and efficient. Use it when you need to repeatedly enable/disable your event watcher. Call UnRegister() when you are done watching events. See Also: CRhinoEventWatcher::Register();
|
virtual |
OBSOLETE - NEVER USE THIS.
|
virtual |
/ Description: / GroupTableEvent() is called whenever the group table is changed. / / Parameters: / event - [in] type of event / group_table - [in] group table / group_index - [in] index of group / If the event is group_sorted, then group_index is 0. / old_settings - [in] If the event is group_modified, / then the old group definition is passed here. / Otherwise, this parameter is NULL. / WARNING: Never modify the Rhino document in a GroupTableEvent() override. If you need to change the Rhino document or post update messages to controls, then your GroupTableEvent() override should record what happened in an efficient way and then make any changes that are required in a CRhinoIsIdle.Notify() override.
|
virtual |
/ Description: / HatchPatternTableEvent() is called whenever the hatchpattern table is changed. / / Parameters: / event - [in] type of event / hatchpattern_table - [in] hatch pattern table / hatchpattern_index - [in] index of hatchpattern / If the event is hatchpattern_sorted, then hatchpattern_index is 0. / old_settings - [in] If the event is hatchpattern_modified, / then the old hatchpattern definition is passed here. / Otherwise, this parameter is NULL. / WARNING: Never modify the Rhino document in a HatchPatternTableEvent() override. If you need to change the Rhino document or post update messages to controls, then your HatchPatternTableEvent() override should record what happened in an efficient way and then make any changes that are required in a CRhinoIsIdle.Notify() override.
|
virtual |
/ Description: / InstanceDefinitionTableEvent() is called whenever the idef table is changed. / / Parameters: / event - [in] type of event / idef_table - [in] instance definition table / idef_index - [in] index of idef / If the event is idef_sorted, then idef_index is 0. / old_settings - [in] If the event is idef_modified, / then the old idef definition is / passed here. Otherwise, this parameter is NULL. / WARNING: Never modify the Rhino document in a InstanceDefinitionTableEvent() override. If you need to change the Rhino document or post update messages to controls, then your InstanceDefinitionTableEvent() override should record what happened in an efficient way and then make any changes that are required in a CRhinoIsIdle.Notify() override.
bool CRhinoEventWatcher::IsEnabled | ( | ) | const |
Description: You will only be notified if your event watcher is reistered and enabled. You must explicitly register and then enable your even watcher.
Returns: TRUE if the event manager is registered and enabled.
See Also: CRhinoEventWatcher::Register();
bool CRhinoEventWatcher::IsHeadlessAppAware | ( | ) | const |
bool CRhinoEventWatcher::IsHeadlessDocAware | ( | ) | const |
|
virtual |
/ Description: / LayerTableEvent() is called whenever the layer table is changed. / / Parameters: / event - [in] type of event / layer_table - [in] layer table / layer_index - [in] index of layer / If the event is layer_sorted, then layer_index is 0. / old_settings - [in] If the event is layer_modified, / then the old layer definition is / passed here. Otherwise, this parameter is NULL. / WARNING: Never modify the Rhino document in a LayerTableEvent() override. If you need to change the Rhino document or post update messages to controls, then your LayerTableEvent() override should record what happened in an efficient way and then make any changes that are required in a CRhinoIsIdle.Notify() override.
|
virtual |
/ 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 in CRhRdkLightManagerSupport.
|
virtual |
/ Description: / LinetypeTableEvent() is called whenever the linetype table is changed. / / Parameters: / event - [in] type of event / linetype_table - [in] linetype table / linetype_index - [in] index of linetype / If the event is linetype_sorted, then linetype_index is 0. / old_settings - [in] If the event is linetype_modified, / then the old linetype definition is / passed here. Otherwise, this parameter is NULL. / WARNING: Never modify the Rhino document in a LinetypeTableEvent() override. If you need to change the Rhino document or post update messages to controls, then your LinetypeTableEvent() override should record what happened in an efficient way and then make any changes that are required in a CRhinoIsIdle.Notify() override.
|
virtual |
/ Description: / MaterialTableEvent() is called whenever the material table is changed. / / Parameters: / event - [in] type of event / material_table - [in] material table / material_index - [in] index of material / If the event is material_sorted, then material_index is 0. / old_settings - [in] If the event is material_modified, / then the old material definition is / passed here. Otherwise, this parameter is NULL. / WARNING: Never modify the Rhino document in a MaterialTableEvent() override. If you need to change the Rhino document or post update messages to controls, then your MaterialTableEvent() override should record what happened in an efficient way and then make any changes that are required in a CRhinoIsIdle.Notify() override.
|
virtual |
Description: Called when the active document changes. Parameters: doc - [in] The new current document or null if no documents are currently open.
|
virtual |
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 in CRhRdkLightManagerSupport.
|
virtual |
Description: Called after a value in CRhinoApp::AppSettings() changes. WARNING: Never modify the Rhino document in a OnAppSettingsChanged() override. If you need to change the Rhino document or post update messages to controls, then your OnAppSettingsChanged() override should record what happened in an efficient way and then make any changes that are required in a CRhinoIsIdle.Notify() override.
|
virtual |
/ Description: / Called just before command.RunCommand(). WARNING: Never modify the Rhino document in a OnBeginCommand() override. If you need to change the Rhino document or post update messages to controls, then your OnBeginCommand() override should record what happened in an efficient way and then make any changes that are required in a CRhinoIsIdle.Notify() override.
|
virtual |
WARNING: Never modify the Rhino document in an OnBeginOpenDocument() override. If you need to change the Rhino document or post update messages to controls, then your OnBeginOpenDocument() override should record what happened in an efficient way and then make any changes that are required in a CRhinoIsIdle.Notify() override.
|
virtual |
WARNING: Never modify the Rhino document in an OnBeginSaveDocument() override. If you need to change the Rhino document or post update messages to controls, then your OnBeginSaveDocument() override should record what happened in an efficient way and then make any changes that are required in a CRhinoIsIdle.Notify() override.
|
virtual |
Document events WARNING: Never modify the Rhino document in an OnCloseDocument() override. If you need to change the Rhino document or post update messages to controls, then your OnCloseDocument() override should record what happened in an efficient way and then make any changes that are required in a CRhinoIsIdle.Notify() override.
|
virtual |
/ Description: / Called when Rhino stops. / / Parameters: / app - [in] instance of Rhino begin closed. WARNING: Never modify the Rhino document in an OnCloseRhino() override. If you need to change the Rhino document or post update messages to controls, then your OnCloseRhino() override should record what happened in an efficient way and then make any changes that are required in a CRhinoIsIdle.Notify() override.
|
virtual |
View events WARNING: Never modify the Rhino document in a view event override. If you need to change the Rhino document or post update messages to controls, then your view event override should record what happened in an efficient way and then make any changes that are required in a CRhinoIsIdle.Notify() override.
|
virtual |
/ 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 in CRhRdkLightManagerSupport.
|
virtual |
/ Description: / Called if a all objects are begin deselected. / / Parameters: / doc - [in] object's document / count - [in] number of object's that were deselected. WARNING: Never modify the Rhino document in a OnDeselectAllObjects() override. If you need to change the Rhino document or post update messages to controls, then your OnDeselectAllObjects() override should record what happened in an efficient way and then make any changes that are required in a CRhinoIsIdle.Notify() override.
|
virtual |
/ Description: / Called if an object is being deselected. / / Parameters: / doc - [in] object's document / object - [in] object that was deselected. / / Remarks: / If all objects are being deselected, then / a single notification is sent to / OnDeselectAllObjects. WARNING: Never modify the Rhino document in a OnDeselectObject() override. If you need to change the Rhino document or post update messages to controls, then your OnDeselectObject() override should record what happened in an efficient way and then make any changes that are required in a CRhinoIsIdle.Notify() override.
|
virtual |
/ Description: / Called when a collection of objects is deselected. / / Parameters: / doc - [in] object's document / objects - [in] object that were deselected WARNING: Never modify the Rhino document in a OnDeselectObjects() override. If you need to change the Rhino document or post update messages to controls, then your OnDeselectObjects() override should record what happened in an efficient way and then make any changes that are required in a CRhinoIsIdle.Notify() override.
|
virtual |
|
virtual |
WARNING: Never modify the Rhino document in an OnDocumentPropertiesChanged() override. If you need to change the Rhino document or post update messages to controls, then your OnDocumentPropertiesChanged() override should record what happened in an efficient way and then make any changes that are required in a CRhinoIsIdle.Notify() override.
|
virtual |
Description: Called when this event watcher is enabled/disabled.
Parameters: b - [in] TRUE means event watcher is being enabled.
Remarks: For advanced users.
|
virtual |
/ Description: / Called immediately after command.RunCommand(). WARNING: Never modify the Rhino document in a OnEndCommand() override. If you need to change the Rhino document or post update messages to controls, then your OnEndCommand() override should record what happened in an efficient way and then make any changes that are required in a CRhinoIsIdle.Notify() override.
|
virtual |
WARNING: Never modify the Rhino document in an OnEndOpenDocument() override. If you need to change the Rhino document or post update messages to controls, then your OnEndOpenDocument() override should record what happened in an efficient way and then make any changes that are required in a CRhinoIsIdle.Notify() override.
|
virtual |
WARNING: Never modify the Rhino document in an OnEndSaveDocument() override. If you need to change the Rhino document or post update messages to controls, then your OnEndSaveDocument() override should record what happened in an efficient way and then make any changes that are required in a CRhinoIsIdle.Notify() override.
|
virtual |
Application events / Description: / Called when Rhino starts. / / Parameters: / app - [in] instance of Rhino begin started. WARNING: Never modify the Rhino document in an OnInitRhino() override. If you need to change the Rhino document or post update messages to controls, then your OnInitRhino() override should record what happened in an efficient way and then make any changes that are required in a CRhinoIsIdle.Notify() override.
|
virtual |
/ 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 in CRhRdkLightManagerSupport.
|
virtual |
WARNING: Never modify the Rhino document in an OnNewDocument() override. If you need to change the Rhino document or post update messages to controls, then your OnNewDocument() override should record what happened in an efficient way and then make any changes that are required in a CRhinoIsIdle.Notify() override.
|
virtual |
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 in CRhRdkLightManagerSupport.
|
virtual |
/ Description: / Called if an object is begin purged from a document. / The object will cease to exist forever. / / Parameters: / doc - [in] object's document / object - [in] object to be purged. WARNING: Never modify the Rhino document in a OnPurgeObject() override. If you need to change the Rhino document or post update messages to controls, then your OnPurgeObject() override should record what happened in an efficient way and then make any changes that are required in a CRhinoIsIdle.Notify() override.
|
virtual |
|
virtual |
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 in CRhRdkLightManagerSupport.
|
virtual |
/ Description: / Called if an object is being selected. / Note, the seletion of grip objects will not trigger this event. / Grips selection is ignored, as these objects are transient and / are often deleted shortly after selection and deselection. / If you must be notified when grip objects are selected, use the / CRhinoOnChangeObjectSelectState class. / / Parameters: / doc - [in] object's document / object - [in] object to be purged. WARNING: Never modify the Rhino document in a OnSelectObject() override. If you need to change the Rhino document or post update messages to controls, then your OnSelectObject() override should record what happened in an efficient way and then make any changes that are required in a CRhinoIsIdle.Notify() override.
|
virtual |
/ Description: / Called when a collection of objects is selected. / Note, the seletion of grip objects will not trigger this event. / Grips selection is ignored, as these objects are transient and / are often deleted shortly after selection and deselection. / If you must be notified when grip objects are selected, use the / CRhinoOnChangeObjectSelectState class. / / Parameters: / doc - [in] object's document / objects - [in] objects that were selected WARNING: Never modify the Rhino document in a OnSelectObjects() override. If you need to change the Rhino document or post update messages to controls, then your OnSelectObjects() override should record what happened in an efficient way and then make any changes that are required in a CRhinoIsIdle.Notify() override.
|
virtual |
|
virtual |
/ 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 in CRhRdkLightManagerSupport.
|
virtual |
Description: Called when a change in the model units results in a scaling operation on all of the objects in the document. This call is made before any of the objects are scaled. A call to OnDocumentPropertiesChanged follows.
|
virtual |
Description: Called if the object's render mesh or analysis mesh is updated. Parameters: doc - [in] object's document object - [in] object whose mesh was updated. The new mesh is attached to the object. mesh_type - [in] type of mesh (ON::render_mesh or ON::analysis_mesh)
WARNING: Never modify the Rhino document in a OnUpdateObjectMesh() override. If you need to change the Rhino document or post update messages to controls, then your OnUpdateObjectMesh() override should record what happened in an efficient way and then make any changes that are required in a CRhinoIsIdle.Notify() override.
void CRhinoEventWatcher::Register | ( | ) |
Description: Adds event watcher to Rhino.
Example: class CMyEventWatcher : public CRhinoEventWatcher { ... } ... CMyEventWatcher* pEyes = new CMyEventWatcher(); ... pEyes->Register();
pEyes->Enable(TRUE); ... pEyes->Enable(FALSE); ... pEyes->Enable(TRUE); ... pEyes->Enable(FALSE); ...
pEyes->UnRegister();
Returns: TRUE if registration succeeds.
Remarks: Registration is computationally expensive and should be done sparingly. Enable is fast and can be used to quickly enable/disable an event watcher.
unsigned int CRhinoEventWatcher::SerialNumber | ( | ) | const |
Description: Each instance of a CRhinoEventWatcher gets a unique runtime serial number to prevent multiple registrations.
|
virtual |
/ Description: / TextureMappingTableEvent() is called whenever the texture_mapping table is changed. / / Parameters: / event - [in] type of event / texture_mapping_table - [in] texture_mapping table / texture_mapping_index - [in] index of texture_mapping / If the event is texture_mapping_sorted, then texture_mapping_index is 0. / old_settings - [in] If the event is texture_mapping_modified, / then the old texture_mapping definition is / passed here. Otherwise, this parameter is NULL. / WARNING: Never modify the Rhino document in a TextureMappingTableEvent() override. If you need to change the Rhino document or post update messages to controls, then your TextureMappingTableEvent() override should record what happened in an efficient way and then make any changes that are required in a CRhinoIsIdle.Notify() override.
|
virtual |
Description: Used to monitor Rhino's built in undo/redo support.
Parameters: undo_event - [in] Reports what is happening: undo_record_serialnumber - [in] Runtime serial number of the undo event cmd - [in] (can be NULL) If not NULL, this is the command whose activity is being recorded for possible undo. Remarks: "86" is restaurant slang for "nix" http://www.restaurantreport.com/qa/86d.html
WARNING: Never modify the Rhino document in a UndoEvent() override. If you need to change the Rhino document or post update messages to controls, then your UndoEvent() override should record what happened in an efficient way and then make any changes that are required in a CRhinoIsIdle.Notify() override.
void CRhinoEventWatcher::UnRegister | ( | ) |
Description: Removes event watcher from Rhino.
Remarks: Registration is computationally expensive and should be done sparingly. Enable is fast and can be used to quickly enable/disable an event watcher.
See Also: CRhinoEventWatcher::Register();