SurgSim::DataStructures::TriangleMesh< VertexData, EdgeData, TriangleData > Class Template Reference

Basic class for storing Triangle Meshes, handling basic vertex, edge, and triangle functionality. More...

`#include <SurgSim/DataStructures/TriangleMesh.h>`

Inheritance diagram for SurgSim::DataStructures::TriangleMesh< VertexData, EdgeData, TriangleData >:

## Public Types

typedef MeshElement< 2, EdgeData > | EdgeType
| Edge type for convenience (Ids of the 2 vertices) More...
typedef MeshElement< 3, TriangleData > | TriangleType
| Triangle type for convenience (Ids of the 3 vertices) More...
Public Types inherited from SurgSim::DataStructures::Vertices< VertexData >
typedef Vertex< VertexData > | VertexType
| Vertex type for convenience. More...
Public Types inherited from SurgSim::Framework::Accessible
typedef std::function< boost::any(void)> | GetterType
typedef std::function< void(boost::any)> | SetterType
typedef std::function< YAML::Node(void)> | EncoderType
typedef std::function< void(const YAML::Node *)> | DecoderType
Public Types inherited from SurgSim::Framework::FactoryBase< Asset >
typedef ObjectFactory< Asset > | FactoryType

## Public Member Functions

| TriangleMesh ()
| Constructor. The mesh is initially empty (no vertices, no edges, no triangles). More...
| TriangleMesh (const TriangleMesh< VertexData, EdgeData, TriangleData > &other)
| Copy constructor when the template data is the same type. More...
template<class V , class E , class T >
| TriangleMesh (const TriangleMesh< V, E, T > &other)
| Copy constructor when the template data is a different type. More...
virtual | ~TriangleMesh ()
| Destructor. More...
| TriangleMesh (TriangleMesh &&other)
| Move Constructor. More...
TriangleMesh< VertexData, EdgeData, TriangleData > & | operator= (const TriangleMesh< VertexData, EdgeData, TriangleData > &other)
| Copy Assignment. More...
TriangleMesh< VertexData, EdgeData, TriangleData > & | operator= (TriangleMesh< VertexData, EdgeData, TriangleData > &&other)
| Move Assignment. More...
std::string | getClassName () const override
| Support serialization with a classname. More...
size_t | addEdge (const EdgeType &edge)
| Adds an edge to the mesh. More...
size_t | addTriangle (const TriangleType &triangle)
| Adds a triangle to the mesh. More...
size_t | getNumEdges () const
| Get the number of edges. More...
size_t | getNumTriangles () const
| Get the number of triangles. More...
const std::vector< EdgeType > & | getEdges () const
| Retrieve all edges. More...
std::vector< EdgeType > & | getEdges ()
| Retrieve all edges (non const version) More...
const std::vector< TriangleType > & | getTriangles () const
| Retrieve all triangles. More...
std::vector< TriangleType > & | getTriangles ()
| Retrieve all triangles (non const version) More...
const EdgeType & | getEdge (size_t id) const
| Retrieve a specific edge. More...
EdgeType & | getEdge (size_t id)
| Retrieve a specific edge (non const version) More...
std::array< SurgSim::Math::Vector3d, 2 > | getEdgePositions (size_t id) const
| Returns an array of the edge's vertices' positions. More...
const TriangleType & | getTriangle (size_t id) const
| Retrieve a specific triangle. More...
TriangleType & | getTriangle (size_t id)
| Retrieve a specific triangle (non const version) More...
void | removeTriangle (size_t id)
| Marks a triangle as invalid, the triangle cannot be accessed via getTriangle anymore. More...
std::array< SurgSim::Math::Vector3d, 3 > | getTrianglePositions (size_t id) const
| Returns an array of the triangle's vertices' positions. More...
bool | isValid () const
| Test if the TriangleMesh is valid (valid vertex Ids used in all MeshElements) More...
void | save (const std::string &fileName)
| Save the triangle mesh in the ply format. More...
Public Member Functions inherited from SurgSim::DataStructures::Vertices< VertexData >
| Vertices ()
| Constructor. More...
template<class V >
| Vertices (const Vertices< V > &other)
| Copy constructor when the template data is a different type In this case, no data will be copied. More...
template<class V >
Vertices< VertexData > & | operator= (const Vertices< V > &other)
| Assignment when the template data is a different type In this case, no data will be copied. More...
virtual | ~Vertices ()
| Destructor. More...
void | clear ()
| Clear mesh to return to an empty state (no vertices). More...
bool | update ()
| Performs any updates that are required when the vertices are modified. More...
size_t | addVertex (const VertexType &vertex)
| Adds a vertex to the mesh. More...
size_t | getNumVertices () const
| Returns the number of vertices in this mesh. More...
const VertexType & | getVertex (size_t id) const
| Returns the specified vertex. More...
VertexType & | getVertex (size_t id)
| Returns the specified vertex (non const version). More...
const std::vector< VertexType > & | getVertices () const
| Returns a vector containing the position of each vertex. More...
std::vector< VertexType > & | getVertices ()
| Returns a vector containing the position of each vertex (non const version). More...
void | setVertexPosition (size_t id, const SurgSim::Math::Vector3d &position)
| Sets the position of a vertex. More...
const SurgSim::Math::Vector3d & | getVertexPosition (size_t id) const
| Returns the position of a vertex. More...
void | setVertexPositions (const std::vector< SurgSim::Math::Vector3d > &positions, bool doUpdate=true)
| Sets the position of each vertex. More...
void | transform (const Math::RigidTransform3d &pose)
| Apply a rigid transform to each vertex. More...
bool | operator== (const Vertices &mesh) const
| Compares the mesh with another one (equality) More...
bool | operator!= (const Vertices &mesh) const
| Compares the mesh with another one (inequality) More...
Public Member Functions inherited from SurgSim::Framework::Asset
| Asset ()
| Constructor. More...
| Asset (const Asset &rhs)
| Copy Constructor. More...
virtual | ~Asset ()
| Destructor. More...
void | load (const std::string &fileName, const SurgSim::Framework::ApplicationData &data)
| Load a file with given name using 'data' as look up path(s). More...
void | load (const std::string &fileName)
| Overloaded function using SurgSim::Framework::Runtime::getApplicationData() as look up path(s). More...
std::string | getFileName () const
| Return the name of file loaded by this class. More...
Public Member Functions inherited from SurgSim::Framework::Accessible
| Accessible ()
| Default Constructor. More...
| ~Accessible ()
| Destructor. More...
template<class T >
T | getValue (const std::string &name) const
| Retrieves the value with the name by executing the getter if it is found and tries to convert it to the given type. More...
boost::any | getValue (const std::string &name) const
| Retrieves the value with the name by executing the getter if it is found. More...
template<class T >
bool | getValue (const std::string &name, T *value) const
| Retrieves the value with the name by executing the getter if it is found, and converts it to the type of the output parameter. More...
void | setValue (const std::string &name, const boost::any &value)
| Sets a value of a property that has setter. More...
bool | isReadable (const std::string &name) const
| Check whether a property is readable. More...
bool | isWriteable (const std::string &name) const
| Check whether a property is writable. More...
void | setGetter (const std::string &name, GetterType func)
| Sets a getter for a given property. More...
void | setSetter (const std::string &name, SetterType func)
| Sets a setter for a given property. More...
void | setAccessors (const std::string &name, GetterType getter, SetterType setter)
| Sets the accessors getter and setter in one function. More...
void | removeAccessors (const std::string &name)
| Removes all the accessors (getter and setter) for a given property. More...
void | forwardProperty (const std::string &name, const Accessible &target, const std::string &targetProperty)
| Adds a property with the given name that uses the targets accessors, in effect forwarding the value to the target. More...
void | setSerializable (const std::string &name, EncoderType encoder, DecoderType decoder)
| Sets the functions used to convert data from and to a YAML::Node. More...
void | setDecoder (const std::string &name, DecoderType decoder)
| Sets the functions used to convert data from a YAML::Node. More...
YAML::Node | encode () const
| Encode this Accessible to a YAML::Node. More...
void | decode (const YAML::Node &node, const std::vector< std::string > &ignoredProperties=std::vector< std::string >())
| Decode this Accessible from a YAML::Node, will throw an exception if the data type cannot be converted. More...
template<>
boost::any | getValue (const std::string &name) const

## Protected Member Functions

virtual void | doClearEdges ()
| Remove all edges from the mesh. More...
virtual void | doClearTriangles ()
| Remove all triangles from the mesh. More...
virtual bool | isEqual (const Vertices< VertexData > &mesh) const
| Internal comparison of meshes of the same type: returns true if equal, false if not equal. More...
bool | doLoad (const std::string &fileName) override
| Derived classes will overwrite this method to do actual loading. More...
template<>
std::string | m_className
template<>
std::string | m_className
Protected Member Functions inherited from SurgSim::DataStructures::Vertices< VertexData >
virtual void | doClearVertices ()
| Remove all vertices from the mesh. More...

## Static Protected Attributes

static std::string | m_className = "SurgSim::DataStructures::TriangleMeshPlain"

## Private Member Functions

virtual void | doClear ()
| Clear mesh to return to an empty state (no vertices, no edges, no triangles). More...

## Private Attributes

std::vector< EdgeType > | m_edges
| Edges. More...
std::vector< TriangleType > | m_triangles
| Triangles. More...
std::vector< size_t > | m_freeTriangles
| List of indices of deleted triangles, to be reused when another triangle is added. More...

## Additional Inherited Members

Static Public Member Functions inherited from SurgSim::Framework::FactoryBase< Asset >
static FactoryType & | getFactory ()

## Detailed Description

### template<class VertexData, class EdgeData, class TriangleData>
class SurgSim::DataStructures::TriangleMesh< VertexData, EdgeData, TriangleData >

Basic class for storing Triangle Meshes, handling basic vertex, edge, and triangle functionality.

TriangleMesh is to be used purely as a data structure and not provide implementation of algorithms. For example, a physics 2D FEM is not a subclass of TriangleMesh, but may use a TriangleMesh for storing the structure of the FEM.

It is recommended that subclasses with a specific purpose (such as for use in collision detection) provide convenience methods for creation of vertices, edges, and triangles and the data each contains. Methods such as createVertex(position, other data...), createEdge(vertices, other data...), and createTriangle(vertices, other data...) simplify the creation of vertices and elements and the data required. These methods would use the addVertex(), addEdge(), and addTriangle() methods to add the created vertices and elements to the TriangleMesh.

Overriding isEqual(const Mesh&) is necessary to do more than just basic list comparison of the vertices, edges, and triangles, which is dependent on order in the list.

Override doUpdate() to provide update functionality when vertices are changes, such as recalculating surface normals.

A subclass that is designed for a specific use (such as collision detection) may also specify the VertexData, EdgeData, and TriangleData to what is required.

Template Parameters

  VertexData | Type of extra data stored in each vertex
  EdgeData | Type of extra data stored in each edge
  TriangleData | Type of extra data stored in each triangle

See also
  Vertex
  MeshElement

## Member Typedef Documentation

## EdgeType

template<class VertexData, class EdgeData, class TriangleData>

typedef MeshElement<2, EdgeData> SurgSim::DataStructures::TriangleMesh< VertexData, EdgeData, TriangleData >::EdgeType

Edge type for convenience (Ids of the 2 vertices)

## TriangleType

template<class VertexData, class EdgeData, class TriangleData>

typedef MeshElement<3, TriangleData> SurgSim::DataStructures::TriangleMesh< VertexData, EdgeData, TriangleData >::TriangleType

Triangle type for convenience (Ids of the 3 vertices)

## Constructor & Destructor Documentation

## TriangleMesh() [1/4]

template<class VertexData , class EdgeData , class TriangleData >

SurgSim::DataStructures::TriangleMesh< VertexData, EdgeData, TriangleData >::TriangleMesh | ( |  | ) |

Constructor. The mesh is initially empty (no vertices, no edges, no triangles).

## TriangleMesh() [2/4]

template<class VertexData, class EdgeData, class TriangleData>

SurgSim::DataStructures::TriangleMesh< VertexData, EdgeData, TriangleData >::TriangleMesh | ( | const TriangleMesh< VertexData, EdgeData, TriangleData > & | other | ) |

Copy constructor when the template data is the same type.

Parameters

  other | the mesh to copy from

## TriangleMesh() [3/4]

template<class VertexData , class EdgeData , class TriangleData >
template<class V , class E , class T >

SurgSim::DataStructures::TriangleMesh< VertexData, EdgeData, TriangleData >::TriangleMesh | ( | const TriangleMesh< V, E, T > & | other | ) |

explicit

Copy constructor when the template data is a different type.

Template Parameters

  V | Type of extra data stored in each vertex
  E | Type of extra data stored in each edge
  T | Type of extra data stored in each triangle

Parameters

  other | The mesh to be copied from. Vertex, edge and triangle data will not be copied

Note
  : Data of the input mesh, i.e. VertexDataSource, EdgeDataSource and TrianleDataSource will not be copied.

## ~TriangleMesh()

template<class VertexData , class EdgeData , class TriangleData >

SurgSim::DataStructures::TriangleMesh< VertexData, EdgeData, TriangleData >::~TriangleMesh | ( |  | ) |

virtual

Destructor.

## TriangleMesh() [4/4]

template<class VertexData, class EdgeData, class TriangleData>

SurgSim::DataStructures::TriangleMesh< VertexData, EdgeData, TriangleData >::TriangleMesh | ( | TriangleMesh< VertexData, EdgeData, TriangleData > && | other | ) |

Move Constructor.

Parameters

  other | Constructor source

## Member Function Documentation

## addEdge()

template<class VertexData , class EdgeData , class TriangleData >

size_t SurgSim::DataStructures::TriangleMesh< VertexData, EdgeData, TriangleData >::addEdge | ( | const EdgeType & | edge | ) |

Adds an edge to the mesh.

No checking on the edge's vertices is performed. Recommend that subclasses with a specific purpose (such as for use in collision detection) have a createEdge(vertices, other data...) method which performs any checking desired and sets up the edge data based on the vertices and other parameters.

Parameters

  edge | Edge to add to the mesh

Returns
  Unique ID of the new edge.

## addTriangle()

template<class VertexData , class EdgeData , class TriangleData >

size_t SurgSim::DataStructures::TriangleMesh< VertexData, EdgeData, TriangleData >::addTriangle | ( | const TriangleType & | triangle | ) |

Adds a triangle to the mesh.

Parameters

  triangle | Triangle to add to the mesh Recommend that subclasses with a specific purpose (such as for use in collision detection) have a createTriangle(vertices, other data...) method which performs any checking desired and sets up the triangle data based on the vertices and other parameters.

Note
  The ids of deleted triangles will be reused in no particular order

Returns
  id of the new triangle.

## doClear()

template<class VertexData , class EdgeData , class TriangleData >

void SurgSim::DataStructures::TriangleMesh< VertexData, EdgeData, TriangleData >::doClear | ( |  | ) |

private virtual

Clear mesh to return to an empty state (no vertices, no edges, no triangles).

Reimplemented from SurgSim::DataStructures::Vertices< VertexData >.

Reimplemented in SurgSim::DataStructures::SegmentMesh< VertexData, EdgeData >.

## doClearEdges()

template<class VertexData , class EdgeData , class TriangleData >

void SurgSim::DataStructures::TriangleMesh< VertexData, EdgeData, TriangleData >::doClearEdges | ( |  | ) |

protected virtual

Remove all edges from the mesh.

## doClearTriangles()

template<class VertexData , class EdgeData , class TriangleData >

void SurgSim::DataStructures::TriangleMesh< VertexData, EdgeData, TriangleData >::doClearTriangles | ( |  | ) |

protected virtual

Remove all triangles from the mesh.

Reimplemented in SurgSim::DataStructures::SegmentMesh< VertexData, EdgeData >.

## doLoad()

template<class VertexData , class EdgeData , class TriangleData >

bool SurgSim::DataStructures::TriangleMesh< VertexData, EdgeData, TriangleData >::doLoad | ( | const std::string & | filePath | ) |

override protected virtual

Derived classes will overwrite this method to do actual loading.

Note
  This method is not required to do any check on the validity or the existence of the file.

Parameters

  filePath | Absolute path to the file.

Returns
  True if loading is successful; Otherwise, false.

Implements SurgSim::Framework::Asset.

## getClassName()

template<class VertexData , class EdgeData , class TriangleData >

std::string SurgSim::DataStructures::TriangleMesh< VertexData, EdgeData, TriangleData >::getClassName | ( |  | ) | const

override virtual

Support serialization with a classname.

Returns
  the name of this class

Implements SurgSim::Framework::Asset.

## getEdge() [1/2]

template<class VertexData , class EdgeData , class TriangleData >

const TriangleMesh< VertexData, EdgeData, TriangleData >::EdgeType & SurgSim::DataStructures::TriangleMesh< VertexData, EdgeData, TriangleData >::getEdge | ( | size_t | id | ) | const

Retrieve a specific edge.

Parameters

  id | the edge to be retrieved.

Returns
  the specified edge.

## getEdge() [2/2]

template<class VertexData , class EdgeData , class TriangleData >

TriangleMesh< VertexData, EdgeData, TriangleData >::EdgeType & SurgSim::DataStructures::TriangleMesh< VertexData, EdgeData, TriangleData >::getEdge | ( | size_t | id | ) |

Retrieve a specific edge (non const version)

Parameters

  id | the edge to be retrieved.

Returns
  the specified edge.

## getEdgePositions()

template<class VertexData , class EdgeData , class TriangleData >

std::array< SurgSim::Math::Vector3d, 2 > SurgSim::DataStructures::TriangleMesh< VertexData, EdgeData, TriangleData >::getEdgePositions | ( | size_t | id | ) | const

Returns an array of the edge's vertices' positions.

Parameters

  id | the id of the edge

Returns
  an array of the edge's vertices' positions

## getEdges() [1/2]

template<class VertexData , class EdgeData , class TriangleData >

const std::vector< typename TriangleMesh< VertexData, EdgeData, TriangleData >::EdgeType > & SurgSim::DataStructures::TriangleMesh< VertexData, EdgeData, TriangleData >::getEdges | ( |  | ) | const

Retrieve all edges.

Returns
  a vector containing the position of each edge.

## getEdges() [2/2]

template<class VertexData , class EdgeData , class TriangleData >

std::vector< typename TriangleMesh< VertexData, EdgeData, TriangleData >::EdgeType > & SurgSim::DataStructures::TriangleMesh< VertexData, EdgeData, TriangleData >::getEdges | ( |  | ) |

Retrieve all edges (non const version)

Returns
  a vector containing the position of each edge.

## getNumEdges()

template<class VertexData , class EdgeData , class TriangleData >

size_t SurgSim::DataStructures::TriangleMesh< VertexData, EdgeData, TriangleData >::getNumEdges | ( |  | ) | const

Get the number of edges.

Returns
  the number of edges in this mesh.

## getNumTriangles()

template<class VertexData , class EdgeData , class TriangleData >

size_t SurgSim::DataStructures::TriangleMesh< VertexData, EdgeData, TriangleData >::getNumTriangles | ( |  | ) | const

Get the number of triangles.

Note
  The number of triangles might not match the size of the array returned by getTriangles(), after deletion has occurred it cannot be used to access all triangles.

Returns
  the number of triangles in this mesh.

## getTriangle() [1/2]

template<class VertexData , class EdgeData , class TriangleData >

const TriangleMesh< VertexData, EdgeData, TriangleData >::TriangleType & SurgSim::DataStructures::TriangleMesh< VertexData, EdgeData, TriangleData >::getTriangle | ( | size_t | id | ) | const

Retrieve a specific triangle.

Exceptions

  SurgSim::Framework::AssertionFailure | if the given triangle was deleted

Parameters

  id | The id of the triangle to retrieve

Returns
  the specified triangle

## getTriangle() [2/2]

template<class VertexData , class EdgeData , class TriangleData >

TriangleMesh< VertexData, EdgeData, TriangleData >::TriangleType & SurgSim::DataStructures::TriangleMesh< VertexData, EdgeData, TriangleData >::getTriangle | ( | size_t | id | ) |

Retrieve a specific triangle (non const version)

Exceptions

  SurgSim::Framework::AssertionFailure | if the give triangle was deleted

Parameters

  id | The id of the triangle to retrieve

Returns
  the specified triangle

## getTrianglePositions()

template<class VertexData , class EdgeData , class TriangleData >

std::array< SurgSim::Math::Vector3d, 3 > SurgSim::DataStructures::TriangleMesh< VertexData, EdgeData, TriangleData >::getTrianglePositions | ( | size_t | id | ) | const

Returns an array of the triangle's vertices' positions.

Parameters

  id | the id of the triangle

Returns
  an array of the triangle's vertices' positions

## getTriangles() [1/2]

template<class VertexData , class EdgeData , class TriangleData >

const std::vector< typename TriangleMesh< VertexData, EdgeData, TriangleData >::TriangleType > & SurgSim::DataStructures::TriangleMesh< VertexData, EdgeData, TriangleData >::getTriangles | ( |  | ) | const

Retrieve all triangles.

Note
  The number of triangles might not match the size of the array returned by getTriangles(), after deletion has occurred it cannot be used to access all triangles. When processing this array, check

See also
  TriangleType::isValid to see wether to do something with this triangle

Returns
  a vector containing the position of each triangle. Some of these triangles might be deleted, they need to be checked via

See also
  isValid before further processing

## getTriangles() [2/2]

template<class VertexData , class EdgeData , class TriangleData >

std::vector< typename TriangleMesh< VertexData, EdgeData, TriangleData >::TriangleType > & SurgSim::DataStructures::TriangleMesh< VertexData, EdgeData, TriangleData >::getTriangles | ( |  | ) |

Retrieve all triangles (non const version)

Note
  The number of triangles might not match the size of the array returned by getTriangles(), after deletion has occurred it cannot be used to access all triangles. When processing this array, check

See also
  TriangleType::isValid to see wether to do something with this triangle

Returns
  a vector containing the position of each triangle. Some of these triangles might be deleted, they need to be checked via

See also
  isValid before further processing

## isEqual()

template<class VertexData, class EdgeData , class TriangleData >

bool SurgSim::DataStructures::TriangleMesh< VertexData, EdgeData, TriangleData >::isEqual | ( | const Vertices< VertexData > & | mesh | ) | const

protected virtual

Internal comparison of meshes of the same type: returns true if equal, false if not equal.

Override this method to provide custom comparison. Basic TriangleMesh implementation compares vertices, edges and triangles: the order of vertices, edges, and triangles must also match to be considered equal.

Parameters

  mesh | Mesh must be of the same type as that which it is compared against

Returns
  True if the vertices are equals, False otherwise

Reimplemented from SurgSim::DataStructures::Vertices< VertexData >.

## isValid()

template<class VertexData , class EdgeData , class TriangleData >

bool SurgSim::DataStructures::TriangleMesh< VertexData, EdgeData, TriangleData >::isValid | ( |  | ) | const

Test if the TriangleMesh is valid (valid vertex Ids used in all MeshElements)

Returns
  True if the TriangleMesh is valid, False otherwise (the topology is then broken)

## m_className() [1/2]

template<>

std::string SurgSim::DataStructures::TriangleMesh< SurgSim::Graphics::VertexData, EmptyData, EmptyData >::m_className | ( |  | ) |

protected

## m_className() [2/2]

template<>

std::string SurgSim::DataStructures::TriangleMesh< EmptyData, EmptyData, NormalData >::m_className | ( |  | ) |

protected

## operator=() [1/2]

template<class VertexData, class EdgeData, class TriangleData>

TriangleMesh< VertexData, EdgeData, TriangleData > & SurgSim::DataStructures::TriangleMesh< VertexData, EdgeData, TriangleData >::operator= | ( | const TriangleMesh< VertexData, EdgeData, TriangleData > & | other | ) |

Copy Assignment.

Parameters

  other | Assignment source

## operator=() [2/2]

template<class VertexData, class EdgeData, class TriangleData>

TriangleMesh< VertexData, EdgeData, TriangleData > & SurgSim::DataStructures::TriangleMesh< VertexData, EdgeData, TriangleData >::operator= | ( | TriangleMesh< VertexData, EdgeData, TriangleData > && | other | ) |

Move Assignment.

Parameters

  other | Assignment source

## removeTriangle()

template<class VertexData , class EdgeData , class TriangleData >

void SurgSim::DataStructures::TriangleMesh< VertexData, EdgeData, TriangleData >::removeTriangle | ( | size_t | id | ) |

Marks a triangle as invalid, the triangle cannot be accessed via getTriangle anymore.

Note
  users of getTriangles() will have to check for deleted triangles if this feature is used the size of the vector returned by getTriangles does not reflect the number of triangles anymore use getNumTriangles() to figure out the correct number.

Parameters

  id | triangle to delete

## save()

template<class VertexData , class EdgeData , class TriangleData >

void SurgSim::DataStructures::TriangleMesh< VertexData, EdgeData, TriangleData >::save | ( | const std::string & | fileName | ) |

Save the triangle mesh in the ply format.

Parameters

  fileName | the filename where to save

## Member Data Documentation

## m_className

template<class VertexData, class EdgeData, class TriangleData>

std::string SurgSim::DataStructures::TriangleMeshPlain::m_className = "SurgSim::DataStructures::TriangleMeshPlain"

static protected

## m_edges

template<class VertexData, class EdgeData, class TriangleData>

std::vector<EdgeType> SurgSim::DataStructures::TriangleMesh< VertexData, EdgeData, TriangleData >::m_edges

private

Edges.

## m_freeTriangles

template<class VertexData, class EdgeData, class TriangleData>

std::vector<size_t> SurgSim::DataStructures::TriangleMesh< VertexData, EdgeData, TriangleData >::m_freeTriangles

private

List of indices of deleted triangles, to be reused when another triangle is added.

## m_triangles

template<class VertexData, class EdgeData, class TriangleData>

std::vector<TriangleType> SurgSim::DataStructures::TriangleMesh< VertexData, EdgeData, TriangleData >::m_triangles

private

Triangles.

The documentation for this class was generated from the following files:

- SurgSim/DataStructures/TriangleMesh.h
- SurgSim/DataStructures/TriangleMesh-inl.h
- SurgSim/DataStructures/TriangleMesh.cpp