CMeshObject

class Lib3MF::CMeshObject : public CObject
Lib3MF_uint32 GetVertexCount()

Returns the vertex count of a mesh object.

Returns:

filled with the vertex count.

Lib3MF_uint32 GetTriangleCount()

Returns the triangle count of a mesh object.

Returns:

filled with the triangle count.

sPosition GetVertex(const Lib3MF_uint32 nIndex)

Returns the vertex count of a mesh object.

Parameters:

nIndex – Index of the vertex (0 to vertexcount - 1)

Returns:

filled with the vertex coordinates.

void SetVertex(const Lib3MF_uint32 nIndex, const sPosition &Coordinates)

Sets the coordinates of a single vertex of a mesh object

Parameters:
  • nIndex – Index of the vertex (0 to vertexcount - 1)

  • Coordinates – contains the vertex coordinates.

Lib3MF_uint32 AddVertex(const sPosition &Coordinates)

Adds a single vertex to a mesh object

Parameters:

Coordinates – contains the vertex coordinates.

Returns:

Index of the new vertex

void GetVertices(std::vector<sPosition> &VerticesBuffer)

Obtains all vertex positions of a mesh object

Parameters:

VerticesBuffer – contains the vertex coordinates.

sTriangle GetTriangle(const Lib3MF_uint32 nIndex)

Returns indices of a single triangle of a mesh object.

Parameters:

nIndex – Index of the triangle (0 to trianglecount - 1)

Returns:

filled with the triangle indices.

void SetTriangle(const Lib3MF_uint32 nIndex, const sTriangle &Indices)

Sets the indices of a single triangle of a mesh object.

Parameters:
  • nIndex – Index of the triangle (0 to trianglecount - 1)

  • Indices – contains the triangle indices.

Lib3MF_uint32 AddTriangle(const sTriangle &Indices)

Adds a single triangle to a mesh object

Parameters:

Indices – contains the triangle indices.

Returns:

Index of the new triangle

void GetTriangleIndices(std::vector<sTriangle> &IndicesBuffer)

Get all triangles of a mesh object

Parameters:

IndicesBuffer – contains the triangle indices.

void SetObjectLevelProperty(const Lib3MF_uint32 nUniqueResourceID, const Lib3MF_uint32 nPropertyID)

Sets the property at the object-level of the mesh object.

Parameters:
  • nUniqueResourceID – the object-level Property UniqueResourceID.

  • nPropertyID – the object-level PropertyID.

bool GetObjectLevelProperty(Lib3MF_uint32 &nUniqueResourceID, Lib3MF_uint32 &nPropertyID)

Gets the property at the object-level of the mesh object.

Parameters:
  • nUniqueResourceID – the object-level Property UniqueResourceID.

  • nPropertyID – the object-level PropertyID.

Returns:

Has an object-level property been specified?

void SetTriangleProperties(const Lib3MF_uint32 nIndex, const sTriangleProperties &Properties)

Sets the properties of a single triangle of a mesh object.

Parameters:
  • nIndex – Index of the triangle (0 to trianglecount - 1)

  • Properties – contains the triangle properties.

void GetTriangleProperties(const Lib3MF_uint32 nIndex, sTriangleProperties &Property)

Gets the properties of a single triangle of a mesh object.

Parameters:
  • nIndex – Index of the triangle (0 to trianglecount - 1)

  • Property – returns the triangle properties.

void SetAllTriangleProperties(const CInputVector<sTriangleProperties> &PropertiesArrayBuffer)

Sets the properties of all triangles of a mesh object. Sets the object level property to the first entry of the passed triangle properties, if not yet specified.

Parameters:

PropertiesArrayBuffer – contains the triangle properties array. Must have trianglecount elements.

void GetAllTriangleProperties(std::vector<sTriangleProperties> &PropertiesArrayBuffer)

Gets the properties of all triangles of a mesh object.

Parameters:

PropertiesArrayBuffer – returns the triangle properties array. Must have trianglecount elements.

void ClearAllProperties()

Clears all properties of this mesh object (triangle and object-level).

void SetGeometry(const CInputVector<sPosition> &VerticesBuffer, const CInputVector<sTriangle> &IndicesBuffer)

Set all triangles of a mesh object

Parameters:
  • VerticesBuffer – contains the positions.

  • IndicesBuffer – contains the triangle indices.

bool IsManifoldAndOriented()

Retrieves, if an object describes a topologically oriented and manifold mesh, according to the core spec.

Returns:

returns, if the object is oriented and manifold.

PBeamLattice BeamLattice()

Retrieves the BeamLattice within this MeshObject.

Returns:

the BeamLattice within this MeshObject

typedef std::shared_ptr<CMeshObject> Lib3MF::PMeshObject

Shared pointer to CMeshObject to easily allow reference counting.