Public Member Functions | Public Attributes | List of all members
SurgSim::DataStructures::Vertex< Data > Struct Template Reference

Vertex structure for meshes. More...

#include <SurgSim/DataStructures/Vertex.h>

Public Member Functions

 Vertex (const SurgSim::Math::Vector3d &position, const Data &data=Data())
 Constructor. More...
 
bool operator== (const Vertex< Data > &vertex) const
 Compare the vertex to another one (equality) More...
 
bool operator!= (const Vertex< Data > &vertex) const
 Compare the vertex to another one (inequality) More...
 

Public Attributes

SurgSim::Math::Vector3d position
 Position of the vertex. More...
 
Data data
 Extra vertex data. More...
 

Detailed Description

template<class Data>
struct SurgSim::DataStructures::Vertex< Data >

Vertex structure for meshes.

Vertices are the lowest level of structure in a Mesh, providing a position and can store extra per-vertex data. MeshElements combine MeshVertices to form the structure of the mesh.

Vertex is to be used purely as a data structure and not provide implementation of algorithms. For example, a physics FEM's nodes are not subclasses of Vertex if they provide code that is part of the FEM algorithm, but they may used with a Mesh to store the structure of the FEM.

The extra Data is left up to the particular use of Mesh to specify. For example, for use collision detection, a vertex may need a normal and adjacent triangle information, which could be stored in a struct.

If no extra Data is needed, a specialization exists for void, in which case the constructor takes no data.

Template Parameters
DataType of extra data stored in the vertex (void for no data)
See also
Vertices

Constructor & Destructor Documentation

template<class Data>
SurgSim::DataStructures::Vertex< Data >::Vertex ( const SurgSim::Math::Vector3d position,
const Data &  data = Data() 
)
inline

Constructor.

Parameters
positionPosition of the vertex
dataExtra data to be stored in the vertex

Member Function Documentation

template<class Data>
bool SurgSim::DataStructures::Vertex< Data >::operator!= ( const Vertex< Data > &  vertex) const
inline

Compare the vertex to another one (inequality)

Parameters
vertexThe Vertex to compare it to
Returns
False if the two vertices are equal, true otherwise.
template<class Data>
bool SurgSim::DataStructures::Vertex< Data >::operator== ( const Vertex< Data > &  vertex) const
inline

Compare the vertex to another one (equality)

Parameters
vertexThe Vertex to compare it to
Returns
True if the two vertices are equal, false otherwise.

Member Data Documentation

template<class Data>
Data SurgSim::DataStructures::Vertex< Data >::data

Extra vertex data.

template<class Data>
SurgSim::Math::Vector3d SurgSim::DataStructures::Vertex< Data >::position

Position of the vertex.


The documentation for this struct was generated from the following file: