3DText Functions

Functions to create, modify, and query 3D text objects, including managing records, attributes, origin, direction, and orientation.

MTK_Object_3DText_AppendRecord()

Append a record (line) to a 3D text object.

Signature
int MTK_Object_3DText_AppendRecord(
    MTK_Object* obj, const char* record);
Parameters
  • obj: Pointer to an MTK_Object struct.

  • record:The record to append.

Returns

0 on success; any other value indicates failure.

MTK_Object_3DText_DeleteAllRecords()

Delete all records (lines) of a 3D text object.

Signature
int MTK_Object_3DText_DeleteAllRecords(MTK_Object* obj);
Parameters

obj: Pointer to an MTK_Object struct.

Returns

0 on success; any other value indicates failure.

MTK_Object_3DText_DeleteRecord()

Delete a specific record (line) of a 3D text object.

Signature
MTK_Layer* MTK_Database_GetLayerByIndex(
    MTK_Database* data, const int& index);
Parameters
  • obj: Pointer to an MTK_Object struct.

  • index:The index of the record to delete.

Returns

0 on success; any other value indicates failure.

MTK_Object_3DText_GetAttributes()

Get the attributes of a 3D text object.

Signature
int MTK_Object_3DText_GetAttributes(
    MTK_Object* obj,
    char* font,
    char* scale,
    double* height,
    double* width,
    int* italic
    );
Parameters
  • obj: Pointer to an MTK_Object struct.

  • font:The font of the text.

  • scale:The scale of the text.

  • height:The height of the text.

  • width:The width of the text.

  • italic: Whether the text is in italics or not.

Returns

0 on success; any other value indicates failure.

MTK_Object_3DText_GetDirection()

Get the direction of a 3D text object.

Signature
int MTK_Object_3DText_GetDirection(
    MTK_Object* obj,
    double* x, double* y, double* z
    );
Parameters
  • obj: Pointer to an MTK_Object struct.

  • x: The direction x value.

  • y: The direction y value.

  • z: The direction z value.

Returns

0 on success; any other value indicates failure.

MTK_Object_3DText_GetNormal()

Get the normal of a 3D text object.

Signature
int MTK_Object_3DText_GetNormal(
    MTK_Object* obj,
    double* x, double* y, double* z
    );
Parameters
  • obj: Pointer to an MTK_Object struct.

  • x: The normal x value.

  • y: The normal y value.

  • z: The normal z value.

Returns

0 on success; any other value indicates failure.

MTK_Object_3DText_GetOrigin()

Get the origin of a 3D text object.

Signature
int MTK_Object_3DText_GetOrigin(
    MTK_Object* obj,
    double* x, double* y, double* z
    );
Parameters
  • obj: Pointer to an MTK_Object struct.

  • x: The origin x value.

  • y: The origin y value.

  • z: The origin z value.

Returns

0 on success; any other value indicates failure.

MTK_Object_3DText_GetOriginPosition()

Get the position of the origin relative to the rest of the 3D text object.

Signature
int MTK_Object_3DText_GetOriginPosition(
    MTK_Object* obj,
    MTK_Object_TextHoriPos* horiPos,
    MTK_Object_TextVertPos* vertPos
    );
Parameters
  • obj: Pointer to an MTK_Object struct.

  • horiPos: The horizontal position of the origin, one of the following enum values:

    enum MTK_Object_TextHoriPos
    {
        TEXT_HORI_LEFT,
        TEXT_HORI_CENTRE,
        TEXT_HORI_RIGHT
    };
  • vertPos: The vertical position of the origin, one of the following enum values:

    enum MTK_Object_TextVertPos
    {
        TEXT_VERT_BOTTOM,
        TEXT_VERT_CENTRE,
        TEXT_VERT_TOP
    };
Returns

0 on success; any other value indicates failure.

MTK_Object_3DText_GetRecord()

Get the number of layers in a database.

Signature
int MTK_Object_3DText_GetRecord(
    MTK_Object* obj,
    const int& index, char* record
    );
Parameters
  • obj: Pointer to an MTK_Object struct.

  • index: The index of the desired record

  • record: The buffer of length MTK_BUFFER_SIZE to receive the record at the index.

Returns

0 on success; any other value indicates failure.

MTK_Object_3DText_NRecords()

Get the number of records in a 3D text object.

Signature
int MTK_Object_3DText_NRecords(MTK_Object* obj);
Parameters

obj: Pointer to an MTK_Object struct.

Returns
  • int: The number of records (lines) in the object.
  • -1: Failure

MTK_Object_3DText_SetAttributes()

Set the attributes of a 3D text object. Passing a -1 or NULL will skip setting that attribute.

Signature
int MTK_Object_3DText_SetAttributes(
    MTK_Object* obj,
    const char* font,
    const char* scale,
    const double& height,
    const double& width,
    const int& italic
    );
Parameters
  • obj: Pointer to an MTK_Object struct.

  • font:The font of the text.

  • scale:The scale of the text.

  • height:The height of the text.

  • width:The width of the text.

  • italic: Whether the text is in italics or not.

Returns

0 on success; any other value indicates failure.

MTK_Object_3DText_SetDirection()

Set the direction of a 3D text object.

Signature
int MTK_Object_3DText_SetDirection(
    MTK_Object* obj,
    const double& x,
    const double& y,
    const double& z
    );
Parameters
  • obj: Pointer to an MTK_Object struct.

  • x: The direction x value.

  • y: The direction y value.

  • z: The direction z value.

Returns

0 on success; any other value indicates failure.

MTK_Object_3DText_SetNormal()

Set the normal of a 3D text object.

Signature
int MTK_Object_3DText_SetNormal(
    MTK_Object* obj,
    const double& x,
    const double& y,
    const double& z
    );
Parameters
  • obj: Pointer to an MTK_Object struct.

  • x: The normal x value.

  • y: The normal y value.

  • z: The normal z value.

Returns

0 on success; any other value indicates failure.

MTK_Object_3DText_SetOrigin()

Set the origin of a 3D text object.

Signature
int MTK_Object_3DText_SetOrigin(
    MTK_Object* obj,
    const double& x,
    const double& y,
    const double& z
    );
Parameters
  • obj: Pointer to an MTK_Object struct.

  • x: The origin x value.

  • y: The origin y value.

  • z: The origin z value.

Returns

0 on success; any other value indicates failure.

MTK_Object_3DText_SetOriginPosition()

Set the position of the origin relative to the rest of the 3D text object.

Signature
int MTK_Object_3DText_SetOriginPosition(
    MTK_Object* obj,
    const MTK_Object_TextHoriPos& horiPos,
    const MTK_Object_TextVertPos& vertPos
    );
Parameters
  • obj: Pointer to an MTK_Object struct.

  • horiPos: The horizontal position of the origin, one of the following enum values:

    enum MTK_Object_TextHoriPos
    {
        TEXT_HORI_LEFT,
        TEXT_HORI_CENTRE,
        TEXT_HORI_RIGHT
    };
  • vertPos: The vertical position of the origin, one of the following enum values:

    enum MTK_Object_TextVertPos
    {
        TEXT_VERT_BOTTOM,
        TEXT_VERT_CENTRE,
        TEXT_VERT_TOP
    };
Returns

0 on success; any other value indicates failure.

MTK_Object_3DText_SetRecord()

Set a specific record (line) of a 3D text object.

Signature
int MTK_Object_3DText_SetRecord(
    MTK_Object* obj, const int& index,
    const char* record
    );
Parameters
  • obj: Pointer to an MTK_Object struct.

  • index: The desired index of the record.

  • record: The record.

Returns

0 on success; any other value indicates failure.