All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Public Attributes | List of all members
SurgSim::DataStructures::MeshElement< N, Data > Struct Template Reference

Element structure for meshes. More...

#include <SurgSim/DataStructures/MeshElement.h>

Collaboration diagram for SurgSim::DataStructures::MeshElement< N, Data >:
Collaboration graph
[legend]

Public Types

typedef std::array< size_t, N > IdType
 

Public Member Functions

 MeshElement (const std::array< size_t, N > &verticesId, const Data &data)
 Constructor. More...
 
 MeshElement (const std::array< size_t, N > &verticesId)
 Constructor where the Data is constructed by its default constructor. More...
 
bool operator== (const MeshElement< N, Data > &element) const
 Compare the element with another one (equality) More...
 
bool operator!= (const MeshElement< N, Data > &element) const
 Compare the element with another one (inequality) More...
 

Public Attributes

IdType verticesId
 Element vertices. More...
 
Data data
 Extra element data. More...
 
bool isValid
 Is this a valid element. More...
 

Detailed Description

template<size_t N, class Data>
struct SurgSim::DataStructures::MeshElement< N, Data >

Element structure for meshes.

MeshElement combines Vertices to form the structure of a mesh and can store extra per-element data.

MeshElement is to be used purely as a data structure and not provide implementation of algorithms. For example, a physics FEM's elements are not subclasses of MeshElement 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
NNumber of vertices in the element
DataType of extra data stored in the element (void for no data)
See also
Vertices

Member Typedef Documentation

template<size_t N, class Data>
typedef std::array<size_t, N> SurgSim::DataStructures::MeshElement< N, Data >::IdType

Constructor & Destructor Documentation

template<size_t N, class Data>
SurgSim::DataStructures::MeshElement< N, Data >::MeshElement ( const std::array< size_t, N > &  verticesId,
const Data &  data 
)
inline

Constructor.

Parameters
verticesIdIDs of the N element vertices
dataExtra data to be stored with the element
template<size_t N, class Data>
SurgSim::DataStructures::MeshElement< N, Data >::MeshElement ( const std::array< size_t, N > &  verticesId)
inlineexplicit

Constructor where the Data is constructed by its default constructor.

Parameters
verticesIdIDs of the N element vertices

Member Function Documentation

template<size_t N, class Data>
bool SurgSim::DataStructures::MeshElement< N, Data >::operator!= ( const MeshElement< N, Data > &  element) const
inline

Compare the element with another one (inequality)

Parameters
elementThe MeshElement to compare it to
Returns
False if the two MeshElements are equals, True otherwise
template<size_t N, class Data>
bool SurgSim::DataStructures::MeshElement< N, Data >::operator== ( const MeshElement< N, Data > &  element) const
inline

Compare the element with another one (equality)

Parameters
elementThe MeshElement to compare it to
Returns
True if the two MeshElements are equals, False otherwise

Member Data Documentation

template<size_t N, class Data>
Data SurgSim::DataStructures::MeshElement< N, Data >::data

Extra element data.

template<size_t N, class Data>
bool SurgSim::DataStructures::MeshElement< N, Data >::isValid

Is this a valid element.

template<size_t N, class Data>
IdType SurgSim::DataStructures::MeshElement< N, Data >::verticesId

Element vertices.


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