Ceetron Data Provider Framework
|
Public Member Functions | |
virtual bool | init (const CDPString &modelKey, const CDPInitOptions &initOptions)=0 |
virtual void | close ()=0 |
virtual bool | getMetaData (CDPMetaData *metaData)=0 |
virtual bool | getGeometry (const CDPGeometrySpec &spec, CDPGeometry *geometry)=0 |
virtual bool | getSet (cdp_int_t setId, CDPSet *set)=0 |
virtual bool | getResult (const CDPResultSpec &spec, CDPResult *result)=0 |
virtual bool | getRigidBodyTransformations (cdp_size_t geometryIndex, cdp_int_t stateId, CDPTransformations *transformations)=0 |
virtual bool | getElementVisibilityResult (cdp_size_t geometryIndex, cdp_int_t stateId, CDPVisibilityResult *result)=0 |
virtual void | pollForChanges (CDPChangeNotifications *changeNotifications)=0 |
CDPDataProvider is the base class for data providers that can be used in both desktop and cloud products from Ceetron.
A data provider acts as a data source for a Ceetron cloud/desktop based host application. It allows for reading or otherwise providing data in an unified way. The host application does not need any special handling per data provider (or other built-in readers).
In addition to providing data for visualization, the data provider also supports communicating updated data to the host application. This is done via the pollForChanges() method and any change is communicated back to the host application via the CDPChangeNotifications interface.
|
pure virtual |
This method is called by the host when the data provider is no longer needed.
Release any resources allocated by this instance
|
pure virtual |
Provide the element visiblity result for the given geometry and state.
Visibility result is a result with a boolean per element per state specifying if the element is visible or not in the given state.
This is useful for analysis that have eroded or deleted elements as a cheap way of supporting remeshing. This is much more efficient that providing a new geometry per state.
|
pure virtual |
Provide the geometry for the given spec (geometry index and state id).
A model can consist of 1 or more geometries per state. If the model is partly adaptive or there are other reason to split the model into multiple geometries then you can have any number of geometries per state.
If the model is remeshed/adaptive, you can provide a different geometry for each state.
The normal case is to have one geometry that is non-adaptive.
There are some restrictions regarding geometries:
The host will only call getGeometry() whenever a new geometry is needed. So in the normal case (non-adaptive, single geometry) this method will only be called once.
|
pure virtual |
Provide the meta data (model/simulation content) for the current model.
The meta data is a description of the contents of the model/simulation. It contains information about the geometry (number of geometries, names and ids of each part), states, results (scalar, vector, tensor, displacement), rigid body results and sets.
|
pure virtual |
Provide the result based on the given spec.
Populate the result with the results corresponding to the given spec. This can be scalar, vector, displacement, stress- and strain tensors results.
The type, id, name and result mapping is specified in the CDPMetaData in the CDPResultInfo object.
|
pure virtual |
Provide the rigid body transformation result for the given geometry and state
Rigid body transformation results are one transformation matrix (4*4) per element group.
|
pure virtual |
Provide the items of the set with the given id.
Populate the provided set with the contents of the given set.
The available sets are specified in CDPMetaData.
|
pure virtual |
Initialize the provider with the given model key and prepare to provide meta data
The first call to the provider after it was created is init(). In this method you should prepare to return meta data and also validate if this is actually a supported model.
init is only called if the corresponding CDPDataProviderFactory responded positive to the CDPDataProviderFactory::isSupportedByProvider() call.
The initOptions contains the user defined options for this provider. You should at least support the options that are published in the CDPDataProviderInfo delivered from your factory.
|
pure virtual |
Allows the provider to communicate changes/updates to the host.
If polling is enable in the host application, this method will be called at regular intervals to allow the data provider to communicate any changes to the host. Any changes to what the data provider can deliver is communicated back to the host application via the CDPChangeNotifications interface. This interface allows for update of result and geometry and for addition or deletion of states and results.
The change notifications will be handled by the host app, 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).
There is one limitation to the updates that can happen. The setup of the geometry (number of geometries and the resulting number of parts per geometry) must be constant. However, the contents of the geometry might change, so the number of elements or number of nodes can change.