16 #ifndef SURGSIM_GRAPHICS_OSGTEXTREPRESENTATION_H 17 #define SURGSIM_GRAPHICS_OSGTEXTREPRESENTATION_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;
111 void doUpdate(
double dt)
override;
112 bool doInitialize()
override;
137 #if defined(_MSC_VER) osg::ref_ptr< osgText::Text > m_textNode
node for text display
Definition: OsgTextRepresentation.h:119
SurgSim::Math::Vector3d m_offset
Definition: OsgTextRepresentation.h:131
Definition: CompoundShapeToGraphics.cpp:29
std::string m_text
Text set by the user.
Definition: OsgTextRepresentation.h:121
SurgSim::DataStructures::OptionalValue< double > m_optionalWidth
information about the maximum width
Definition: OsgTextRepresentation.h:123
Anchor
Definition: OsgTextRepresentation.h:92
std::shared_ptr< OsgFont > m_font
font used for rendering
Definition: OsgTextRepresentation.h:122
#define SURGSIM_CLASSNAME(ClassName)
Declare the class name of a class with the appropriate function header, do not use quotes...
Definition: Macros.h:21
osg::ref_ptr< osg::Geode > m_geode
node used to render text
Definition: OsgTextRepresentation.h:118
double m_characterSize
the font height
Definition: OsgTextRepresentation.h:125
A text to be displayed on the screen in screen space coordinates, use setPose() to set the position b...
Definition: TextRepresentation.h:39
Definition: OsgTextRepresentation.h:94
int m_anchor
Definition: OsgTextRepresentation.h:129
boost::mutex m_parameterMutex
protect changes of parameters
Definition: OsgTextRepresentation.h:127
Definition: OculusView.h:25
Eigen::Matrix< double, 4, 1 > Vector4d
A 4D vector of doubles.
Definition: Vector.h:61
Base OSG implementation of a graphics representation.
Definition: OsgRepresentation.h:55
Eigen::Matrix< double, 3, 1 > Vector3d
A 3D vector of doubles.
Definition: Vector.h:57
bool m_needUpdate
indicate whether parameters need to be updated
Definition: OsgTextRepresentation.h:128
Osg implementation of the TextRepresentation, to be used with OsgFont assets.
Definition: OsgTextRepresentation.h:56