OpenCOVER
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
opencover::coOnscreenDebug Class Reference

This class handles onscreen debugging output. More...

#include <coOnscreenDebug.h>

Collaboration diagram for opencover::coOnscreenDebug:
Collaboration graph
[legend]

Public Member Functions

void show ()
 show the debugging output More...
 
void hide ()
 hide the debugging output More...
 
void toggleVisibility ()
 toggle visibility More...
 
void redraw ()
 redraw the debugging output More...
 
void update ()
 update (does nothing) More...
 
void setText (const char *text)
 set the text of the label More...
 
ostringstream & out ()
 
void updateString ()
 

Static Public Member Functions

static coOnscreenDebuginstance ()
 

Protected Member Functions

 coOnscreenDebug ()
 
virtual ~coOnscreenDebug ()
 

Protected Attributes

bool visible
 
osg::ref_ptr< osgText::Text > text
 
osg::ref_ptr< osg::Geode > geode
 
osg::ref_ptr< osg::Camera > camera
 
ostringstream os
 

Static Protected Attributes

static coOnscreenDebugsingleton
 

Detailed Description

This class handles onscreen debugging output.

With this class you can print debugging messages on the screen. In a cave, every screen shows output which is local to it, so you can compare values for each screen.

Example:

#include <sstream> ... ostringstream& os = coOnscreenDebug::instance()->out(); os << "Hello World!" << std::endl; coOnscreenDebug::instance()->updateString()

...

The code above creates and initializes the debug label if necessary and returns a stringstream reference to which you can direct your information. When finished, you need to call updateString(), so the contents of the stringstream are flushed to the label.

Constructor & Destructor Documentation

◆ coOnscreenDebug()

opencover::coOnscreenDebug::coOnscreenDebug ( )
protected

◆ ~coOnscreenDebug()

virtual opencover::coOnscreenDebug::~coOnscreenDebug ( )
protectedvirtual

Member Function Documentation

◆ hide()

void opencover::coOnscreenDebug::hide ( )

hide the debugging output

◆ instance()

static coOnscreenDebug * opencover::coOnscreenDebug::instance ( )
static

retrieve the singleton instance of coOnscreenDebug

◆ out()

ostringstream & opencover::coOnscreenDebug::out ( )

retrieve the ostringstream for output

◆ redraw()

void opencover::coOnscreenDebug::redraw ( )

redraw the debugging output

◆ setText()

void opencover::coOnscreenDebug::setText ( const char *  text)

set the text of the label

◆ show()

void opencover::coOnscreenDebug::show ( )

show the debugging output

◆ toggleVisibility()

void opencover::coOnscreenDebug::toggleVisibility ( )

toggle visibility

◆ update()

void opencover::coOnscreenDebug::update ( )

update (does nothing)

◆ updateString()

void opencover::coOnscreenDebug::updateString ( )

flush the contents of the ostringstream to the internal text. This clears the ostringstream, so anything from the last updateString() is lost!

Member Data Documentation

◆ camera

osg::ref_ptr<osg::Camera> opencover::coOnscreenDebug::camera
protected

◆ geode

osg::ref_ptr<osg::Geode> opencover::coOnscreenDebug::geode
protected

◆ os

ostringstream opencover::coOnscreenDebug::os
protected

◆ singleton

coOnscreenDebug* opencover::coOnscreenDebug::singleton
staticprotected

◆ text

osg::ref_ptr<osgText::Text> opencover::coOnscreenDebug::text
protected

◆ visible

bool opencover::coOnscreenDebug::visible
protected

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