class Block : public RefCountedObject

Abstract base class for all VTFx blocks.

Only for internal use in the VTFx component.

All blocks must have an id that is equal to or greater than zero. The block id must be unique within each block class and the database they have been added to. Blocks use their id to reference each other, e.g. an element block references its associated node blocks using block ids.

Usually one creates a block in a local scope and also writes the block to a database (or a case) within that scope. Databases and cases do not take the ownership of blocks, so it is up the user to clean up block instances properly.

Subclassed by ElementBlock, GeometryBlock, GeometryInfoBlock, NodeBlock, ResultBlock, ResultValuesBlock, SetBlock, StateInfoBlock, TransformationResultBlock, TransformationResultValuesBlock

Public Types

enum BlockType

Global block type constants used by the VTFx component.

Normally users do not need these, except for some methods of TransformationResultValuesBlock


enumerator NODES

Node block.

enumerator ELEMENTS

Elements block.

enumerator GEOMETRY

Geometry block.


Geometry info block.

enumerator RESULT

Result block.


Result values block (scalars, vectors, displacements)


Transformation result block.


Transformation result values block (matrices)

enumerator STATEINFO

State info block.

enumerator SET

Element set block.

enumerator ILLEGAL

Public Functions

Block(int blockId)

Constructs an empty block with given block id.

virtual ~Block()
int blockId() const

Returns the block id.

BlockType blockType() const

Returns the block type.

virtual bool checkValidity() const

Does a weak check for valid block contents just before the block is being written.

This method checks if the user forgot to set pre-defined values such as ids, block mappings, names, etc. Note: Only a weak check is possible since a block might appear valid, but still can cause problems in the context of a complete VTFx file.

Returns true if no invalid settings were found in block.