gepetto::viewer::Node Class Referenceabstract

Abstract base class of 3D objects in a scene. More...

#include <gepetto/viewer/node.h>

Inheritance diagram for gepetto::viewer::Node:
[legend]
Collaboration diagram for gepetto::viewer::Node:
[legend]

Public Member Functions

const ConfigurationgetGlobalTransform () const
 returns rotation and position of the node in word frame More...
 
std::string getID () const
 getID is a public method for getting the id_name of the Object More...
 
bool isDirty () const
 
void setDirty (bool dirty=true)
 Called when a property is modified. More...
 
void applyConfiguration (const osgVector3 &position, const osgQuat &quat)
 Apply a new global configuration. More...
 
void applyConfiguration (const Configuration &cfg)
 Apply a new global configuration. More...
 
void setStaticTransform (const osgVector3 &position, const osgQuat &quat)
 Set Static transformation. More...
 
osgQuat getStaticRotation () const
 Get Static rotation. More...
 
osgVector3 getStaticPosition () const
 Get Static position. More...
 
virtual void setVisibilityMode (const VisibilityMode &visibility_state)
 Virtual method for setting the visibility mode of the object : visible or not visible. More...
 
virtual const VisibilityModegetVisibilityMode () const
 
virtual void setLightingMode (const LightingMode &lighting_state)
 Virtual method for setting the lighting mode of the object : influence by light or not. More...
 
virtual LightingMode getLightingMode () const
 
virtual void setWireFrameMode (const WireFrameMode &wireframe_state)
 Virtual method for setting the wireframe mode of the object : visible or not. More...
 
virtual const WireFrameModegetWireFrameMode () const
 
virtual void setScale (float scale)
 Set scale value of the OSG object. More...
 
virtual void setScale (const osgVector3 &scale)
 Set scales value of the OSG object. More...
 
osgVector3 getScale () const
 Get scale. More...
 
virtual void setColor (const osgVector4 &color)=0
 Set the color of the object. More...
 
virtual osg::ref_ptr< osg::Node > getOsgNode () const
 
virtual ::osg::GroupRefPtr asGroup () const
 Return the root node to include it in the scene. More...
 
virtual void addLandmark (const float &size)
 
bool hasLandmark () const
 
::osg::StateSetRefPtr getOrCreateRootStateSet ()
 
void deleteLandmark ()
 
bool getHighlightEnabled () const
 
void setHighlightEnabled (bool enabled)
 
void setHighlightState (unsigned int state)
 
const std::size_t & getHighlightState () const
 
virtual void setAlpha (const float &alpha)
 
virtual float getAlpha () const
 
virtual void traverse (NodeVisitor &visitor)
 
virtual ~Node ()
 
- Public Member Functions inherited from gepetto::viewer::Properties
template<typename T >
bool getProperty (const std::string &name, T &value) const
 
template<typename T >
bool setProperty (const std::string &name, const T &value)
 
bool hasProperty (const std::string &name) const
 
const PropertyMap_tproperties () const
 
void addProperty (const PropertyPtr_t &prop)
 
void addProperty (const std::string &name, const PropertyPtr_t &prop)
 

Public Attributes

 SCENE_VIEWER_ACCEPT_VISITOR
 

Protected Member Functions

 Node (const std::string &name)
 Default constructor. More...
 
 Node (const Node &other)
 Copy constructor. More...
 
::osg::GroupRefPtr asQueue () const
 Return the root node to include it in the scene. More...
 
void setID (const std::string &id_name)
 
- Protected Member Functions inherited from gepetto::viewer::Properties
const PropertyPtr_t & property (const std::string &name) const
 

Protected Attributes

::osg::GeodeRefPtr landmark_geode_ptr_
 protected because it's used in LeafNodeCapsule More...
 
::osg::GeodeRefPtr geode_ptr_
 Geode pointer for landmarks. More...
 
float alpha_
 Alpha value. More...
 
- Protected Attributes inherited from gepetto::viewer::Properties
PropertyMap_t properties_
 

Friends

class NodeTest
 

Detailed Description

Abstract base class of 3D objects in a scene.

Constructor & Destructor Documentation

gepetto::viewer::Node::Node ( const std::string &  name)
protected

Default constructor.

gepetto::viewer::Node::Node ( const Node other)
protected

Copy constructor.

virtual gepetto::viewer::Node::~Node ( )
virtual

Member Function Documentation

virtual void gepetto::viewer::Node::addLandmark ( const float &  size)
virtual

Referenced by asGroup().

void gepetto::viewer::Node::applyConfiguration ( const osgVector3 position,
const osgQuat quat 
)

Apply a new global configuration.

Referenced by applyConfiguration(), and setDirty().

void gepetto::viewer::Node::applyConfiguration ( const Configuration cfg)
inline
virtual ::osg::GroupRefPtr gepetto::viewer::Node::asGroup ( ) const
inline

Return the root node to include it in the scene.

References addLandmark(), and hasLandmark().

::osg::GroupRefPtr gepetto::viewer::Node::asQueue ( ) const
inlineprotected

Return the root node to include it in the scene.

void gepetto::viewer::Node::deleteLandmark ( )

Referenced by getOrCreateRootStateSet().

virtual float gepetto::viewer::Node::getAlpha ( ) const
virtual

Reimplemented in gepetto::viewer::NodeDrawable.

Referenced by getHighlightState().

const Configuration& gepetto::viewer::Node::getGlobalTransform ( ) const

returns rotation and position of the node in word frame

Referenced by setID().

bool gepetto::viewer::Node::getHighlightEnabled ( ) const
inline
const std::size_t& gepetto::viewer::Node::getHighlightState ( ) const
inline

References getAlpha(), and setAlpha().

std::string gepetto::viewer::Node::getID ( ) const
inline

getID is a public method for getting the id_name of the Object

virtual LightingMode gepetto::viewer::Node::getLightingMode ( ) const
virtual

Referenced by getVisibilityMode().

::osg::StateSetRefPtr gepetto::viewer::Node::getOrCreateRootStateSet ( )
inline

References deleteLandmark().

virtual osg::ref_ptr<osg::Node> gepetto::viewer::Node::getOsgNode ( ) const
virtual
osgVector3 gepetto::viewer::Node::getScale ( ) const

Get scale.

Referenced by getWireFrameMode().

osgVector3 gepetto::viewer::Node::getStaticPosition ( ) const

Get Static position.

Referenced by applyConfiguration().

osgQuat gepetto::viewer::Node::getStaticRotation ( ) const

Get Static rotation.

Referenced by applyConfiguration().

virtual const VisibilityMode& gepetto::viewer::Node::getVisibilityMode ( ) const
inlinevirtual
virtual const WireFrameMode& gepetto::viewer::Node::getWireFrameMode ( ) const
inlinevirtual
bool gepetto::viewer::Node::hasLandmark ( ) const

Referenced by asGroup().

bool gepetto::viewer::Node::isDirty ( ) const
inline
virtual void gepetto::viewer::Node::setAlpha ( const float &  alpha)
virtual
void gepetto::viewer::Node::setDirty ( bool  dirty = true)
inlinevirtual

Called when a property is modified.

Implements gepetto::viewer::Properties.

References applyConfiguration().

void gepetto::viewer::Node::setHighlightEnabled ( bool  enabled)
inline

References setHighlightState().

void gepetto::viewer::Node::setHighlightState ( unsigned int  state)

Referenced by setHighlightEnabled().

void gepetto::viewer::Node::setID ( const std::string &  id_name)
inlineprotected

References getGlobalTransform().

virtual void gepetto::viewer::Node::setLightingMode ( const LightingMode lighting_state)
virtual

Virtual method for setting the lighting mode of the object : influence by light or not.

Parameters
lightingmodestate

Reimplemented in gepetto::viewer::GroupNode, and gepetto::viewer::RoadmapViewer.

Referenced by getVisibilityMode().

virtual void gepetto::viewer::Node::setScale ( float  scale)
virtual

Set scale value of the OSG object.

Reimplemented in gepetto::viewer::GroupNode.

Referenced by getWireFrameMode().

virtual void gepetto::viewer::Node::setScale ( const osgVector3 scale)
virtual

Set scales value of the OSG object.

void gepetto::viewer::Node::setStaticTransform ( const osgVector3 position,
const osgQuat quat 
)

Set Static transformation.

Referenced by applyConfiguration().

virtual void gepetto::viewer::Node::setVisibilityMode ( const VisibilityMode visibility_state)
virtual

Virtual method for setting the visibility mode of the object : visible or not visible.

Parameters
visibilitymodestate

Reimplemented in gepetto::viewer::RoadmapViewer.

Referenced by applyConfiguration().

virtual void gepetto::viewer::Node::setWireFrameMode ( const WireFrameMode wireframe_state)
virtual

Virtual method for setting the wireframe mode of the object : visible or not.

Parameters
wireframemodestate

Reimplemented in gepetto::viewer::GroupNode, and gepetto::viewer::RoadmapViewer.

Referenced by getVisibilityMode().

virtual void gepetto::viewer::Node::traverse ( NodeVisitor visitor)
virtual

Reimplemented in gepetto::viewer::GroupNode.

Friends And Related Function Documentation

friend class NodeTest
friend

Member Data Documentation

float gepetto::viewer::Node::alpha_
protected

Alpha value.

::osg::GeodeRefPtr gepetto::viewer::Node::geode_ptr_
protected

Geode pointer for landmarks.

::osg::GeodeRefPtr gepetto::viewer::Node::landmark_geode_ptr_
protected

protected because it's used in LeafNodeCapsule

gepetto::viewer::Node::SCENE_VIEWER_ACCEPT_VISITOR