SurgSim::Graphics::Group Class Referenceabstract

Base graphics group class, which defines the interface that all graphics groups must implement. More...

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

Inheritance diagram for SurgSim::Graphics::Group:

## Public Member Functions

| Group (const std::string &name)
| Constructor. More...
virtual | ~Group ()
| Destructor. More...
virtual void | setVisible (bool visible)=0
| Sets whether the group is currently visible. More...
virtual bool | isVisible () const =0
| Gets whether the group is currently visible. More...
virtual bool | add (std::shared_ptr< Representation > representation)
| Adds an representation. More...
virtual bool | append (std::shared_ptr< Group > group)
| Adds all representations in another group to this group. More...
virtual bool | remove (std::shared_ptr< Representation > representation)
| Removes an representation. More...
const std::vector< std::shared_ptr< Representation > > & | getMembers () const
virtual void | clear ()
| Removes all representations. More...
std::string | getName () const

## Private Attributes

std::string | m_name
std::vector< std::shared_ptr< Representation > > | m_representations
| Representations in this group. More...

## Detailed Description

Base graphics group class, which defines the interface that all graphics groups must implement.

Graphics::Group allows the organization of Graphics::Representation objects so that different algorithms can operate on specific sub-sets rather than the entire scene.

## Constructor & Destructor Documentation

## Group()

SurgSim::Graphics::Group::Group | ( | const std::string & | name | ) |

explicit

Constructor.

The group is initially empty.

Parameters

  name | Name of the group, this has to be unique over the whole system, otherwise adding the group will fail

## ~Group()

SurgSim::Graphics::Group::~Group | ( |  | ) |

virtual

Destructor.

## Member Function Documentation

## add()

bool SurgSim::Graphics::Group::add | ( | std::shared_ptr< Representation > | representation | ) |

virtual

Adds an representation.

Parameters

  representation | Representation to add to this group

Returns
  True if the representation is added successfully, false if failure

Reimplemented in SurgSim::Graphics::OsgGroup.

## append()

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

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

Reimplemented in SurgSim::Graphics::OsgGroup.

## clear()

void SurgSim::Graphics::Group::clear | ( |  | ) |

virtual

Removes all representations.

Reimplemented in SurgSim::Graphics::OsgGroup.

## getMembers()

const std::vector< std::shared_ptr< Representation > > & SurgSim::Graphics::Group::getMembers | ( |  | ) | const

Returns
  a container with all the representations in this group.

## getName()

std::string SurgSim::Graphics::Group::getName | ( |  | ) | const

Returns
  The name of this group.

## isVisible()

virtual bool SurgSim::Graphics::Group::isVisible | ( |  | ) | const

pure virtual

Gets whether the group is currently visible.

Returns
  visible True for visible, false for invisible

Implemented in SurgSim::Graphics::OsgGroup.

## remove()

bool SurgSim::Graphics::Group::remove | ( | std::shared_ptr< Representation > | representation | ) |

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 in SurgSim::Graphics::OsgGroup.

## setVisible()

virtual void SurgSim::Graphics::Group::setVisible | ( | bool | visible | ) |

pure virtual

Sets whether the group is currently visible.

Parameters

  visible | True for visible, false for invisible

Implemented in SurgSim::Graphics::OsgGroup.

## Member Data Documentation

## m_name

std::string SurgSim::Graphics::Group::m_name

private

## m_representations

std::vector<std::shared_ptr<Representation> > SurgSim::Graphics::Group::m_representations

private

Representations in this group.

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

- SurgSim/Graphics/Group.h
- SurgSim/Graphics/Group.cpp