opensurgsim
|
Element structure for meshes. More...
#include <MeshElement.h>
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... | |
template<class T > | |
MeshElement (const MeshElement< N, T > &other) | |
Copy constructor when the template data is a different type In this case, no data will be copied. 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. | |
Data | data |
Extra element data. | |
bool | isValid |
Is this a valid element. | |
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.
N | Number of vertices in the element |
Data | Type of extra data stored in the element (void for no data) |
|
inline |
Constructor.
verticesId | IDs of the N element vertices |
data | Extra data to be stored with the element |
|
inlineexplicit |
Constructor where the Data is constructed by its default constructor.
verticesId | IDs of the N element vertices |
|
inlineexplicit |
Copy constructor when the template data is a different type In this case, no data will be copied.
T | type of data stored in the other MeshElement |
other | the MeshElement to copy from |
|
inline |
Compare the element with another one (inequality)
element | The MeshElement to compare it to |
|
inline |
Compare the element with another one (equality)
element | The MeshElement to compare it to |