DART  6.10.1
dart::gui::osg::ViewerAttachment Class Referenceabstract

#include <Viewer.hpp>

Inheritance diagram for dart::gui::osg::ViewerAttachment:
dart::gui::osg::GridVisual dart::gui::osg::SupportPolygonVisual

Public Member Functions

 ViewerAttachment ()
 Default constructor. More...
 
virtual ~ViewerAttachment ()
 Virtual destructor. More...
 
virtual void refresh ()=0
 This function will get called each time the Viewer is refreshed. More...
 
ViewergetViewer ()
 
const ViewergetViewer () const
 

Protected Member Functions

virtual void customAttach (Viewer *newViewer)
 This function will be called by attach(Viewer*) so you can do customized setup when the Viewer changes. More...
 
virtual void attach (Viewer *newViewer)
 This function will get called when the visual is attached to a new Viewer. More...
 

Private Attributes

ViewermViewer
 

Friends

class Viewer
 

Constructor & Destructor Documentation

◆ ViewerAttachment()

dart::gui::osg::ViewerAttachment::ViewerAttachment ( )

Default constructor.

◆ ~ViewerAttachment()

dart::gui::osg::ViewerAttachment::~ViewerAttachment ( )
virtual

Virtual destructor.

Member Function Documentation

◆ attach()

void dart::gui::osg::ViewerAttachment::attach ( Viewer newViewer)
protectedvirtual

This function will get called when the visual is attached to a new Viewer.

It adds this node as a child to the root node of the Viewer so the refresh() function will be called at each update cycle. It will also call customAttach(Viewer*) so you can do customized setup.

◆ customAttach()

void dart::gui::osg::ViewerAttachment::customAttach ( Viewer newViewer)
protectedvirtual

This function will be called by attach(Viewer*) so you can do customized setup when the Viewer changes.

By default this function does nothing, so overriding it is completely safe.

◆ getViewer() [1/2]

Viewer * dart::gui::osg::ViewerAttachment::getViewer ( )

◆ getViewer() [2/2]

const Viewer * dart::gui::osg::ViewerAttachment::getViewer ( ) const

◆ refresh()

virtual void dart::gui::osg::ViewerAttachment::refresh ( )
pure virtual

This function will get called each time the Viewer is refreshed.

Override it to have your attachment update with each refresh cycle.

Implemented in dart::gui::osg::SupportPolygonVisual, and dart::gui::osg::GridVisual.

Friends And Related Function Documentation

◆ Viewer

friend class Viewer
friend

Member Data Documentation

◆ mViewer

Viewer* dart::gui::osg::ViewerAttachment::mViewer
private