# cee::ug::DataResultTransformation

class `DataResultTransformation` : public RefCountedObject

  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()).

      ugModel->modelSpec().setTransformationResult(true);

  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.

      cee::PtrRef<cee::ug::DataResultTransformation> transformationResult = new cee::ug::DataResultTransformation();

  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

  Tutorials UnstructGrid: A Simple Model with Results

  See also

  ModelSpec, UnstructGridModel, and Mat4d

  Public Functions

  `DataResultTransformation`()

    Constructs an empty transformation object.

    Sets a unique result id.

  size_t `partCount`() const

    Returns number of part matrices in this transformation result.

  Mat4d `part`(size_t partIndex) const

    Returns the part matrix at the given index.

  void `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.

  void `removeAllParts`()

    Removes all transformation part matrices.

Conversation saved
HOOPSY BETA

### Hello! I'm HOOPSY

Your multilingual generative AI assistant for documentation. Ask me anything about HOOPS Envision for Desktop in your own language, or choose a sample question below to start a conversation:

What is HOOPS Envision for Desktop?
What are the latest release notes for HOOPS Envision for Desktop?
How do I start evaluating HOOPS Envision for Desktop?
How do I write my first sample application?
How can I get assistance?

HOOPSY may store conversations according to OpenAI's policy. Responses may not always be accurate.

HOOPSY is thinking...