BrainTrain
 All Classes Namespaces Files Functions Variables Macros Pages
brtr::ProgramSwitcherCallback Class Reference

Callback for switching the postprocess programs. More...

#include <ProgramSwitcherCallback.h>

Inheritance diagram for brtr::ProgramSwitcherCallback:
brtr::BaseInteractionCallback

Public Member Functions

 ProgramSwitcherCallback (osg::Node *postprocessCam, osg::Camera *hudCam, int width, int height, std::vector< osg::ref_ptr< osg::Program >> programs)
 Constructor. More...
 
virtual void setText ()
 sets the text on screen. Subclasses must override to set its own (info)text More...
 
- Public Member Functions inherited from brtr::BaseInteractionCallback
 BaseInteractionCallback (osg::Node *attachTo, osg::Camera *hudCam, int width, int height)
 Constructor. More...
 
virtual void operator() (osg::Node *node, osg::NodeVisitor *nv)
 
void clearText ()
 
void reactivate ()
 
osg::ref_ptr< osg::Node > getNode () const
 
void setNode (osg::ref_ptr< osg::Node > val)
 

Protected Member Functions

virtual void interact (osg::Node *, osg::NodeVisitor *)
 each interact sets the next program More...
 

Private Attributes

std::vector< osg::ref_ptr
< osg::Program > > 
_programs
 
unsigned int _curProg
 

Additional Inherited Members

- Protected Attributes inherited from brtr::BaseInteractionCallback
osg::ref_ptr< osg::Node > _attachTo
 
osg::ref_ptr< osg::Camera > _hudCam
 
bool _done
 
osg::ref_ptr< osgText::Text > _text
 

Detailed Description

Callback for switching the postprocess programs.

Every click the next program in the vector is choosen postprocessCam is the node which stateset holds the programs

Author
Gleb Ostrowski
Version
1.0
Date
2014

Definition at line 17 of file ProgramSwitcherCallback.h.

Constructor & Destructor Documentation

brtr::ProgramSwitcherCallback::ProgramSwitcherCallback ( osg::Node *  postprocessCam,
osg::Camera *  hudCam,
int  width,
int  height,
std::vector< osg::ref_ptr< osg::Program >>  programs 
)

Constructor.

Parameters
postprocessCamnode which stateset contains the programs
hudCam
widthscreenWidth
heightscreenHeight
programsvector with postProcessprograms

Definition at line 8 of file ProgramSwitcherCallback.cpp.

Member Function Documentation

void brtr::ProgramSwitcherCallback::interact ( osg::Node *  ,
osg::NodeVisitor *   
)
protectedvirtual

each interact sets the next program

Parameters
notused
notused

Implements brtr::BaseInteractionCallback.

Definition at line 17 of file ProgramSwitcherCallback.cpp.

void brtr::ProgramSwitcherCallback::setText ( )
virtual

sets the text on screen. Subclasses must override to set its own (info)text

Implements brtr::BaseInteractionCallback.

Definition at line 13 of file ProgramSwitcherCallback.cpp.

Member Data Documentation

unsigned int brtr::ProgramSwitcherCallback::_curProg
private

Definition at line 41 of file ProgramSwitcherCallback.h.

std::vector<osg::ref_ptr<osg::Program> > brtr::ProgramSwitcherCallback::_programs
private

Definition at line 40 of file ProgramSwitcherCallback.h.


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