16 #ifndef SURGSIM_DATASTRUCTURES_VERTICES_H 17 #define SURGSIM_DATASTRUCTURES_VERTICES_H 21 #include "SurgSim/DataStructures/EmptyData.h" 22 #include "SurgSim/DataStructures/Vertex.h" 30 namespace DataStructures
50 template <
class VertexData>
91 size_t addVertex(
const VertexType& vertex);
97 const VertexType&
getVertex(
size_t id)
const;
103 const std::vector<VertexType>&
getVertices()
const;
121 void setVertexPositions(
const std::vector<SurgSim::Math::Vector3d>& positions,
bool doUpdate =
true);
149 virtual void doClear();
155 virtual bool doUpdate();
158 std::vector<VertexType> m_vertices;
166 #include "SurgSim/DataStructures/Vertices-inl.h" 168 #endif // SURGSIM_DATASTRUCTURES_VERTICES_H Wraps glewInit() to separate the glew opengl definitions from the osg opengl definitions only imgui n...
Definition: AddRandomSphereBehavior.cpp:36
void transform(const Math::RigidTransform3d &pose)
Apply a rigid transform to each vertex.
Definition: Vertices-inl.h:157
size_t getNumVertices() const
Returns the number of vertices in this mesh.
Definition: Vertices-inl.h:99
virtual ~Vertices()
Destructor.
Definition: Vertices-inl.h:75
Vertices< VertexData > & operator=(const Vertices< V > &other)
Assignment when the template data is a different type In this case, no data will be copied...
Definition: Vertices-inl.h:47
bool operator==(const Vertices &mesh) const
Compares the mesh with another one (equality)
Definition: Vertices-inl.h:166
Vertices()
Constructor.
Definition: Vertices-inl.h:30
bool update()
Performs any updates that are required when the vertices are modified.
Definition: Vertices-inl.h:86
const VertexType & getVertex(size_t id) const
Returns the specified vertex.
Definition: Vertices-inl.h:105
Eigen::Matrix< double, 3, 1 > Vector3d
A 3D vector of doubles.
Definition: Vector.h:57
void setVertexPositions(const std::vector< SurgSim::Math::Vector3d > &positions, bool doUpdate=true)
Sets the position of each vertex.
Definition: Vertices-inl.h:141
Vertex structure for meshes.
Definition: Vertex.h:44
const std::vector< VertexType > & getVertices() const
Returns a vector containing the position of each vertex.
Definition: Vertices-inl.h:117
void setVertexPosition(size_t id, const SurgSim::Math::Vector3d &position)
Sets the position of a vertex.
Definition: Vertices-inl.h:129
Definitions of small fixed-size vector types.
size_t addVertex(const VertexType &vertex)
Adds a vertex to the mesh.
Definition: Vertices-inl.h:92
void clear()
Clear mesh to return to an empty state (no vertices).
Definition: Vertices-inl.h:80
Vertex< VertexData > VertexType
Vertex type for convenience.
Definition: Vertices.h:55
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-inl.h:184
virtual void doClearVertices()
Remove all vertices from the mesh.
Definition: Vertices-inl.h:178
const SurgSim::Math::Vector3d & getVertexPosition(size_t id) const
Returns the position of a vertex.
Definition: Vertices-inl.h:135
Base class for mesh structures, handling basic vertex functionality.
Definition: Vertices.h:51
bool operator!=(const Vertices &mesh) const
Compares the mesh with another one (inequality)
Definition: Vertices-inl.h:172