opensurgsim
Public Member Functions | List of all members
SurgSim::Graphics::Group Class Referenceabstract

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

#include <Group.h>

Inheritance diagram for SurgSim::Graphics::Group:
MockGroup SurgSim::Graphics::OsgGroup

Public Member Functions

 Group (const std::string &name)
 Constructor. More...
 
virtual ~Group ()
 Destructor.
 
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.
 
std::string getName () const
 

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
nameName of the group, this has to be unique over the whole system, otherwise adding the group will fail

Member Function Documentation

§ add()

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

Adds an representation.

Parameters
representationRepresentation 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
groupGroup of representations to add
Returns
True if all representations are added successfully, false if failure

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 MockGroup, and SurgSim::Graphics::OsgGroup.

§ remove()

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

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

§ setVisible()

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

Sets whether the group is currently visible.

Parameters
visibleTrue for visible, false for invisible

Implemented in MockGroup, and SurgSim::Graphics::OsgGroup.


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