Rhino C++ API  7.26
Public Member Functions | Protected Member Functions | List of all members
IRhinoUiDataSource Class Referenceabstract

#include <RhRdkDataSource.h>

Inheritance diagram for IRhinoUiDataSource:
CRhRdkDataSource CRhRdkSimpleSunDataSource

Public Member Functions

virtual void AddHost (IRhinoUiDataSourceHost &h)=0
 
virtual void Commit (const UUID &uuidData, IRhinoUiEventInfo *pInfo=nullptr)=0
 
virtual void DeleteThis (void)=0
 
virtual void Discard (const UUID &uuidData)=0
 
virtual void * EVF (const wchar_t *wszFunc, void *pvData)=0
 
virtual void * GetData (const UUID &uuidData, bool bForWrite, bool bAutoChangeBracket=true) const =0
 
virtual void RegisterEventWatcher (IRhinoUiDataSourceEventWatcher &ew)=0
 
virtual void RemoveHost (IRhinoUiDataSourceHost &h)=0
 
virtual bool ResetToDefaults (void)=0
 
virtual bool SetChanged (void)=0
 
virtual void UnregisterEventWatcher (IRhinoUiDataSourceEventWatcher &ew)=0
 

Protected Member Functions

virtual ~IRhinoUiDataSource ()
 

Detailed Description

Data source for user interfaces. A UI can have any number of data sources.

Constructor & Destructor Documentation

◆ ~IRhinoUiDataSource()

virtual IRhinoUiDataSource::~IRhinoUiDataSource ( )
inlineprotectedvirtual

Member Function Documentation

◆ AddHost()

virtual void IRhinoUiDataSource::AddHost ( IRhinoUiDataSourceHost h)
pure virtual

Called when the data source is added to a data source host.

Implemented in CRhRdkDataSource.

◆ Commit()

virtual void IRhinoUiDataSource::Commit ( const UUID &  uuidData,
IRhinoUiEventInfo pInfo = nullptr 
)
pure virtual

Commit changes made using GetData() with bForWrite=true.

Parameters
uuidDatais the identifier of the data.
pInfois a pointer to optional info to be sent with any event that is raised. Events will be sent for any data objects that have had data committed. Every call to GetData() with bForWrite=true must be matched by a call to either Commit() or Discard(). This method should not be called if the operation is cancelled. Instead you should call Discard().
See also
GetData()
Discard()

Implemented in CRhRdkSimpleSunDataSource, and CRhRdkDataSource.

◆ DeleteThis()

virtual void IRhinoUiDataSource::DeleteThis ( void  )
pure virtual

You must implement this method as

delete this;

Implemented in CRhRdkDataSource.

◆ Discard()

virtual void IRhinoUiDataSource::Discard ( const UUID &  uuidData)
pure virtual

Discard changes made using GetData() with bForWrite=true.

Parameters
uuidDatais the identifier of the data. Every call to GetData() with bForWrite=true must be matched by a call to either Commit() or Discard(). This method should only be called if the operation is cancelled. Otherwise you should call Commit().
See also
GetData()
Commit()

Implemented in CRhRdkDataSource, and CRhRdkSimpleSunDataSource.

◆ EVF()

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

Emergency virtual function for future expansion.

Implemented in CRhRdkDataSource.

◆ GetData()

virtual void* IRhinoUiDataSource::GetData ( const UUID &  uuidData,
bool  bForWrite,
bool  bAutoChangeBracket = true 
) const
pure virtual

Get data specified by a unique id.

Parameters
uuidDatais the identifier of the data. UUIDs defined by Rhino are specified above.
bForWritespecifies if you intend to write to the data.
See also
Commit()
Discard.
Parameters
bAutoChangeBracketis if you want BeginChange() and EndChange() to be called automatically when the data is contents.
Returns
a pointer which can be cast to the type for the identifier as documented above. Note that this method will return null if the requested data type cannot be provided.

Implemented in CRhRdkSimpleSunDataSource.

◆ RegisterEventWatcher()

virtual void IRhinoUiDataSource::RegisterEventWatcher ( IRhinoUiDataSourceEventWatcher ew)
pure virtual

Add a data source host which would like to be notified of events that affect its data. When such an event arrives, the data source checks if the host is interested in the event and if so, it calls the host's OnEvent() method.

Implemented in CRhRdkDataSource.

◆ RemoveHost()

virtual void IRhinoUiDataSource::RemoveHost ( IRhinoUiDataSourceHost h)
pure virtual

Called by a data source host when it is being deleted.

Implemented in CRhRdkDataSource.

◆ ResetToDefaults()

virtual bool IRhinoUiDataSource::ResetToDefaults ( void  )
pure virtual

Implement this method to reset all data to defaults, if possible.

Returns
true if successful, else false.

Implemented in CRhRdkSimpleSunDataSource, and CRhRdkDataSource.

◆ SetChanged()

virtual bool IRhinoUiDataSource::SetChanged ( void  )
pure virtual

Set the data source as changed. This must be called in between GetData() with bForWrite == true and Commit() in order for the commit to succeed and an event to be sent. If it is called when the data source is not in write mode, the call will fail.

Returns
true if successful, else false.

Implemented in CRhRdkDataSource.

◆ UnregisterEventWatcher()

virtual void IRhinoUiDataSource::UnregisterEventWatcher ( IRhinoUiDataSourceEventWatcher ew)
pure virtual

Remove a data source host which has been added by RegisterEventWatcher(). This must be done when such a host is deleted.

Implemented in CRhRdkDataSource.