opensurgsim
Public Types | Public Member Functions | List of all members
MockTetrahedronMesh Class Reference

Tetrahedron Mesh for testing using MockVertexData, MockEdgeData, MockTriangleData and MockTetrahedronData. More...

#include <MockObjects.h>

Inheritance diagram for MockTetrahedronMesh:
SurgSim::DataStructures::TetrahedronMesh< MockVertexData, MockEdgeData, MockTriangleData, MockTetrahedronData > SurgSim::DataStructures::Vertices< MockVertexData >

Public Types

typedef TetrahedronMesh< MockVertexData, MockEdgeData, MockTriangleData, MockTetrahedronData >::VertexType VertexType
 Vertex type for convenience.
 
typedef TetrahedronMesh< MockVertexData, MockEdgeData, MockTriangleData, MockTetrahedronData >::EdgeType EdgeType
 Edge type for convenience.
 
typedef TetrahedronMesh< MockVertexData, MockEdgeData, MockTriangleData, MockTetrahedronData >::TriangleType TriangleType
 Triangle type for convenience.
 
typedef TetrahedronMesh< MockVertexData, MockEdgeData, MockTriangleData, MockTetrahedronData >::TetrahedronType TetrahedronType
 Tetrahedron type for convenience.
 
- Public Types inherited from SurgSim::DataStructures::TetrahedronMesh< MockVertexData, MockEdgeData, MockTriangleData, MockTetrahedronData >
typedef MeshElement< 2, MockEdgeDataEdgeType
 Edge type for convenience (Ids of the 2 vertices)
 
typedef MeshElement< 3, MockTriangleDataTriangleType
 Triangle type for convenience (Ids of the 3 vertices)
 
typedef MeshElement< 4, MockTetrahedronDataTetrahedronType
 Tetrahedron type for convenience (Ids of the 4 vertices)
 
- Public Types inherited from SurgSim::DataStructures::Vertices< MockVertexData >
typedef Vertex< MockVertexDataVertexType
 Vertex type for convenience.
 

Public Member Functions

 MockTetrahedronMesh ()
 Constructor. Start out with no vertices and 0 updates.
 
virtual ~MockTetrahedronMesh ()
 Destructor.
 
size_t createVertex (const SurgSim::Math::Vector3d &position, const SurgSim::Math::Vector3d &normal)
 Create a new vertex in the mesh. More...
 
size_t createEdge (const std::array< size_t, 2 > &vertices)
 Create a new edge in the mesh. More...
 
size_t createTriangle (const std::array< size_t, 3 > &vertices, const std::array< size_t, 3 > &edges)
 Create a new triangle in the mesh. More...
 
size_t createTetrahedron (const std::array< size_t, 4 > &vertices, const std::array< size_t, 6 > &edges, const std::array< size_t, 4 > &triangles)
 Create a new tetrahedron in the mesh. More...
 
const SurgSim::Math::Vector3dgetVertexNormal (size_t id) const
 Returns the normal of a vertex.
 
int getNumUpdates () const
 Returns the number of updates performed on the mesh.
 
- Public Member Functions inherited from SurgSim::DataStructures::TetrahedronMesh< MockVertexData, MockEdgeData, MockTriangleData, MockTetrahedronData >
 TetrahedronMesh ()
 Constructor. The mesh is initially empty (no vertices, no edges, no triangles, no tetrahedrons).
 
virtual ~TetrahedronMesh ()
 Destructor.
 
size_t addEdge (const EdgeType &edge)
 Adds an edge to the mesh. More...
 
size_t addTriangle (const TriangleType &triangle)
 Adds a triangle to the mesh. More...
 
size_t addTetrahedron (const TetrahedronType &tetrahedron)
 Adds a tetrahedron to the mesh. More...
 
size_t getNumEdges () const
 Returns the number of edges in this mesh. More...
 
size_t getNumTriangles () const
 Returns the number of triangles in this mesh. More...
 
size_t getNumTetrahedrons () const
 Returns the number of tetrahedrons in this mesh. More...
 
const std::vector< EdgeType > & getEdges () const
 Returns a vector containing the position of each edge. More...
 
std::vector< EdgeType > & getEdges ()
 Returns a vector containing the position of each edge (non const version). More...
 
const std::vector< TriangleType > & getTriangles () const
 Returns a vector containing the position of each triangle. More...
 
std::vector< TriangleType > & getTriangles ()
 Returns a vector containing the position of each triangle (non const version). More...
 
const std::vector< TetrahedronType > & getTetrahedrons () const
 Returns a vector containing the position of each tetrahedron. More...
 
std::vector< TetrahedronType > & getTetrahedrons ()
 Returns a vector containing the position of each tetrahedron (non const version). More...
 
const EdgeTypegetEdge (size_t id) const
 Returns the specified edge. More...
 
EdgeTypegetEdge (size_t id)
 Returns the specified edge (non const version). More...
 
const TriangleTypegetTriangle (size_t id) const
 Returns the specified triangle. More...
 
TriangleTypegetTriangle (size_t id)
 Returns the specified triangle (non const version). More...
 
const TetrahedronTypegetTetrahedron (size_t id) const
 Returns the specified tetrahedron. More...
 
TetrahedronTypegetTetrahedron (size_t id)
 Returns the specified tetrahedron (non const version). More...
 
bool isValid () const
 Test if the TetrahedronMesh is valid (valid vertex Ids used in all MeshElements) More...
 
- Public Member Functions inherited from SurgSim::DataStructures::Vertices< MockVertexData >
 Vertices ()
 Constructor.
 
 Vertices (const Vertices< V > &other)
 Copy constructor when the template data is a different type In this case, no data will be copied. More...
 
Vertices< MockVertexData > & operator= (const Vertices< V > &other)
 Assignment when the template data is a different type In this case, no data will be copied. More...
 
virtual ~Vertices ()
 Destructor.
 
void clear ()
 Clear mesh to return to an empty state (no vertices).
 
bool update ()
 Performs any updates that are required when the vertices are modified. More...
 
size_t addVertex (const VertexType &vertex)
 Adds a vertex to the mesh. More...
 
size_t getNumVertices () const
 Returns the number of vertices in this mesh.
 
const VertexTypegetVertex (size_t id) const
 Returns the specified vertex.
 
VertexTypegetVertex (size_t id)
 Returns the specified vertex (non const version).
 
const std::vector< VertexType > & getVertices () const
 Returns a vector containing the position of each vertex.
 
std::vector< VertexType > & getVertices ()
 Returns a vector containing the position of each vertex (non const version).
 
void setVertexPosition (size_t id, const SurgSim::Math::Vector3d &position)
 Sets the position of a vertex. More...
 
const SurgSim::Math::Vector3dgetVertexPosition (size_t id) const
 Returns the position of a vertex. More...
 
void setVertexPositions (const std::vector< SurgSim::Math::Vector3d > &positions, bool doUpdate=true)
 Sets the position of each vertex. More...
 
void transform (const Math::RigidTransform3d &pose)
 Apply a rigid transform to each vertex. More...
 
bool operator== (const Vertices &mesh) const
 Compares the mesh with another one (equality) More...
 
bool operator!= (const Vertices &mesh) const
 Compares the mesh with another one (inequality) More...
 

Additional Inherited Members

- Protected Member Functions inherited from SurgSim::DataStructures::TetrahedronMesh< MockVertexData, MockEdgeData, MockTriangleData, MockTetrahedronData >
virtual void doClearEdges ()
 Remove all edges from the mesh.
 
virtual void doClearTriangles ()
 Remove all triangles from the mesh.
 
virtual void doClearTetrahedrons ()
 Remove all tetrahedrons from the mesh.
 
virtual bool isEqual (const Vertices< MockVertexData > &mesh) const
 Internal comparison of meshes of the same type: returns true if equal, false if not equal. More...
 
- Protected Member Functions inherited from SurgSim::DataStructures::Vertices< MockVertexData >
virtual void doClearVertices ()
 Remove all vertices from the mesh.
 
virtual bool isEqual (const Vertices &mesh) const
 Internal comparison of meshes of the same type: returns true if equal, false if not equal. More...
 

Detailed Description

Tetrahedron Mesh for testing using MockVertexData, MockEdgeData, MockTriangleData and MockTetrahedronData.

Member Function Documentation

§ createEdge()

size_t MockTetrahedronMesh::createEdge ( const std::array< size_t, 2 > &  vertices)
inline

Create a new edge in the mesh.

Parameters
verticesEdge vertices (x2)
Returns
Unique ID of vertex in the mesh

§ createTetrahedron()

size_t MockTetrahedronMesh::createTetrahedron ( const std::array< size_t, 4 > &  vertices,
const std::array< size_t, 6 > &  edges,
const std::array< size_t, 4 > &  triangles 
)
inline

Create a new tetrahedron in the mesh.

Parameters
verticesconnectivity (x4)
edgesconnectivity (x6)
trianglesconnectivity (x4)
Returns
Unique ID of vertex in the mesh

§ createTriangle()

size_t MockTetrahedronMesh::createTriangle ( const std::array< size_t, 3 > &  vertices,
const std::array< size_t, 3 > &  edges 
)
inline

Create a new triangle in the mesh.

Parameters
vertices(x3)
edges(x3)
Returns
Unique ID of vertex in the mesh

§ createVertex()

size_t MockTetrahedronMesh::createVertex ( const SurgSim::Math::Vector3d position,
const SurgSim::Math::Vector3d normal 
)
inline

Create a new vertex in the mesh.

Parameters
positionPosition of the vertex
normalNormal of the vertex
Returns
Unique ID of vertex in the mesh

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