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

Key Handler Class, handles all of our KeyFunctions, which do not belong to camera control (this are handled by FPSCameraManipulator) More...

#include <KeyHandler.h>

Inheritance diagram for brtr::KeyHandler:

Public Member Functions

 KeyHandler (osg::Node *, osg::Camera *postProcessCam, std::vector< osg::ref_ptr< osg::Program >> programs)
 Constructor. More...
 
virtual bool handle (const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &aa)
 

Protected Member Functions

 ~KeyHandler ()
 

Private Member Functions

bool handleKeyDown (const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &aa)
 
void mouseIntersection (osgGA::GUIActionAdapter &aa)
 Checks, if under the mouse (e.a center of screen) is an interact-able object (e.a geometry) More...
 
brtr::BaseInteractionCallbackmodifyText (bool show)
 Shows the InteractionMessage on screen, if there is an InteractionObject beneath the mouse (e.a center of screen) More...
 

Private Attributes

osg::ref_ptr< osg::Drawable > _curDrawable
 
osg::ref_ptr< osg::Node > _rootNode
 
osg::ref_ptr< osg::PolygonMode > _wireFrameMode
 
osg::ref_ptr< osg::PolygonMode > _normaleMode
 
osg::ref_ptr< osg::Camera > _postProcessCam
 
std::vector< osg::ref_ptr
< osg::Program > > 
_programs
 
osg::ref_ptr< const
osgGA::GUIEventAdapter > 
_mouseEvent
 
bool _isWireFrame
 
unsigned int _curProg
 

Detailed Description

Key Handler Class, handles all of our KeyFunctions, which do not belong to camera control (this are handled by FPSCameraManipulator)

Controls:
                   C       = Toggle WireFrame Mode On/Off
                 LClick    = Interact
                 Shift+1   = Toggle programs
             
Author
Gleb Ostrowski
Version
1.0
Date
2014

Definition at line 23 of file KeyHandler.h.

Constructor & Destructor Documentation

brtr::KeyHandler::KeyHandler ( osg::Node *  rootNode,
osg::Camera *  postProcessCam,
std::vector< osg::ref_ptr< osg::Program >>  programs 
)

Constructor.

Parameters
rootnoderootnode of the scene, polygonmode will be activatd on all children
postProcessCamnode containing the postprocess programs
programsvector with postprocess programs

Definition at line 8 of file KeyHandler.cpp.

brtr::KeyHandler::~KeyHandler ( )
protected

Definition at line 19 of file KeyHandler.cpp.

Member Function Documentation

bool brtr::KeyHandler::handle ( const osgGA::GUIEventAdapter &  ea,
osgGA::GUIActionAdapter &  aa 
)
virtual

Definition at line 21 of file KeyHandler.cpp.

bool brtr::KeyHandler::handleKeyDown ( const osgGA::GUIEventAdapter &  ea,
osgGA::GUIActionAdapter &  aa 
)
private

Definition at line 53 of file KeyHandler.cpp.

brtr::BaseInteractionCallback * brtr::KeyHandler::modifyText ( bool  show)
private

Shows the InteractionMessage on screen, if there is an InteractionObject beneath the mouse (e.a center of screen)

Parameters
toshow or not show the text, that is the question
Returns
the BaseInteractionCallback associated with the interactionObject, if any, null else;

Definition at line 101 of file KeyHandler.cpp.

void brtr::KeyHandler::mouseIntersection ( osgGA::GUIActionAdapter &  aa)
private

Checks, if under the mouse (e.a center of screen) is an interact-able object (e.a geometry)

Parameters
aaGUIActionAdapter for getting the camera , to whom the LineIntersectionVisitor will be attached to

Definition at line 76 of file KeyHandler.cpp.

Member Data Documentation

osg::ref_ptr<osg::Drawable> brtr::KeyHandler::_curDrawable
private

Definition at line 53 of file KeyHandler.h.

unsigned int brtr::KeyHandler::_curProg
private

Definition at line 61 of file KeyHandler.h.

bool brtr::KeyHandler::_isWireFrame
private

Definition at line 60 of file KeyHandler.h.

osg::ref_ptr< const osgGA::GUIEventAdapter > brtr::KeyHandler::_mouseEvent
private

Definition at line 59 of file KeyHandler.h.

osg::ref_ptr<osg::PolygonMode> brtr::KeyHandler::_normaleMode
private

Definition at line 56 of file KeyHandler.h.

osg::ref_ptr<osg::Camera> brtr::KeyHandler::_postProcessCam
private

Definition at line 57 of file KeyHandler.h.

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

Definition at line 58 of file KeyHandler.h.

osg::ref_ptr<osg::Node> brtr::KeyHandler::_rootNode
private

Definition at line 54 of file KeyHandler.h.

osg::ref_ptr<osg::PolygonMode> brtr::KeyHandler::_wireFrameMode
private

Definition at line 55 of file KeyHandler.h.


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