cee::vtfx::TransformationResultValuesBlock

class TransformationResultValuesBlock : public Block

A block for a rigid body transformation matrix.

The block maps to an element block.

As expected for a rigid body transformation, the matrix applies to every item of an element block. The matrix is specified as 3 columns by 4 rows:

    | 00 01 02 |
M = | 10 11 12 |
    | 20 21 22 |
    | 30 31 32 |

The first index is the row index, the second is the column index. The array is stored in a row first, then column order.

This is equivalent to the standard four by four transformation matrices used with homogeneous coordinates, where the fourth column is taken to be [0 0 0 1]T. The coordinates (x0, y0, z0) are transformed into (x,y,z) as specified in the following equation:

[x, y, z] = [x0, y0, z0, 1]*M

Use the transformation result block (see TransformationResultBlock) to define which transformation result value blocks shall apply for which state.

Public Functions

TransformationResultValuesBlock(int blockId)

Constructs an empty transformation result values block.

Id must be >= 0 and unique for all result transformation result values blocks within a database.

~TransformationResultValuesBlock()
int mapToBlockId(BlockType *blockType) const

Returns the id of the block the transformation matrix maps to.

blockType is a pointer to the int variable to store the block type.

Returns -1 if an error occurred. Check the log for more information.

bool setMapToBlockId(int blockId, Block::BlockType blockType)

Sets the id of the element or indexed face set block to map the transformation matrix to.

Returns false if error occurred. Check the log for more information.

Mat4d matrix() const

Returns the transformation matrix defined in this block.

Use this method to get the matrix defined in this block.

void setMatrix(const Mat4d &matrix)

Sets the transformation matrix.

virtual bool checkValidity() const

Returns false if the weak validity check fails.