Polyline Functions

Functions to create, modify, and query points, attributes, line types, and structure of polyline objects.

MTK_Object_Polyline_AppendPoint()

Append a point to an object.

Signature
int MTK_Object_Polyline_AppendPoint(
    MTK_Object* obj,
    const double& x, const double& y ,const double& z,
    const double& w, const int& t, const char* name
    );
Parameters
  • obj: Pointer to an MTK_Object struct.
  • x: X coordinate of the point.
  • y: Y coordinate of the point.
  • z: Z coordinate of the point.
  • w: W value of the point.
  • t: Type of the point. See MTK_Object_Polyline_GetPointType.
  • name: Name of the point.
Return Value

0 on success; any other value indicates failure.

MTK_Object_Polyline_DeleteAllPoints()

Delete all points in a polyline object.

Signature
int MTK_Object_Polyline_DeleteAllPoints(MTK_Object* obj);
Parameters obj: Pointer to an MTK_Object struct.
Return Value

0 on success; any other value indicates failure.

MTK_Object_Polyline_DeletePoint()

Delete a point in a polyline object.

Signature
int MTK_Object_Polyline_DeletePoint(
    MTK_Object* obj, const int& index);
Parameters
  • obj: Pointer to an MTK_Object struct.
  • index: Index of the point.
Return Value

0 on success; any other value indicates failure.

MTK_Object_Polyline_GetAttributes()

Get the polyline attributes of a polyline object.

Signature
int MTK_Object_Polyline_GetAttributes(
    MTK_Object* obj,
    int* linetype, int* pattern,
    int* clockwise, int* closed
    );
Parameters
  • obj: Pointer to an MTK_Object struct.
  • linetype: Linetype of the object. See MTK_Object_Polyline_GetLineType.
  • pattern: Pattern of the object.
  • clockwise: Whether object is clockwise.
  • closed: Whether object is closed.
Return Value

0 on success; any other value indicates failure.

MTK_Object_Polyline_GetLineType()

Get the type (style + thickness) of the line of a polyline object.

Signature
int MTK_Object_Polyline_GetLineType(
    MTK_Object* obj, int* type);
Parameters
  • obj: Pointer to an MTK_Object struct.
  • type: Type of line as style + (thickness - 1) * 10. Style 0–7, thickness 1–10.
Return Value

0 on success; any other value indicates failure.

MTK_Object_Polyline_GetPointInfo()

Get the information about a point in a polyline object.

Signature
int MTK_Object_Polyline_GetPointInfo(
    MTK_Object* obj, const int& index,
    double* x, double* y, double* z,
    double* w, int* t, char* name
    );
Parameters
  • obj: Pointer to an MTK_Object struct.
  • index: Index of the point.
  • x, y, z, w: Coordinates of the point.
  • t: Type of the point. See MTK_Object_Polyline_GetPointType.
  • name: Buffer to receive the name of the point.
Return Value

0 on success; any other value indicates failure.

MTK_Object_Polyline_GetPointType()

Get the type of a point in a polyline object.

Signature
int MTK_Object_Polyline_GetPointType(
    MTK_Object* obj, const int& index, int* t);
Parameters
  • obj: Pointer to an MTK_Object struct.
  • index: Index of the point.
  • t: Type of the point. Possible values:
    • 0: "move" – no line drawn from this point
    • 1: "draw" – a line is drawn from this point
    • 2: "point" – point is unconnected
Return Value

0 on success; any other value indicates failure.

MTK_Object_Polyline_NPoints()

Get the number of points in a polyline object.

Signature
int MTK_Object_Polyline_NPoints(MTK_Object* obj);
Parameters obj: Pointer to an MTK_Object struct.
Return Value
  • Number of points in the object
  • -1: Failed

MTK_Object_Polyline_SetAttributes()

Set the polyline attributes of a polyline object. Passing -1 skips setting that attribute.

Signature
int MTK_Object_Polyline_SetAttributes(
    MTK_Object* obj,
    const int& linetype,
    const int& pattern,
    const int& clockwise,
    const int& closed
    );
Parameters
  • obj: Pointer to an MTK_Object struct.
  • linetype: Linetype of the object. See MTK_Object_Polyline_GetLineType.
  • pattern: Pattern of the object.
  • clockwise: Whether object is clockwise.
  • closed: Whether object is closed.
Return Value

0 on success; any other value indicates failure.

MTK_Object_Polyline_SetLineType()

Set the type (style + thickness) of the line of a polyline object.

Signature
int MTK_Object_Polyline_SetLineType(
    MTK_Object* obj, const int& type);
Parameters
  • obj: Pointer to an MTK_Object struct.
  • type: Type of line as style + (thickness - 1) * 10. Style 0–7, thickness 1–10.
Return Value

0 on success; any other value indicates failure.

MTK_Object_Polyline_SetPointInfo()

Set the information about a point in a polyline object.

Signature
int MTK_Object_Polyline_SetPointInfo(
    MTK_Object* obj, const int& index,
    const double& x, const double& y, const double& z,
    const double& w, const int& t, const char* name
    );
Parameters
  • obj: Pointer to an MTK_Object struct.
  • index: Index of the point.
  • x, y, z, w: Coordinates of the point.
  • t: Type of the point. See MTK_Object_Polyline_GetPointType.
  • name: Name of the point.
Return Value

0 on success; any other value indicates failure.

MTK_Object_Polyline_SetPointType()

Set the type of a point in a polyline object.

Signature
int MTK_Object_Polyline_SetPointType(
    MTK_Object* obj,
    const int& index,
    const int& t
    );
Parameters
  • obj: Pointer to an MTK_Object struct.
  • index: Index of the point.
  • t: Type of the point. Possible values:
    • 0: "move" – no line drawn from this point
    • 1: "draw" – a line is drawn from this point
    • 2: "point" – point is unconnected
Return Value

0 on success; any other value indicates failure.