SurgSim::DataStructures::Vertex< Data > Struct Template Reference

Vertex structure for meshes. More...

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

## Public Member Functions

| Vertex ()
| Constructor. More...
| 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. 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

  Data | Type of extra data stored in the vertex (void for no data)

See also
  Vertices

## Constructor & Destructor Documentation

## Vertex() [1/3]

template<class Data>

SurgSim::DataStructures::Vertex< Data >::Vertex | ( |  | ) |

inline

Constructor.

## Vertex() [2/3]

template<class Data>

SurgSim::DataStructures::Vertex< Data >::Vertex | ( | const SurgSim::Math::Vector3d & | position,
|  | const Data & | data = `Data()`
| ) |  |

inline explicit

Constructor.

Parameters

  position | Position of the vertex
  data | Extra data to be stored in the vertex

## Vertex() [3/3]

template<class Data>
template<class T >

SurgSim::DataStructures::Vertex< Data >::Vertex | ( | const Vertex< T > & | other | ) |

inline explicit

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

Template Parameters

  T | type of data stored in the other Vertex

Parameters

  other | the 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

  vertex | The 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

  T | type of data stored in the other Vertex

Parameters

  other | the 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

  vertex | The Vertex to compare it to

Returns
  True if the two vertices are equal, false otherwise.

## Member Data Documentation

## data

template<class Data>

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

Extra vertex data.

## position

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:

- SurgSim/DataStructures/Vertex.h