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

Vertex structure for meshes. More...

#include <Vertex.h>

Public Member Functions

 Vertex ()
 Constructor.
 
 Vertex (const SurgSim::Math::Vector3d &position, const Data &data=Data())
 Constructor. More...
 
template<class T >
 Vertex (const Vertex< T > &other)
 Copy constructor when the template data is a different type In this case, no data will be copied. More...
 
template<class T >
Vertex< Data > & operator= (const Vertex< T > &other)
 Assignment when the template data is a different type In this case, no data will be copied. 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.
 
Data data
 Extra vertex data.
 

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

§ Vertex() [1/2]

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

Constructor.

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

§ Vertex() [2/2]

template<class Data>
template<class T >
SurgSim::DataStructures::Vertex< Data >::Vertex ( const Vertex< T > &  other)
inlineexplicit

Copy constructor when the template data is a different type In this case, no data will be copied.

Template Parameters
Ttype of data stored in the other Vertex
Parameters
otherthe Vertex to copy from

Member Function Documentation

§ operator!=()

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.

§ operator=()

template<class Data>
template<class T >
Vertex<Data>& SurgSim::DataStructures::Vertex< Data >::operator= ( const Vertex< T > &  other)
inline

Assignment when the template data is a different type In this case, no data will be copied.

Template Parameters
Ttype of data stored in the other Vertex
Parameters
otherthe Vertex to copy from

§ operator==()

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.

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