cee::vtfx::TransformationResultBlock

class TransformationResultBlock : public Block

A block defining a rigid body transformation result in a VTFx database.

A VTFx database can contain many transformation result blocks. The transformation result block defines the result meta data and references transformation result values blocks which contain the actual transformation matrices.

The result meta data contains a “result id” which shall not be confused with the block id. The result id must be unique within all transformation results in a database.

For a static dataset, it is sufficient to define transformation result value blocks for one state (using stateId = 1). For adaptive results, the same rule applies as for geometry blocks: a transformation result has to be defined for every state, but it is possible to re-use transformation result values blocks that had been defined for other states.

For further information on states and adaptive results, please see the API documentation and StateInfoBlock.

Public Functions

TransformationResultBlock(int blockId)

Constructs an empty transformation result block.

All transformation result blocks must have a unique id within a database. The name of the result is set to “Transformation result blockId”

~TransformationResultBlock()
Str name() const

Returns the name of the transformation result.

void setName(const Str &resultName)

Sets the name of the result.

int resultId() const

Returns the id of the transformation result.

void setResultId(int resultId)

Sets the result id for the transformation result.

The result id is used when specifying properties for the result.

std::vector<int> transformationResultValuesBlocks(size_t stateIndex) const

Returns an array of transformation result values block ids defined for a state.

stateIndex is the zero-based state index (not to be mixed with state id!)

Returns an empty array if invalid state index was specified.

int transformationResultValuesBlockCount(size_t stateIndex) const

Returns number of transformation result values blocks defined in the state at given state index.

stateIndex is the zero-based index of the state (not to be mixed with state id!)

Returns -1 if an invalid state index was specified.

bool addTransformationResultValuesBlock(int transformationResultValuesBlockId, int stateId = 1)

Adds the transformation result values block for the specified state.

transformationResultValuesBlockId is the id of the transformation result values block to add

The rule is that transformation result values blocks need to be defined for every state, but blocks can be re-used in multiple states if required.

Returns false if an error occurred. Check the log for further information.

bool setTransformationResultValuesBlocks(const std::vector<int> &transformationResultValuesBlockIds, int stateId = 1)

Sets the transformation result values blocks for the specified state.

transformationResultValuesBlockIds is an array of with ids of transformation result values.

The rule is that transformation result values blocks need to be defined for every state, but blocks can be re-used in multiple states if required.

Returns false if an error occurred. Check the log for further information.

size_t stateCount() const

Returns the number of states for the transformation result.

size_t stateIndex(int stateId) const

Returns the zero-based state index for a given state id.

Returns cee::UNDEFINED_SIZE_T if no state with the given state id was found.

int stateId(size_t stateIndex) const

Returns the state id for the give state index.

stateIndex is the zero-based index of the state (not to be mixed with state id!).

Returns -1 if an invalid state index was specified.

virtual bool checkValidity() const

Returns false if weak validity check failed.