OpenWalnut  1.5.0dev
Public Member Functions | Private Member Functions | Private Attributes | List of all members
WRulerOrtho Class Reference

class to implement rulers orthogonally More...

#include <WRulerOrtho.h>

+ Inheritance diagram for WRulerOrtho:
+ Collaboration diagram for WRulerOrtho:

Public Member Functions

 WRulerOrtho (std::shared_ptr< WCoordConverter >coordConverter, osg::Vec3 origin, scaleMode mode, bool showNumbers=true)
 standard constructor More...
 
 ~WRulerOrtho ()
 destructor More...
 
- Public Member Functions inherited from WRuler
 WRuler ()
 standard constructor More...
 
 ~WRuler ()
 destructor More...
 

Private Member Functions

void create ()
 creates the osg node for the ruler representation More...
 
void addLabel (osg::Vec3 position, std::string text)
 helper function to add a label to the ruler More...
 
osg::ref_ptr< osg::Geometry > createXY ()
 Helper function to create the ruler along the x axis. More...
 
osg::ref_ptr< osg::Geometry > createXZ ()
 Helper function to create the ruler along the x axis. More...
 
osg::ref_ptr< osg::Geometry > createYX ()
 Helper function to create the ruler along the y axis. More...
 
osg::ref_ptr< osg::Geometry > createYZ ()
 Helper function to create the ruler along the y axis. More...
 
osg::ref_ptr< osg::Geometry > createZX ()
 Helper function to create the ruler along the z axis. More...
 
osg::ref_ptr< osg::Geometry > createZY ()
 Helper function to create the ruler along the z axis. More...
 
std::string numberToString (int number)
 converts a number into a string according to the currently selected coordinate system More...
 

Private Attributes

std::shared_ptr< WCoordConverterm_coordConverter
 stores pointer to a coordinate converter More...
 
osg::Vec3 m_origin
 Origin of the ruler, it will be drawn in the positive direction. More...
 
scaleMode m_scaleMode
 orientation of ruler More...
 
bool m_showNumbers
 flag to indicate wether to show number labels More...
 
WVector3d m_lb
 = m_coordConverter->getBoundingBox().first; More...
 
WVector3d m_ub
 = m_coordConverter->getBoundingBox().second; More...
 

Detailed Description

class to implement rulers orthogonally

Definition at line 51 of file WRulerOrtho.h.

Constructor & Destructor Documentation

◆ WRulerOrtho()

WRulerOrtho::WRulerOrtho ( std::shared_ptr< WCoordConverter coordConverter,
osg::Vec3  origin,
scaleMode  mode,
bool  showNumbers = true 
)

standard constructor

Parameters
coordConverter
origin
mode
showNumbers

Definition at line 38 of file WRulerOrtho.cpp.

References create(), m_coordConverter, m_lb, and m_ub.

+ Here is the call graph for this function:

◆ ~WRulerOrtho()

WRulerOrtho::~WRulerOrtho ( )

destructor

Definition at line 51 of file WRulerOrtho.cpp.

Member Function Documentation

◆ addLabel()

void WRulerOrtho::addLabel ( osg::Vec3  position,
std::string  text 
)
private

helper function to add a label to the ruler

Parameters
positionposition of thelabel
texttext

Definition at line 100 of file WRulerOrtho.cpp.

References WPathHelper::getAllFonts().

Referenced by createXY(), createXZ(), createYX(), createYZ(), createZX(), and createZY().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ create()

void WRulerOrtho::create ( )
private

creates the osg node for the ruler representation

Definition at line 55 of file WRulerOrtho.cpp.

References createXY(), createXZ(), createYX(), createYZ(), createZX(), createZY(), and m_scaleMode.

Referenced by WRulerOrtho().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ createXY()

osg::ref_ptr< osg::Geometry > WRulerOrtho::createXY ( )
private

Helper function to create the ruler along the x axis.

Returns
A part of the geometry of the ruler

Definition at line 126 of file WRulerOrtho.cpp.

References addLabel(), m_coordConverter, m_lb, m_origin, m_showNumbers, m_ub, numberToString(), and string_utils::toString().

Referenced by create().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ createXZ()

osg::ref_ptr< osg::Geometry > WRulerOrtho::createXZ ( )
private

Helper function to create the ruler along the x axis.

Returns
A part of the geometry of the ruler

Definition at line 200 of file WRulerOrtho.cpp.

References addLabel(), m_coordConverter, m_lb, m_origin, m_showNumbers, m_ub, numberToString(), and string_utils::toString().

Referenced by create().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ createYX()

osg::ref_ptr< osg::Geometry > WRulerOrtho::createYX ( )
private

Helper function to create the ruler along the y axis.

Returns
A part of the geometry of the ruler

Definition at line 273 of file WRulerOrtho.cpp.

References addLabel(), m_coordConverter, m_lb, m_origin, m_showNumbers, m_ub, numberToString(), and string_utils::toString().

Referenced by create().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ createYZ()

osg::ref_ptr< osg::Geometry > WRulerOrtho::createYZ ( )
private

Helper function to create the ruler along the y axis.

Returns
A part of the geometry of the ruler

Definition at line 348 of file WRulerOrtho.cpp.

References addLabel(), m_coordConverter, m_lb, m_origin, m_showNumbers, m_ub, numberToString(), and string_utils::toString().

Referenced by create().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ createZX()

osg::ref_ptr< osg::Geometry > WRulerOrtho::createZX ( )
private

Helper function to create the ruler along the z axis.

Returns
A part of the geometry of the ruler

Definition at line 423 of file WRulerOrtho.cpp.

References addLabel(), m_coordConverter, m_lb, m_origin, m_showNumbers, m_ub, numberToString(), and string_utils::toString().

Referenced by create().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ createZY()

osg::ref_ptr< osg::Geometry > WRulerOrtho::createZY ( )
private

Helper function to create the ruler along the z axis.

Returns
A part of the geometry of the ruler

Definition at line 498 of file WRulerOrtho.cpp.

References addLabel(), m_coordConverter, m_lb, m_origin, m_showNumbers, m_ub, numberToString(), and string_utils::toString().

Referenced by create().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ numberToString()

std::string WRulerOrtho::numberToString ( int  number)
private

converts a number into a string according to the currently selected coordinate system

Parameters
number
Returns
string

Definition at line 573 of file WRulerOrtho.cpp.

References m_coordConverter, m_scaleMode, and string_utils::toString().

Referenced by createXY(), createXZ(), createYX(), createYZ(), createZX(), and createZY().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_coordConverter

std::shared_ptr<WCoordConverter> WRulerOrtho::m_coordConverter
private

stores pointer to a coordinate converter

Definition at line 71 of file WRulerOrtho.h.

Referenced by createXY(), createXZ(), createYX(), createYZ(), createZX(), createZY(), numberToString(), and WRulerOrtho().

◆ m_lb

WVector3d WRulerOrtho::m_lb
private

= m_coordConverter->getBoundingBox().first;

Definition at line 85 of file WRulerOrtho.h.

Referenced by createXY(), createXZ(), createYX(), createYZ(), createZX(), createZY(), and WRulerOrtho().

◆ m_origin

osg::Vec3 WRulerOrtho::m_origin
private

Origin of the ruler, it will be drawn in the positive direction.

Definition at line 76 of file WRulerOrtho.h.

Referenced by createXY(), createXZ(), createYX(), createYZ(), createZX(), and createZY().

◆ m_scaleMode

scaleMode WRulerOrtho::m_scaleMode
private

orientation of ruler

Definition at line 81 of file WRulerOrtho.h.

Referenced by create(), and numberToString().

◆ m_showNumbers

bool WRulerOrtho::m_showNumbers
private

flag to indicate wether to show number labels

Definition at line 83 of file WRulerOrtho.h.

Referenced by createXY(), createXZ(), createYX(), createYZ(), createZX(), and createZY().

◆ m_ub

WVector3d WRulerOrtho::m_ub
private

= m_coordConverter->getBoundingBox().second;

Definition at line 86 of file WRulerOrtho.h.

Referenced by createXY(), createXZ(), createYX(), createYZ(), createZX(), createZY(), and WRulerOrtho().


The documentation for this class was generated from the following files: