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

Callback for switching the ToonTextures. More...

#include <ToonTexSwitcherCallback.h>

Inheritance diagram for brtr::ToonTexSwitcherCallback:
brtr::BaseInteractionCallback

Public Member Functions

 ToonTexSwitcherCallback (osg::Node *scenedata, osg::Camera *hudCam, int width, int height, std::vector< osg::ref_ptr< osg::Texture2D >> toonTexs)
 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 *node, osg::NodeVisitor *)
 each interact sets the next texture More...
 

Private Attributes

int _curTex
 
std::vector< osg::ref_ptr
< osg::Texture2D > > 
_toonTexs
 

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 ToonTextures.

Every click the next texture in the vector is choosen scenedata is the node which stateset holds the textures

Author
Gleb Ostrowski
Version
1.0
Date
2014

Definition at line 17 of file ToonTexSwitcherCallback.h.

Constructor & Destructor Documentation

brtr::ToonTexSwitcherCallback::ToonTexSwitcherCallback ( osg::Node *  scenedata,
osg::Camera *  hudCam,
int  width,
int  height,
std::vector< osg::ref_ptr< osg::Texture2D >>  toonTexs 
)

Constructor.

Parameters
scenedatanode which stateset contains the ToonTextures
hudCam
widthscreenWidth
heightscreenHeight
toonTexsvector with ToonTextures

Definition at line 9 of file ToonTexSwitcherCallback.cpp.

Member Function Documentation

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

each interact sets the next texture

Parameters
notused
notused

Implements brtr::BaseInteractionCallback.

Definition at line 18 of file ToonTexSwitcherCallback.cpp.

void brtr::ToonTexSwitcherCallback::setText ( )
virtual

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

Implements brtr::BaseInteractionCallback.

Definition at line 14 of file ToonTexSwitcherCallback.cpp.

Member Data Documentation

int brtr::ToonTexSwitcherCallback::_curTex
private

Definition at line 40 of file ToonTexSwitcherCallback.h.

std::vector<osg::ref_ptr<osg::Texture2D> > brtr::ToonTexSwitcherCallback::_toonTexs
private

Definition at line 41 of file ToonTexSwitcherCallback.h.


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