File Functions

Functions related to opening and closing block model files.

MTK_BlockModel_Open()

Opens a block model.

Signature
MTK_BlockModel* MTK_BlockModel_Open(
    const char* name, const int& readOnly);
Parameters
  • name: The block model filename.

  • readOnly: Set to non-zero to open the block model for read only.

Returns
  • Pointer to an empty MTK_BlockModel struct on success.

  • NULL pointer on failure.

MTK_BlockModel_IsOpen()

Queries the current object state.

Signature
int MTK_BlockModel_IsOpen(MTK_BlockModel* bmodel);
Parameters

bmodel: Pointer to an MTK_BlockModel struct.

Returns
  • 0: Block model is open.
  • 1: Block model is closed.
  • Any other value: Failure

MTK_BlockModel_Close()

Closes the block model and releases any memory used. Note that this saves any changes to the block model file.

Signature
int MTK_BlockModel_Close(MTK_BlockModel* bmodel);
Parameters

bmodel: Pointer to an MTK_BlockModel struct.

Returns

0 on success; any other value indicates failure.