class DataResultVector : public RefCountedObject
Vector results for all parts in the geometry.
The DataResultVector holds a collection of DataPartVector objects, each containing an array of vector values for the belonging part. The DataResultVector has a result mapping type (per node, per element, per element node or per element surface) which applies to all its vector parts.
Each data result vector has a unique id.
The number of parts in the result vector and in the geometry must be the same. And the result values in each vector part must match the number of nodes/elements in the part (depending on mapping type). For instance, a node mapped result will need the same number of result values in the vector part as there are nodes in the part.
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.
with the requested index.
All parts can be removed usingremoveAllParts().
Set which vector results to show on the model using UnstructGridModel::modelSpec().
cee::ug::VectorSettings* settings = ugModel->vectorSettings(42);
Example of how to add a node based vector result to a geometry consisting of only one triangle.
Create the DataResultVector object with a unique id and node based result mapping.
int vectorResultId = 1; cee::PtrRef<cee::ug::DataResultVector> vectorResult = new cee::ug::DataResultVector(vectorResultId, cee::ug::PER_NODE);
The result array must have one value for each node in the triangle. Resize the array before inserting the results.
cee::PtrRef<cee::ug::DataPartVector> vectorPart = new cee::ug::DataPartVector(); vectorPart->resize(3); vectorPart->setValue(0, cee::Vec3d(1.0, 0.0, 0.0)); vectorPart->setValue(1, cee::Vec3d(1.0, 1.0, 0.0)); vectorPart->setValue(2, cee::Vec3d(0.0, 2.0, 0.0));
Add the vector part to the part result. The part result must contain the same number of parts as the corresponding geometry.
The result is now created and added to the model.
To tell the model to use this result, you must set the current vector result in the model’s model specification.
To visualize the vector result, you have to toggle the visibility of vectors in the part settings for each part.
See the complete source code at: UnstructGrid: A simple model with results
DataResultVector(int resultId, ResultMapping mappingType)
Constructs an empty object.
A unique id and the mapping type are decided upon construction.
int resultId() const
Returns the result id.
size_t partCount() const
Returns number of vector parts in this vector result.
ResultMapping resultMapping() const
Returns the result mapping for this result.
void addPart(DataPartVector *part)
Adds a vector part to the result vector.
Number of parts must match the number of parts in the corresponding geometry.
The added object is reference counted and should never be created on the stack or deleted!
Removes all vector parts.
bool deriveScalar(DeriveOperation deriveOperation, DataResultScalar *derivedScalar) const
Gets a derived scalar.
- DataResultVector(int resultId, ResultMapping mappingType)