All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Attributes | List of all members
SurgSim::Graphics::OsgGroup Class Reference

OSG implementation of a graphics group. More...

#include <SurgSim/Graphics/OsgGroup.h>

Inheritance diagram for SurgSim::Graphics::OsgGroup:
Inheritance graph
[legend]
Collaboration diagram for SurgSim::Graphics::OsgGroup:
Collaboration graph
[legend]

Public Member Functions

 OsgGroup (const std::string &name)
 Constructor. More...
 
virtual void setVisible (bool visible) override
 Sets whether this group is currently visible. More...
 
virtual bool isVisible () const override
 Gets whether this group is currently visible. More...
 
virtual bool add (std::shared_ptr< Representation > representation) override
 Adds an representation. More...
 
virtual bool append (std::shared_ptr< Group > group) override
 Adds all representations in another group to this group. More...
 
virtual bool remove (std::shared_ptr< Representation > representation) override
 Removes an representation. More...
 
virtual void clear () override
 Removes all representations. More...
 
osg::ref_ptr< osg::Group > getOsgGroup () const
 Returns the root OSG group node. More...
 
- Public Member Functions inherited from SurgSim::Graphics::Group
 Group (const std::string &name)
 Constructor. More...
 
virtual ~Group ()
 Destructor. More...
 
const std::vector
< std::shared_ptr
< Representation > > & 
getMembers () const
 
std::string getName () const
 

Private Attributes

bool m_isVisible
 Whether the group is currently visible or not Newly added representations or groups will have this visibility. More...
 
osg::ref_ptr< osg::Switch > m_switch
 OSG group node A switch is used to provide visibility functionality. More...
 

Detailed Description

OSG implementation of a graphics group.

A Graphics::OsgGroup wraps a osg::Switch to provide group functionality.

Constructor & Destructor Documentation

OsgGroup::OsgGroup ( const std::string &  name)
explicit

Constructor.

Parameters
nameName of the group

Member Function Documentation

bool OsgGroup::add ( std::shared_ptr< Representation representation)
overridevirtual

Adds an representation.

Parameters
representationRepresentation to add to this group
Returns
True if the representation is added successfully, false if failure Only subclasses of OsgRepresentation will be added successfully.

Reimplemented from SurgSim::Graphics::Group.

bool OsgGroup::append ( std::shared_ptr< Group group)
overridevirtual

Adds all representations in another group to this group.

Parameters
groupGroup of representations to add
Returns
True if all representations are added successfully, false if failure Only subclasses of OsgGroup will be appended successfully.

Reimplemented from SurgSim::Graphics::Group.

void OsgGroup::clear ( )
overridevirtual

Removes all representations.

Reimplemented from SurgSim::Graphics::Group.

osg::ref_ptr< osg::Group > OsgGroup::getOsgGroup ( ) const

Returns the root OSG group node.

bool OsgGroup::isVisible ( ) const
overridevirtual

Gets whether this group is currently visible.

Returns
True for visible, false for invisible

Implements SurgSim::Graphics::Group.

bool OsgGroup::remove ( std::shared_ptr< Representation representation)
overridevirtual

Removes an representation.

Parameters
representationRepresentation to remove from this group
Returns
True if the representation is removed successfully, false if representation is not in this group or other failure

Reimplemented from SurgSim::Graphics::Group.

void OsgGroup::setVisible ( bool  visible)
overridevirtual

Sets whether this group is currently visible.

Parameters
visibleTrue for visible, false for invisible

Implements SurgSim::Graphics::Group.

Member Data Documentation

bool SurgSim::Graphics::OsgGroup::m_isVisible
private

Whether the group is currently visible or not Newly added representations or groups will have this visibility.

osg::ref_ptr<osg::Switch> SurgSim::Graphics::OsgGroup::m_switch
private

OSG group node A switch is used to provide visibility functionality.


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