31 #include <osgText/Text>
33 #include "WCoordConverter.h"
35 #include "core/common/math/linearAlgebra/WVectorFixed.h"
39 RULER_ALONG_X_AXIS_SCALE_Y = 0,
40 RULER_ALONG_X_AXIS_SCALE_Z,
41 RULER_ALONG_Y_AXIS_SCALE_X,
42 RULER_ALONG_Y_AXIS_SCALE_Z,
43 RULER_ALONG_Z_AXIS_SCALE_X,
44 RULER_ALONG_Z_AXIS_SCALE_Y
61 WRulerOrtho( std::shared_ptr<WCoordConverter>coordConverter, osg::Vec3 origin, scaleMode mode,
bool showNumbers =
true );
100 void addLabel( osg::Vec3 position, std::string text );
107 osg::ref_ptr< osg::Geometry >
createXY();
114 osg::ref_ptr< osg::Geometry >
createXZ();
121 osg::ref_ptr< osg::Geometry >
createYX();
128 osg::ref_ptr< osg::Geometry >
createYZ();
135 osg::ref_ptr< osg::Geometry >
createZX();
142 osg::ref_ptr< osg::Geometry >
createZY();
class to implement rulers orthogonally
void create()
creates the osg node for the ruler representation
std::shared_ptr< WCoordConverter > m_coordConverter
stores pointer to a coordinate converter
bool m_showNumbers
flag to indicate wether to show number labels
osg::ref_ptr< osg::Geometry > createXZ()
Helper function to create the ruler along the x axis.
void addLabel(osg::Vec3 position, std::string text)
helper function to add a label to the ruler
osg::ref_ptr< osg::Geometry > createXY()
Helper function to create the ruler along the x axis.
osg::ref_ptr< osg::Geometry > createYZ()
Helper function to create the ruler along the y axis.
WRulerOrtho(std::shared_ptr< WCoordConverter >coordConverter, osg::Vec3 origin, scaleMode mode, bool showNumbers=true)
standard constructor
osg::ref_ptr< osg::Geometry > createZY()
Helper function to create the ruler along the z axis.
osg::ref_ptr< osg::Geometry > createZX()
Helper function to create the ruler along the z axis.
osg::ref_ptr< osg::Geometry > createYX()
Helper function to create the ruler along the y axis.
WVector3d m_lb
= m_coordConverter->getBoundingBox().first;
osg::Vec3 m_origin
Origin of the ruler, it will be drawn in the positive direction.
scaleMode m_scaleMode
orientation of ruler
WVector3d m_ub
= m_coordConverter->getBoundingBox().second;
std::string numberToString(int number)
converts a number into a string according to the currently selected coordinate system
class to implement various rulers