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

Mesh for testing using MockVertexData. More...

#include <MockObjects.h>

Inheritance diagram for MockMesh:
SurgSim::DataStructures::Vertices< MockVertexData >

Public Types

typedef Vertices< MockVertexData >::VertexType VertexType
 Vertex type for convenience.
 
- Public Types inherited from SurgSim::DataStructures::Vertices< MockVertexData >
typedef Vertex< MockVertexDataVertexType
 Vertex type for convenience.
 

Public Member Functions

 MockMesh ()
 Constructor. Start out with no vertices and 0 updates.
 
virtual ~MockMesh ()
 Destructor.
 
size_t createVertex (const SurgSim::Math::Vector3d &position, const SurgSim::Math::Vector3d &normal)
 Create a new vertex 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::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::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

Mesh for testing using MockVertexData.

Member Function Documentation

§ createVertex()

size_t MockMesh::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: