cherish
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
entity::ToolGlobal Class Referenceabstract

An abstract class that denotes tool functionality and scene graph. The base tool entity has a starter scene graph structure, however, it is assumed that inherited class will redefine and fill the gaps within that structure. The base structure is as follows: More...

#include <ToolGlobal.h>

Inheritance diagram for entity::ToolGlobal:
osg::ProtectedGroup entity::AxisGlobalTool entity::BookmarkTool entity::FrameTool

Public Member Functions

 ToolGlobal (int nVerts, osg::Array::Binding colorBind, osg::PrimitiveSet *primitiveSet, float linewidth=3.f)
 
virtual void setVertices (const std::vector< osg::Vec3f > &source)
 
virtual const osg::Vec3Array * getVertices () const
 
virtual void setColor (const osg::Vec4f &color)
 
virtual const osg::Vec4f & getColor () const
 
virtual void setVisibility (bool on)=0
 
virtual bool getVisibility () const =0
 
osg::Geode * getGeodeWire () const
 
osg::Vec3f getCenterLocal () const
 
- Public Member Functions inherited from osg::ProtectedGroup
 ProtectedGroup (const ProtectedGroup &group, const osg::CopyOp &copyop=osg::CopyOp::SHALLOW_COPY)
 

Protected Member Functions

virtual void initializeSG ()=0
 
void updateGeometry ()
 
void updateGeometry (osg::Geometry *geom)
 

Protected Attributes

osg::Switch * m_switch
 
osg::Geode * m_geodeWire
 
osg::Geometry * m_geomWire
 

Detailed Description

An abstract class that denotes tool functionality and scene graph. The base tool entity has a starter scene graph structure, however, it is assumed that inherited class will redefine and fill the gaps within that structure. The base structure is as follows:

ToolGlobal -> Switch -> ... WireGeode

While the wire geode is initialized, it is not a part of the scene graph yet. The inhereted class are assumed to connect the dots between the switch and the wire geode.

Constructor & Destructor Documentation

§ ToolGlobal()

entity::ToolGlobal::ToolGlobal ( int  nVerts,
osg::Array::Binding  colorBind,
osg::PrimitiveSet *  primitiveSet,
float  linewidth = 3.f 
)

Default constructor.

Parameters
nVertsis the number of vertices that basic geometry will have
colorBindindicates whether the color bind is per vertex, or overall
primitiveSetis the type of geometry used, e.g., polilyne
linewidthis not mandatary, but indicates the line width of a geometry. It is set to 3.f by default.

Member Function Documentation

§ getCenterLocal()

osg::Vec3f entity::ToolGlobal::getCenterLocal ( ) const

A method to obtain local 2D center of the wire geometry. It is assumed to be used within entity::Canvas tool mainly.

§ getColor()

const osg::Vec4f & entity::ToolGlobal::getColor ( ) const
virtual

A method to obtain a color of the wire geometry.

§ getGeodeWire()

osg::Geode * entity::ToolGlobal::getGeodeWire ( ) const

A method to obtain a pointer on wire geode.

§ getVertices()

const osg::Vec3Array * entity::ToolGlobal::getVertices ( ) const
virtual

A getter method to obtain a pointer on vertex array of a wire geode.

§ getVisibility()

virtual bool entity::ToolGlobal::getVisibility ( ) const
pure virtual

A method to obtain visibility of the whole tool.

Implemented in entity::FrameTool, entity::AxisGlobalTool, and entity::BookmarkTool.

§ initializeSG()

virtual void entity::ToolGlobal::initializeSG ( )
protectedpure virtual

A method that assures full initialization of a scene graph, i.e., provide a filling structure between a switch and a wire geode variables. Must be re-defined in inhereted classes.

Implemented in entity::FrameTool, entity::AxisGlobalTool, and entity::BookmarkTool.

§ setColor()

void entity::ToolGlobal::setColor ( const osg::Vec4f &  color)
virtual

A method to set a specify color to a wire geometry.

§ setVertices()

void entity::ToolGlobal::setVertices ( const std::vector< osg::Vec3f > &  source)
virtual

A setter method to set vertex array of wire geode.

§ setVisibility()

virtual void entity::ToolGlobal::setVisibility ( bool  on)
pure virtual

A method to set visibility of the whole tool.

Implemented in entity::FrameTool, entity::AxisGlobalTool, and entity::BookmarkTool.

Member Data Documentation

§ m_geodeWire

osg::Geode* entity::ToolGlobal::m_geodeWire
protected

contains all the geometry and color properties

§ m_geomWire

osg::Geometry* entity::ToolGlobal::m_geomWire
protected

is contained in m_geodeWire and contains all the geometries

§ m_switch

osg::Switch* entity::ToolGlobal::m_switch
protected

switch is responsible for visibility of the tool


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