Go to the documentation of this file.
16 #ifndef SURGSIM_GRAPHICS_OSGCURVEREPRESENTATION_H
17 #define SURGSIM_GRAPHICS_OSGCURVEREPRESENTATION_H
23 #include <osg/ref_ptr>
27 #pragma warning(disable:4250)
42 SURGSIM_STATIC_REGISTRATION(OsgCurveRepresentation)
44 class OsgCurveRepresentation :
public OsgRepresentation,
public CurveRepresentation
76 void setWidth(
double width)
override;
114 #if defined(_MSC_VER)
void setColor(const SurgSim::Math::Vector4d &color) override
Sets the color for the curve.
Definition: OsgCurveRepresentation.cpp:193
void setAntiAliasing(bool val) override
Sets up whether to use anti aliasing on the curve or not.
Definition: OsgCurveRepresentation.cpp:173
osg::ref_ptr< osg::Vec3Array > m_normalData
Definition: OsgCurveRepresentation.h:94
bool doWakeUp() override
Interface to be implemented by derived classes.
Definition: OsgCurveRepresentation.cpp:80
osg::ref_ptr< osg::Geometry > m_geometry
Definition: OsgCurveRepresentation.h:92
bool doInitialize() override
Interface to be implemented by derived classes.
Definition: OsgCurveRepresentation.cpp:75
double m_width
Definition: OsgCurveRepresentation.h:103
void setWidth(double width) override
Sets the line width to be used for drawing this curve.
Definition: OsgCurveRepresentation.cpp:161
size_t m_subdivision
Definition: OsgCurveRepresentation.h:101
Definition: OculusView.h:25
Vertices< EmptyData > VerticesPlain
Definition: Vertices.h:161
SURGSIM_CLASSNAME(SurgSim::Graphics::OsgCurveRepresentation)
std::vector< Math::Vector3d > m_controlPoints
Definition: OsgCurveRepresentation.h:108
void doUpdate(double dt) override
Definition: OsgCurveRepresentation.cpp:85
Definition: CompoundShapeToGraphics.cpp:29
~OsgCurveRepresentation()
Definition: OsgCurveRepresentation.cpp:71
void setSubdivisions(size_t num) override
Sets the number of intermediate points the get generated between each two control points.
Definition: OsgCurveRepresentation.cpp:94
std::vector< Math::Vector3d > m_vertices
Definition: OsgCurveRepresentation.h:109
void setTension(double tension) override
Sets the tension (tau) parameter of the Catmull Rom interpolation, needs to be between 0....
Definition: OsgCurveRepresentation.cpp:104
Eigen::Matrix< double, 4, 1 > Vector4d
A 4D vector of doubles.
Definition: Vector.h:61
double getTension() const override
Definition: OsgCurveRepresentation.cpp:109
size_t getSubdivisions() const override
Definition: OsgCurveRepresentation.cpp:99
OsgCurveRepresentation(const std::string &name)
Constructor.
Definition: OsgCurveRepresentation.cpp:39
Implements the CurveRepresentation for OpenSceneGraph, it uses Catmull Rom interpolation,...
Definition: OsgCurveRepresentation.h:47
osg::ref_ptr< osg::DrawArrays > m_drawArrays
Definition: OsgCurveRepresentation.h:95
Math::Vector4d m_color
Definition: OsgCurveRepresentation.h:100
double m_tension
Definition: OsgCurveRepresentation.h:102
double getWidth() const override
Definition: OsgCurveRepresentation.cpp:168
Math::Vector4d getColor() const override
Definition: OsgCurveRepresentation.cpp:206
void updateGraphics(const DataStructures::VerticesPlain &controlPoints)
Update the OSG structure with the information of the control points.
Definition: OsgCurveRepresentation.cpp:114
bool isAntiAliasing() const override
Definition: OsgCurveRepresentation.cpp:188
osg::ref_ptr< osg::Vec3Array > m_vertexData
Definition: OsgCurveRepresentation.h:93