16 #ifndef SURGSIM_DATASTRUCTURES_VERTICES_H 17 #define SURGSIM_DATASTRUCTURES_VERTICES_H 29 namespace DataStructures
49 template <
class VertexData>
140 for (
size_t i = 0; i <
m_vertices.size(); ++i)
156 return (
typeid(*
this) ==
typeid(mesh)) &&
isEqual(mesh);
164 return (
typeid(*
this) !=
typeid(mesh)) || !
isEqual(mesh);
205 #endif // SURGSIM_DATASTRUCTURES_VERTICES_H Definition: DriveElementFromInputBehavior.cpp:27
std::vector< VertexType > m_vertices
Vertices.
Definition: Vertices.h:198
size_t getNumVertices() const
Returns the number of vertices in this mesh.
Definition: Vertices.h:91
Vertices()
Constructor. The mesh is initially empty (no vertices).
Definition: Vertices.h:57
const std::vector< VertexType > & getVertices() const
Returns a vector containing the position of each vertex.
Definition: Vertices.h:108
const VertexType & getVertex(size_t id) const
Returns the specified vertex.
Definition: Vertices.h:97
#define SURGSIM_ASSERT(condition)
Assert that condition is true.
Definition: Assert.h:77
virtual bool isEqual(const Vertices &mesh) const
Internal comparison of meshes of the same type: returns true if equal, false if not equal...
Definition: Vertices.h:178
void setVertexPositions(const std::vector< SurgSim::Math::Vector3d > &positions, bool doUpdate=true)
Sets the position of each vertex.
Definition: Vertices.h:136
virtual void doClearVertices()
Remove all vertices from the mesh.
Definition: Vertices.h:169
Vertex structure for meshes.
Definition: Vertex.h:44
void update()
Performs any updates that are required when the vertices are modified.
Definition: Vertices.h:73
void setVertexPosition(size_t id, const SurgSim::Math::Vector3d &position)
Sets the position of a vertex.
Definition: Vertices.h:121
bool operator!=(const Vertices &mesh) const
Compares the mesh with another one (inequality)
Definition: Vertices.h:162
The header that provides the assertion API.
size_t addVertex(const VertexType &vertex)
Adds a vertex to the mesh.
Definition: Vertices.h:84
void clear()
Clear mesh to return to an empty state (no vertices).
Definition: Vertices.h:66
virtual void doUpdate()
Performs any updates that are required when the vertices are modified.
Definition: Vertices.h:193
Vertex< VertexData > VertexType
Vertex type for convenience.
Definition: Vertices.h:54
std::vector< VertexType > & getVertices()
Returns a vector containing the position of each vertex (non const version).
Definition: Vertices.h:113
Eigen::Matrix< double, 3, 1 > Vector3d
A 3D vector of doubles.
Definition: Vector.h:56
VertexType & getVertex(size_t id)
Returns the specified vertex (non const version).
Definition: Vertices.h:102
const SurgSim::Math::Vector3d & getVertexPosition(size_t id) const
Returns the position of a vertex.
Definition: Vertices.h:128
virtual ~Vertices()
Destructor.
Definition: Vertices.h:61
Base class for mesh structures, handling basic vertex functionality.
Definition: Vertices.h:50
bool operator==(const Vertices &mesh) const
Compares the mesh with another one (equality)
Definition: Vertices.h:154
virtual void doClear()
Clear mesh to return to an empty state (no vertices).
Definition: Vertices.h:185