CDPChangeNotifications

Functions

~CDPChangeNotifications

void

notifyResultChanged

CDPResultInfo *

notifyResultAdded

void

notifyResultDeleted

void

notifyRigidBodyTransformationsChanged

void

notifyStateMetaDataChanged

CDPStateInfo *

notifyStateAdded

void

notifyStateDeleted

void

notifyGeometryChanged

void

notifyTriggerNewGetMetaData

Detailed Description

class CDPChangeNotifications

In addition to providing data for visualization, the data provider framework also allows the data provider to communicate updated data to the host.

The CDPChangeNotifications interface is used to communicate any change in the data provided by the data provider back to the host application. The host application will then process the change notification, and any new data needed by the app will trigger subsequent calls to the data provider (e.g. a getResults() call if notifyResultChanged was used).

Public Functions

inline virtual ~CDPChangeNotifications()
virtual void notifyResultChanged(cdp_int_t resultId) = 0

Notifies the host application that a result has changed.

This notification will flag the specified result as stale in the host application and will trigger a getResult() call if the result is used by the current visualization.

virtual CDPResultInfo *notifyResultAdded(CDPResultType resultType, cdp_int_t resultId, const CDPString &name, CDPResultMappingType mapping) = 0

Notifies the host application that a result has been added to the list of results available from the data provider.

This will update the ModelDirectory/DataSourceDirectory in the host app. It is up to the host application to decide what to do with the new result.

virtual void notifyResultDeleted(cdp_int_t resultId) = 0

Notifies the host application that a result has been deleted and is thus no longer available.

This will update the ModelDirectory/DataSourceDirectory in the host app. If the result is in use it will be removed from the ModelSpec or feature extraction item.

virtual void notifyRigidBodyTransformationsChanged() = 0

Notifies the host application that the rigid body transformations have changed.

This notification will flag the rigid body transformations as stale in the host application and will trigger a getRigidBodyTransformations() call if the transformations are used by the current visualization.

Since

3.0

virtual void notifyStateMetaDataChanged(cdp_int_t stateId, const CDPString &name, cdp_double_t referenceValue) = 0

Notifies the host application that the meta data for the given state has changed.

This will update the ModelDirectory/DataSourceDirectory in the host app, and if the state is in use the display of the state name and reference value will be updated in the view.

This notification is useful if you are using a single state to monitor a simulation of a digital twin, and would like to update the single state with the right meta data.

virtual CDPStateInfo *notifyStateAdded(cdp_int_t stateId, const CDPString &name, cdp_double_t referenceValue) = 0

Notifies the host application that a state has been added to the list of available states from the data provider.

This will update the ModelDirectory/DataSourceDirectory in the host application, and it is up to the host application to decide if this new state should be shown or not.

virtual void notifyStateDeleted(cdp_int_t stateId) = 0

Notifies the host application that a state has been deleted and is thus no longer available.

This will update the ModelDirectory/DataSourceDirectory in the host application. If the state is currently being visualized, the ModelSpec will be updated and an existing state will be selected.

virtual void notifyGeometryChanged(cdp_size_t geometryIndex) = 0

Notifies the host application that a geometry has been changed.

Use this notification if the number of nodes or elements has changed in the geometry. The geometry will be flagged as stale in the host application, and if it is in use in the current visualization the app will trigger a getGeometry() call to update the visualization with the new geometry.

This notification will also mark any results currently in use by the geometry as stale, and will trigger a getResult() call if the result is in use by the current visualization.

Note

There is one limitation to updating the geometry: The meta data of the geometry cannot change, which means that the number of resulting parts needs to be constant. But number of nodes, number of elements, element types, etc. can change.

virtual void notifyTriggerNewGetMetaData() = 0

Notifies the host application that the meta data is stale and it needs to call CDPDataProvider::getMetaData() again.

If the meta data for the geometry has changed (a geometry was added, the number of part changed, etc) you must use this notification. This will trigger a new call to CDPDataProvider::getMetaData(). If the change is only number of nodes, number of elements, element types, etc. use the notifyGeometryChanged() method.