SurgSim::Graphics::OsgGroup Class Reference

OSG implementation of a graphics group. More...

`#include <SurgSim/Graphics/OsgGroup.h>`

Inheritance diagram for SurgSim::Graphics::OsgGroup:

## Public Member Functions

| OsgGroup (const std::string &name)
| Constructor. More...
void | setVisible (bool visible) override
| Sets whether this group is currently visible. More...
bool | isVisible () const override
| Gets whether this group is currently visible. More...
bool | add (std::shared_ptr< Representation > representation) override
| Adds an representation. More...
bool | append (std::shared_ptr< Group > group) override
| Adds all representations in another group to this group. More...
bool | remove (std::shared_ptr< Representation > representation) override
| Removes an representation. More...
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::OsgGroup | ( | const std::string & | name | ) |

explicit

Constructor.

Parameters

  name | Name of the group

## Member Function Documentation

## add()

bool OsgGroup::add | ( | std::shared_ptr< Representation > | representation | ) |

override virtual

Adds an representation.

Parameters

  representation | Representation 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.

## append()

bool OsgGroup::append | ( | std::shared_ptr< Group > | group | ) |

override virtual

Adds all representations in another group to this group.

Parameters

  group | Group 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.

## clear()

void OsgGroup::clear | ( |  | ) |

override virtual

Removes all representations.

Reimplemented from SurgSim::Graphics::Group.

## getOsgGroup()

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

Returns the root OSG group node.

## isVisible()

bool OsgGroup::isVisible | ( |  | ) | const

override virtual

Gets whether this group is currently visible.

Returns
  True for visible, false for invisible

Implements SurgSim::Graphics::Group.

## remove()

bool OsgGroup::remove | ( | std::shared_ptr< Representation > | representation | ) |

override virtual

Removes an representation.

Parameters

  representation | Representation 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.

## setVisible()

void OsgGroup::setVisible | ( | bool | visible | ) |

override virtual

Sets whether this group is currently visible.

Parameters

  visible | True for visible, false for invisible

Implements SurgSim::Graphics::Group.

## Member Data Documentation

## m_isVisible

bool SurgSim::Graphics::OsgGroup::m_isVisible

private

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

## m_switch

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:

- SurgSim/Graphics/OsgGroup.h
- SurgSim/Graphics/OsgGroup.cpp