16 #ifndef SURGSIM_GRAPHICS_OSGTEXTREPRESENTATION_H 17 #define SURGSIM_GRAPHICS_OSGTEXTREPRESENTATION_H 21 #include "SurgSim/Graphics/OsgRepresentation.h" 22 #include "SurgSim/Graphics/TextRepresentation.h" 23 #include "SurgSim/DataStructures/OptionalValue.h" 26 #include <boost/thread/mutex.hpp> 30 #pragma warning(disable:4250) 53 SURGSIM_STATIC_REGISTRATION(OsgTextRepresentation);
66 friend class OsgTextRepresentationTests_MaximumWidth_Test;
70 void setLocation(
double x,
double y)
override;
71 void getLocation(
double* x,
double* y)
const override;
73 void setMaximumWidth(
double width)
override;
74 double getMaximumWidth()
override;
76 void setText(
const std::string& text)
override;
77 std::string getText()
const override;
79 void loadFont(
const std::string& fileName)
override;
80 void setFont(std::shared_ptr<SurgSim::Framework::Asset> font)
override;
81 std::shared_ptr<Font> getFont()
const override;
86 void setFontSize(
double size)
override;
87 double getFontSize()
const override;
89 void setUseScreenSpace(
bool value)
override;
90 bool isUsingScreenSpace()
const override;
98 void setAnchor(
int anchor);
99 int getAnchor()
const;
101 void setDrawBackground(
bool value)
override;
102 bool isDrawingBackground()
const override;
107 void setBackgroundMargin(
double margin)
override;
108 double getBackgroundMargin()
const override;
110 static std::shared_ptr<OsgMaterial> getDefaultMaterial();
114 void doUpdate(
double dt)
override;
115 bool doInitialize()
override;
121 osg::ref_ptr<osg::Geode> m_geode;
122 osg::ref_ptr<osgText::Text> m_textNode;
125 std::shared_ptr<OsgFont> m_font;
128 double m_characterSize;
132 boost::mutex m_parameterMutex;
141 #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
Eigen::Matrix< double, 3, 1 > Vector3d
A 3D vector of doubles.
Definition: Vector.h:57
A text to be displayed on the screen in screen space coordinates, use setPose() to set the position b...
Definition: TextRepresentation.h:39
Definition: OsgImGuiHandler.h:8
Base OSG implementation of a graphics representation.
Definition: OsgRepresentation.h:55
Osg implementation of the TextRepresentation, to be used with OsgFont assets.
Definition: OsgTextRepresentation.h:56