Displacement results for a part. More...
Public Member Functions | |
DataPartDisplacement () | |
Constructs an empty object. More... | |
size_t | count () const |
Returns number of displaced nodes in this DataPartDisplacement. More... | |
Vec3d | value (size_t index) const |
Returns the absolute node position for the node an the given index. More... | |
const double * | rawValuePointer () const |
Returns a raw pointer to the absolute node positions. More... | |
double * | rawValuePointer () |
Returns a modifiable raw pointer to the absolute node positions. More... | |
void | resize (size_t count) |
Sets the number of values in the object. More... | |
void | setValue (size_t index, const Vec3d &value) |
Sets the absolute node position for the displaced node. More... | |
void | setValues (const std::vector< Vec3d > &values) |
Sets the absolute node positions for the displaced nodes. More... | |
void | setValues (const double values[], size_t vectorCount) |
Sets the absolute node positions for the displaced nodes. More... | |
void | setValuesFloat (const float values[], size_t vectorCount) |
Sets the absolute node positions for the displaced nodes. 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... | |
Displacement results for a part.
A displacement result value is a three dimensional vector giving a magnitude and a direction for the displacement of a node. DataPartDisplacement contains an array of vectors specifying the displacements for all nodes in a part.
A DataPartDisplacement contains the result values corresponding to a DataPart. This means that the number of result values in each displacement part must match the number of nodes in the corresponding part. DataPartDisplacement is a child of a DataResultDisplacement in the same way as a DataPart is a child of a DataGeometry. The DataResultDisplacement must have the same number of child parts as the DataGeometry.
Values are inserted using setValue(), setValues() or setValuesFloat(). Get the number of values with count() and query a specific value using value() with an index.
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 coordinate in the triangle. Remember that the array must be resized before inserting the results.
Number of parts in the DataResultDisplacement must match number of parts in the geometry. Displacement values must also fit the corresponding part in the geometry. Here the part is a single triangle with three nodes, hence a results array with three vectors will fit.
Add the displacement part to the result displacement.
For each geometry in a state there is a result group binding the geometry and results.
Add the result displacement to the state (DataState) for the corresponding geometry (DataGeometry) geo
See the complete source code at: UnstructGrid: A simple model with results
cee::ug::DataPartDisplacement::DataPartDisplacement | ( | ) |
Constructs an empty object.
size_t cee::ug::DataPartDisplacement::count | ( | ) | const |
Returns number of displaced nodes in this DataPartDisplacement.
const double * cee::ug::DataPartDisplacement::rawValuePointer | ( | ) | const |
Returns a raw pointer to the absolute node positions.
double * cee::ug::DataPartDisplacement::rawValuePointer | ( | ) |
Returns a modifiable raw pointer to the absolute node positions.
void cee::ug::DataPartDisplacement::resize | ( | size_t | count | ) |
Sets the number of values in the object.
The current values in the object will be kept up to the given count (if shrinking).
void cee::ug::DataPartDisplacement::setValue | ( | size_t | index, |
const Vec3d & | value | ||
) |
Sets the absolute node position for the displaced node.
void cee::ug::DataPartDisplacement::setValues | ( | const std::vector< Vec3d > & | values | ) |
Sets the absolute node positions for the displaced nodes.
void cee::ug::DataPartDisplacement::setValues | ( | const double | values[], |
size_t | vectorCount | ||
) |
Sets the absolute node positions for the displaced nodes.
void cee::ug::DataPartDisplacement::setValuesFloat | ( | const float | values[], |
size_t | vectorCount | ||
) |
Sets the absolute node positions for the displaced nodes.
cee::Vec3d cee::ug::DataPartDisplacement::value | ( | size_t | index | ) | const |
Returns the absolute node position for the node an the given index.