cee::ug::DataPartDisplacement Class Reference

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...
 
- Public Member Functions inherited from cee::RefCountedObject
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...
 
Inheritance diagram for cee::ug::DataPartDisplacement:
cee::RefCountedObject

Detailed Description

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.

Note
The class is reference counted and can be shared between multiple results. Remember that since this object is reference counted it should never be created on the stack.

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.

Note
The values are the absolute node positions, not just the relative offset to the undisplaced node position.
Example

Example of how to add a displacement result to a geometry consisting of only one triangle.

Create the DataResultDisplacement object with a unique id.

int dispResultId = 1;

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.

dispPart->resize(3);
dispPart->setValue(0, cee::Vec3d(1.0, 0.0, 0.0));
dispPart->setValue(1, cee::Vec3d(0.0, 0.0, 0.0));
dispPart->setValue(2, cee::Vec3d(0.0, 1.0, 0.0));

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.

dispResult->addPart(dispPart.get());

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

state->results(geo.get())->addDisplacement(dispResult.get());

See the complete source code at: UnstructGrid: A simple model with results

See also
DataPart
DataResultDisplacement
Tutorials
UnstructGrid: A simple model with results

Constructor & Destructor Documentation

cee::ug::DataPartDisplacement::DataPartDisplacement ( )

Constructs an empty object.

Member Function Documentation

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.

Note
The value is the absolute node position, not a relative value to the undisplaced node position
Warning
The specified index must be a valid index. Either call one of the setValues() methods or call resize() prior to calling this method.
See also
resize()
void cee::ug::DataPartDisplacement::setValues ( const std::vector< Vec3d > &  values)

Sets the absolute node positions for the displaced nodes.

Note
The values are the absolute node positions, not relative values to the undisplaced node positions
void cee::ug::DataPartDisplacement::setValues ( const double  values[],
size_t  vectorCount 
)

Sets the absolute node positions for the displaced nodes.

Note
The values are the absolute node positions, not relative values to the undisplaced node positions
See also
resize()
void cee::ug::DataPartDisplacement::setValuesFloat ( const float  values[],
size_t  vectorCount 
)

Sets the absolute node positions for the displaced nodes.

Note
The values are the absolute node positions, not relative values to the undisplaced node positions
That this is only provided for convenience, and that the nodes will internally be stored as doubles
See also
resize()
cee::Vec3d cee::ug::DataPartDisplacement::value ( size_t  index) const

Returns the absolute node position for the node an the given index.

Note
The value is the absolute node position, not a relative value to the undisplaced node position