16 #ifndef SURGSIM_GRAPHICS_OSGCURVEREPRESENTATION_H 17 #define SURGSIM_GRAPHICS_OSGCURVEREPRESENTATION_H 19 #include "SurgSim/Graphics/CurveRepresentation.h" 20 #include "SurgSim/Graphics/OsgRepresentation.h" 23 #include <osg/ref_ptr> 27 #pragma warning(disable:4250) 42 SURGSIM_STATIC_REGISTRATION(OsgCurveRepresentation)
44 class OsgCurveRepresentation : public OsgRepresentation, public CurveRepresentation
52 explicit OsgCurveRepresentation(
const std::string& name);
54 ~OsgCurveRepresentation();
58 bool doInitialize()
override;
60 bool doWakeUp()
override;
62 void doUpdate(
double dt)
override;
64 void setSubdivisions(
size_t num)
override;
66 size_t getSubdivisions()
const override;
68 void setTension(
double tension)
override;
70 double getTension()
const override;
74 Math::Vector4d getColor()
const override;
76 void setWidth(
double width)
override;
78 double getWidth()
const override;
80 void setAntiAliasing(
bool val)
override;
82 bool isAntiAliasing()
const override;
88 void updateGraphics(
const DataStructures::VerticesPlain& controlPoints);
92 osg::ref_ptr<osg::Geometry> m_geometry;
93 osg::ref_ptr<osg::Vec3Array> m_vertexData;
94 osg::ref_ptr<osg::Vec3Array> m_normalData;
95 osg::ref_ptr<osg::DrawArrays> m_drawArrays;
100 Math::Vector4d m_color;
101 size_t m_subdivision;
108 std::vector<Math::Vector3d> m_controlPoints;
109 std::vector<Math::Vector3d> m_vertices;
114 #if defined(_MSC_VER) Wraps glewInit() to separate the glew opengl definitions from the osg opengl definitions only imgui n...
Definition: AddRandomSphereBehavior.cpp:36
Eigen::Matrix< double, 4, 1 > Vector4d
A 4D vector of doubles.
Definition: Vector.h:61
Definition: OsgImGuiHandler.h:8
Implements the CurveRepresentation for OpenSceneGraph, it uses Catmull Rom interpolation, to draw the line as a GL_LINESTRIP.
Definition: OsgCurveRepresentation.h:47