OpenFrames
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
OpenFrames::CoordinateAxes Class Reference

A type of ReferenceFrame that displays X, Y, and Z axes. More...

#include <CoordinateAxes.hpp>

Inheritance diagram for OpenFrames::CoordinateAxes:
OpenFrames::ReferenceFrame

Public Member Functions

 CoordinateAxes (const std::string &name)
 
 CoordinateAxes (const std::string &name, float r, float g, float b, float a=1.0)
 
virtual void showContents (bool showContents)
 
virtual bool getContentsShown () const
 
void setAxisLength (double len)
 
double getAxisLength ()
 
void setDrawAxes (unsigned int axes)
 
unsigned int getDrawAxes () const
 
void setTickSpacing (double major_sp, double minor_sp)
 
double getMajorTickSpacing () const
 
double getMinorTickSpacing () const
 
void setTickSize (unsigned majorSize, unsigned int minorSize)
 
bool setTickImage (const std::string &fname)
 
bool setTickShader (const std::string &fname)
 
virtual const osg::BoundingSphere & getBound () const
 
virtual void setColor (const osg::Vec4 &color)
 
virtual void setColor (const osg::Vec4 &color)
 
virtual void setColor (float r, float g, float b, float a=1.0)
 
- Public Member Functions inherited from OpenFrames::ReferenceFrame
 ReferenceFrame (const std::string &name)
 
 ReferenceFrame (const std::string &name, const osg::Vec3 &color)
 
 ReferenceFrame (const std::string &name, const osg::Vec4 &color)
 
 ReferenceFrame (const std::string &name, float r, float g, float b, float a=1.0)
 
void setName (const std::string &name)
 
const std::string & getName () const
 
virtual void setColor (float r, float g, float b, float a=1.0)
 
virtual const osg::Vec4 & getColor () const
 
virtual void getColor (float &r, float &g, float &b, float &a) const
 
FrameTransformgetTransform () const
 
virtual osg::Group * getGroup () const
 
void setPosition (const double &x, const double &y, const double &z)
 
void setPosition (const osg::Vec3d &pos)
 
void getPosition (double &x, double &y, double &z) const
 
void getPosition (osg::Vec3d &pos) const
 
void setAttitude (const double &rx, const double &ry, const double &rz, const double &angle)
 
void setAttitude (const osg::Quat &att)
 
void getAttitude (double &rx, double &ry, double &rz, double &angle) const
 
void getAttitude (osg::Quat &att) const
 
virtual void showAxes (unsigned int axes)
 
virtual void showAxesLabels (unsigned int labels)
 
virtual void showNameLabel (bool namelabel)
 
void moveXAxis (osg::Vec3d base, double len, double headRatio=0.3, double bodyRadius=0.0, double headRadius=0.0) const
 
void moveYAxis (osg::Vec3d base, double len, double headRatio=0.3, double bodyRadius=0.0, double headRadius=0.0) const
 
void moveZAxis (osg::Vec3d base, double len, double headRatio=0.3, double bodyRadius=0.0, double headRadius=0.0) const
 
void setXLabel (const std::string &str)
 
void setYLabel (const std::string &str)
 
void setZLabel (const std::string &str)
 
bool addChild (ReferenceFrame *frame)
 
bool removeChild (ReferenceFrame *frame)
 
void setLightSourceEnabled (bool enable)
 
bool getLightSourceEnabled () const
 
osg::LightSource * getLightSource () const
 
int getNumChildren ()
 
ReferenceFramegetChild (int i)
 
void createFrameString (std::string &str, std::string prefix=" ") const
 
virtual std::string frameInfo () const
 
void addParent (ReferenceFrame *frame)
 
void removeParent (ReferenceFrame *frame)
 
int getNumParents () const
 
ReferenceFramegetParent (int i)
 
void addTracker (FrameTracker *t)
 
void removeTracker (FrameTracker *t)
 
int getNumTrackers () const
 
FrameTrackergetTracker (int i)
 
int getChildIndex (const ReferenceFrame *frame) const
 
int getParentIndex (const ReferenceFrame *frame) const
 
int getTrackerIndex (const FrameTracker *t) const
 

Protected Member Functions

void _init ()
 
void _computeTickAttenuation ()
 
void _createAxes ()
 
void resetTickShader ()
 

Protected Attributes

double _axisLength
 
double _majorTickSpacing
 
double _minorTickSpacing
 
unsigned int _drawAxes
 
osg::ref_ptr< osg::Geode > _axesGeode
 
osg::ref_ptr< osg::Geode > _tickGeode
 
osg::ref_ptr< osg::Geometry > _axesGeom
 
osg::ref_ptr< osg::Geometry > _majorTickGeom
 
osg::ref_ptr< osg::Geometry > _minorTickGeom
 
osg::ref_ptr< osg::Vec3dArray > _vertices
 
osg::ref_ptr< osg::Vec4Array > _colors
 
osg::ref_ptr< osg::Shader > _fragShader
 
- Protected Attributes inherited from OpenFrames::ReferenceFrame
std::string _name
 Name of reference frame.
 
osg::ref_ptr< Vector_xAxis
 Vector of frame's x-axis.
 
osg::ref_ptr< Vector_yAxis
 Vector of frame's y-axis.
 
osg::ref_ptr< Vector_zAxis
 Vector of frame's z-axis.
 
osg::ref_ptr< osgText::Text > _xLabel
 X-Axes label.
 
osg::ref_ptr< osgText::Text > _yLabel
 Y-Axes label.
 
osg::ref_ptr< osgText::Text > _zLabel
 Z-Axes label.
 
osg::ref_ptr< osgText::Text > _nameLabel
 Name of reference frame that is displayed.
 
osg::ref_ptr< osg::Geode > _axes
 x,y,z axes together
 
osg::ref_ptr< osg::Geode > _labels
 axes and name labels
 
osg::BoundingSphere _bound
 Frame's bounding sphere.
 
osg::ref_ptr< FrameTransform_xform
 The transform that all contained objects will undergo.
 

Additional Inherited Members

- Public Types inherited from OpenFrames::ReferenceFrame
enum  AxesType { NO_AXES = 0, X_AXIS = 1, Y_AXIS = 2, Z_AXIS = 4 }
 
typedef std::vector< ReferenceFrame * > ParentList
 
typedef std::vector< osg::ref_ptr< ReferenceFrame > > ChildList
 
typedef std::vector< FrameTracker * > TrackerList
 

Detailed Description

A type of ReferenceFrame that displays X, Y, and Z axes.

This class is a type of ReferenceFrame that displays its X, Y, and Z axes with adjustable tick marks and labels.

Member Function Documentation

◆ getBound()

virtual const osg::BoundingSphere& OpenFrames::CoordinateAxes::getBound ( ) const
virtual

Inherited from ReferenceFrame.

Reimplemented from OpenFrames::ReferenceFrame.

◆ resetTickShader()

void OpenFrames::CoordinateAxes::resetTickShader ( )
protected

Reset shader to default state

◆ setAxisLength()

void OpenFrames::CoordinateAxes::setAxisLength ( double  len)

Set/get axis length

◆ setDrawAxes()

void OpenFrames::CoordinateAxes::setDrawAxes ( unsigned int  axes)

Set which axes to draw using ReferenceFrame::AxesType

◆ setTickImage()

bool OpenFrames::CoordinateAxes::setTickImage ( const std::string &  fname)

Set tick image or shader

◆ setTickSize()

void OpenFrames::CoordinateAxes::setTickSize ( unsigned  majorSize,
unsigned int  minorSize 
)

Set/get tick size

◆ setTickSpacing()

void OpenFrames::CoordinateAxes::setTickSpacing ( double  major_sp,
double  minor_sp 
)

Set/get tick spacing


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