Displacements results for all parts in the geometry. More...
Public Member Functions | |
DataResultDisplacement (int resultId) | |
Constructs an empty object. A unique id are set upon construction. More... | |
int | resultId () const |
Returns the result id. More... | |
size_t | partCount () const |
Returns number of displacement parts in this displacement result. More... | |
const DataPartDisplacement * | part (size_t partIndex) const |
Returns the part at the given index. More... | |
DataPartDisplacement * | part (size_t partIndex) |
Returns the part at the given index. More... | |
void | addPart (DataPartDisplacement *part) |
Adds a displacement part to the displacement scalar. More... | |
void | removeAllParts () |
Removes all scalar parts. More... | |
bool | deriveScalar (DeriveOperation deriveOperation, DataResultScalar *derivedScalar, const DataGeometry *geometry) const |
Gets a derived scalar. More... | |
bool | deriveVector (DeriveOperation deriveOperation, DataResultVector *derivedVector, const DataGeometry *geometry) const |
Gets a derived vector. More... | |
![]() | |
void | addRef () const |
Increments the reference count for this object. More... | |
void | release () const |
Decrements the reference count for this object. More... | |
int | refCount () const |
Returns the reference count for this object. More... | |
void | setRefCountZero () const |
Sets the ref count to zero, but DOES NOT delete the object. More... | |
Displacements results for all parts in the geometry.
The DataResultDisplacement holds a collection of DataPartDisplacement objects, each containing an array of displacement values for the belonging part.
Each DataResultDisplacement has a unique id. The number of parts in the displacement result and in the geometry must be the same. And the number of result values in each displacement part must match the number of nodes/elements in the part. Displacement results are always node based.
The id is set upon construction of the object and cannot be changed afterwards. The existing id can be found by calling resultId().
DataPartDisplacement objects can be added using addPart(). Get the number of parts in the displacement with partCount() and accessed individual parts by calling part() with the requested index. All parts can be removed using removeAllParts().
Set which displacement result to show using UnstructGridModel::modelSpec().
To configure the setting for a displacement result, use DisplacementSettings.
Get the displacement settings by calling UnstructGridModel::displacementSettings() with the requested result id.
Example of how to add a displacement result to a geometry consisting of only one triangle.
Create the DataResultDisplacement object with a unique id.
The result array must have one value for each node in the triangle. Resize the array before inserting the results.
Add the displacement part to the displacement result. The displacement result must contain the same number of parts as the corresponding geometry.
For each geometry there is a result group binding the geometry and results. Add the displacement result to the state's result group for the corresponding geometry (DataGeometry) geo
The result is now created and added to the model. To tell the model to use this result, you must set the current scalar result in the model's model specification.
To visualize the displacement result, you have to toggle the visibility of displacements in the part settings for each part.
See the complete source code at: UnstructGrid: A simple model with results
cee::ug::DataResultDisplacement::DataResultDisplacement | ( | int | resultId | ) |
Constructs an empty object. A unique id are set upon construction.
void cee::ug::DataResultDisplacement::addPart | ( | DataPartDisplacement * | part | ) |
Adds a displacement part to the displacement scalar.
Number of parts must match the number of parts in the corresponding geometry.
bool cee::ug::DataResultDisplacement::deriveScalar | ( | DeriveOperation | deriveOperation, |
DataResultScalar * | derivedScalar, | ||
const DataGeometry * | geometry | ||
) | const |
Gets a derived scalar.
bool cee::ug::DataResultDisplacement::deriveVector | ( | DeriveOperation | deriveOperation, |
DataResultVector * | derivedVector, | ||
const DataGeometry * | geometry | ||
) | const |
Gets a derived vector.
const DataPartDisplacement * cee::ug::DataResultDisplacement::part | ( | size_t | partIndex | ) | const |
Returns the part at the given index.
DataPartDisplacement * cee::ug::DataResultDisplacement::part | ( | size_t | partIndex | ) |
Returns the part at the given index.
size_t cee::ug::DataResultDisplacement::partCount | ( | ) | const |
Returns number of displacement parts in this displacement result.
void cee::ug::DataResultDisplacement::removeAllParts | ( | ) |
Removes all scalar parts.
int cee::ug::DataResultDisplacement::resultId | ( | ) | const |
Returns the result id.