cee::ug::DataResultTransformation Class Reference

Transformation results for all parts in the geometry. More...

Public Member Functions

 DataResultTransformation ()
 Constructs an empty transformation object. More...
 
size_t partCount () const
 Returns number of part matrices in this transformation result. More...
 
Mat4d part (size_t partIndex) const
 Returns the part matrix at the given index. More...
 
void addPart (const Mat4d &part)
 Adds a transformation matrix part to the transformation result. More...
 
void removeAllParts ()
 Removes all transformation part matrices. 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::DataResultTransformation:
cee::RefCountedObject

Detailed Description

Transformation results for all parts in the geometry.

The DataResultTransformation holds a collection of matrices, each setting the transformation for the belonging part.

The number of parts in the transformation result and in the geometry must be the same.

Transformation matrices can be added using addPart(). Get the number of part matrices in the transformation result with partCount() and accessed individual part matrices by calling part() with the requested index. All part matrices can be removed using removeAllParts().

Transformation result visualization can be toggled on or off in the model specification (UnstructGridModel::modelSpec()).

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

Example of how to add a node based scalar result to a geometry consisting of only one triangle.

Create the DataResultScalar object with a unique id and node based result mapping.

Create the transformation matrix.

cee::Mat4d partMatrix;
partMatrix(0,3) = 1.0;
partMatrix(1,3) = 1.0;

Add the transformation part to the result. The result must contain the same number of parts as the corresponding geometry.

transformationResult->addPart(partMatrix);

For each geometry there is a result group binding the geometry and results. Add the transformation scalar to the state (DataState) for the corresponding geometry (DataGeometry) geo

state->results(geo.get())->setTransformation(transformationResult.get());

The result is now created and added to the model. To tell the model to use this result, you must toggle transformation usage in the model's model specification.

dataSource->directory()->setTransformationResult(true);

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

See also
ModelSpec
UnstructGridModel
Mat4d
Tutorials
UnstructGrid: A simple model with results

Constructor & Destructor Documentation

cee::ug::DataResultTransformation::DataResultTransformation ( )

Constructs an empty transformation object.

Sets a unique result id.

Member Function Documentation

void cee::ug::DataResultTransformation::addPart ( const Mat4d part)

Adds a transformation matrix part to the transformation result.

Number of parts must match the number of parts in the corresponding geometry.

Mat4d cee::ug::DataResultTransformation::part ( size_t  partIndex) const

Returns the part matrix at the given index.

size_t cee::ug::DataResultTransformation::partCount ( ) const

Returns number of part matrices in this transformation result.

void cee::ug::DataResultTransformation::removeAllParts ( )

Removes all transformation part matrices.