OpenCOVER
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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

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

Member Function Documentation

void opencover::coOnscreenDebug::hide ( )

hide the debugging output

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

retrieve the singleton instance of coOnscreenDebug

ostringstream& opencover::coOnscreenDebug::out ( )

retrieve the ostringstream for output

void opencover::coOnscreenDebug::redraw ( )

redraw the debugging output

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

set the text of the label

void opencover::coOnscreenDebug::show ( )

show the debugging output

void opencover::coOnscreenDebug::toggleVisibility ( )

toggle visibility

void opencover::coOnscreenDebug::update ( )

update (does nothing)

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

osg::ref_ptr<osg::Camera> opencover::coOnscreenDebug::camera
protected
osg::ref_ptr<osg::Geode> opencover::coOnscreenDebug::geode
protected
ostringstream opencover::coOnscreenDebug::os
protected
coOnscreenDebug* opencover::coOnscreenDebug::singleton
staticprotected
osg::ref_ptr<osgText::Text> opencover::coOnscreenDebug::text
protected
bool opencover::coOnscreenDebug::visible
protected

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