Timeout
Go to the documentation of this file.
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
#ifndef OSGPRESENTATION_TIMOUTOUT
#define OSGPRESENTATION_TIMOUTOUT 1
#include <osg/Transform>
#include <osgPresentation/SlideEventHandler>
namespace osgPresentation {
class OSGPRESENTATION_EXPORT HUDSettings : public osg::Referenced
{
public:
HUDSettings(double slideDistance, float eyeOffset, unsigned int leftMask, unsigned int rightMask);
virtual bool getModelViewMatrix(osg::Matrix& matrix, osg::NodeVisitor* nv) const;
virtual bool getInverseModelViewMatrix(osg::Matrix& matrix, osg::NodeVisitor* nv) const;
double _slideDistance;
double _eyeOffset;
unsigned int _leftMask;
unsigned int _rightMask;
protected:
virtual ~HUDSettings();
};
class OSGPRESENTATION_EXPORT Timeout : public osg::Transform
{
public:
Timeout(HUDSettings* hudSettings=0);
Timeout(const Timeout& timeout,const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY);
META_Node(osgPresentation, Timeout);
void setIdleDurationBeforeTimeoutDisplay(double t) { _idleDurationBeforeTimeoutDisplay = t; }
double getIdleDurationBeforeTimeoutDisplay() const { return _idleDurationBeforeTimeoutDisplay; }
void setIdleDurationBeforeTimeoutAction(double t) { _idleDurationBeforeTimeoutAction = t; }
double getIdleDurationBeforeTimeoutAction() const { return _idleDurationBeforeTimeoutAction; }
void setKeyStartsTimoutDisplay(int key) { _keyStartsTimoutDisplay = key; }
int getKeyStartsTimoutDisplay() const { return _keyStartsTimoutDisplay; }
void setKeyDismissTimoutDisplay(int key) { _keyDismissTimoutDisplay = key; }
int getKeyDismissTimoutDisplay() const { return _keyDismissTimoutDisplay; }
void setKeyRunTimoutAction(int key) { _keyRunTimeoutAction = key; }
int getKeyRunTimoutAction() const { return _keyRunTimeoutAction; }
void setDisplayBroadcastKeyPosition(const osgPresentation::KeyPosition& keyPos) { _displayBroadcastKeyPos = keyPos; }
const osgPresentation::KeyPosition& getDisplayBroadcastKeyPosition() const { return _displayBroadcastKeyPos; }
void setDismissBroadcastKeyPosition(const osgPresentation::KeyPosition& keyPos) { _dismissBroadcastKeyPos = keyPos; }
const osgPresentation::KeyPosition& getDismissBroadcastKeyPosition() const { return _dismissBroadcastKeyPos; }
void setActionKeyPosition(const osgPresentation::KeyPosition& keyPos) { _actionKeyPos = keyPos; }
const osgPresentation::KeyPosition& getActionKeyPosition() const { return _actionKeyPos; }
void setActionBroadcastKeyPosition(const osgPresentation::KeyPosition& keyPos) { _actionBroadcastKeyPos = keyPos; }
const osgPresentation::KeyPosition& getActionBroadcastKeyPosition() const { return _actionBroadcastKeyPos; }
void setActionJumpData(const JumpData& jumpData) { _actionJumpData = jumpData; }
const JumpData& getActionJumpData() const { return _actionJumpData; }
virtual bool computeLocalToWorldMatrix(osg::Matrix& matrix,osg::NodeVisitor* nv) const;
virtual bool computeWorldToLocalMatrix(osg::Matrix& matrix,osg::NodeVisitor*) const;
virtual void traverse(osg::NodeVisitor& nv);
protected:
virtual ~Timeout();
void broadcastEvent(osgViewer::Viewer* viewer, const osgPresentation::KeyPosition& keyPos);
osg::ref_ptr<HUDSettings> _hudSettings;
int _previousFrameNumber;
double _timeOfLastEvent;
bool _displayTimeout;
double _idleDurationBeforeTimeoutDisplay;
double _idleDurationBeforeTimeoutAction;
int _keyStartsTimoutDisplay;
int _keyDismissTimoutDisplay;
int _keyRunTimeoutAction;
osgPresentation::KeyPosition _displayBroadcastKeyPos;
osgPresentation::KeyPosition _dismissBroadcastKeyPos;
osgPresentation::KeyPosition _actionKeyPos;
osgPresentation::KeyPosition _actionBroadcastKeyPos;
JumpData _actionJumpData;
};
}
#endif
SlideEventHandler
Transform
osgPresentation::HUDSettings
Definition Timeout:24
osgPresentation::HUDSettings::_eyeOffset
double _eyeOffset
Definition Timeout:33
osgPresentation::HUDSettings::_leftMask
unsigned int _leftMask
Definition Timeout:34
osgPresentation::HUDSettings::~HUDSettings
virtual ~HUDSettings()
osgPresentation::HUDSettings::_rightMask
unsigned int _rightMask
Definition Timeout:35
osgPresentation::HUDSettings::HUDSettings
HUDSettings(double slideDistance, float eyeOffset, unsigned int leftMask, unsigned int rightMask)
osgPresentation::HUDSettings::getInverseModelViewMatrix
virtual bool getInverseModelViewMatrix(osg::Matrix &matrix, osg::NodeVisitor *nv) const
osgPresentation::HUDSettings::getModelViewMatrix
virtual bool getModelViewMatrix(osg::Matrix &matrix, osg::NodeVisitor *nv) const
osgPresentation::HUDSettings::_slideDistance
double _slideDistance
Definition Timeout:32
osgPresentation::Timeout::_actionKeyPos
osgPresentation::KeyPosition _actionKeyPos
Definition Timeout:114
osgPresentation::Timeout::_displayTimeout
bool _displayTimeout
Definition Timeout:102
osgPresentation::Timeout::Timeout
Timeout(HUDSettings *hudSettings=0)
osgPresentation::Timeout::~Timeout
virtual ~Timeout()
osgPresentation::Timeout::setActionBroadcastKeyPosition
void setActionBroadcastKeyPosition(const osgPresentation::KeyPosition &keyPos)
Definition Timeout:80
osgPresentation::Timeout::META_Node
META_Node(osgPresentation, Timeout)
osgPresentation::Timeout::getActionJumpData
const JumpData & getActionJumpData() const
Definition Timeout:84
osgPresentation::Timeout::broadcastEvent
void broadcastEvent(osgViewer::Viewer *viewer, const osgPresentation::KeyPosition &keyPos)
osgPresentation::Timeout::setIdleDurationBeforeTimeoutAction
void setIdleDurationBeforeTimeoutAction(double t)
Definition Timeout:57
osgPresentation::Timeout::setDisplayBroadcastKeyPosition
void setDisplayBroadcastKeyPosition(const osgPresentation::KeyPosition &keyPos)
Definition Timeout:71
osgPresentation::Timeout::_actionBroadcastKeyPos
osgPresentation::KeyPosition _actionBroadcastKeyPos
Definition Timeout:115
osgPresentation::Timeout::getIdleDurationBeforeTimeoutDisplay
double getIdleDurationBeforeTimeoutDisplay() const
Definition Timeout:55
osgPresentation::Timeout::_timeOfLastEvent
double _timeOfLastEvent
Definition Timeout:101
osgPresentation::Timeout::_actionJumpData
JumpData _actionJumpData
Definition Timeout:116
osgPresentation::Timeout::getDisplayBroadcastKeyPosition
const osgPresentation::KeyPosition & getDisplayBroadcastKeyPosition() const
Definition Timeout:72
osgPresentation::Timeout::setActionKeyPosition
void setActionKeyPosition(const osgPresentation::KeyPosition &keyPos)
Definition Timeout:77
osgPresentation::Timeout::getKeyDismissTimoutDisplay
int getKeyDismissTimoutDisplay() const
Definition Timeout:65
osgPresentation::Timeout::_idleDurationBeforeTimeoutDisplay
double _idleDurationBeforeTimeoutDisplay
Definition Timeout:104
osgPresentation::Timeout::setKeyStartsTimoutDisplay
void setKeyStartsTimoutDisplay(int key)
Definition Timeout:61
osgPresentation::Timeout::_dismissBroadcastKeyPos
osgPresentation::KeyPosition _dismissBroadcastKeyPos
Definition Timeout:112
osgPresentation::Timeout::setKeyRunTimoutAction
void setKeyRunTimoutAction(int key)
Definition Timeout:67
osgPresentation::Timeout::setActionJumpData
void setActionJumpData(const JumpData &jumpData)
Definition Timeout:83
osgPresentation::Timeout::_hudSettings
osg::ref_ptr< HUDSettings > _hudSettings
Definition Timeout:98
osgPresentation::Timeout::getActionBroadcastKeyPosition
const osgPresentation::KeyPosition & getActionBroadcastKeyPosition() const
Definition Timeout:81
osgPresentation::Timeout::_keyDismissTimoutDisplay
int _keyDismissTimoutDisplay
Definition Timeout:108
osgPresentation::Timeout::traverse
virtual void traverse(osg::NodeVisitor &nv)
osgPresentation::Timeout::_keyStartsTimoutDisplay
int _keyStartsTimoutDisplay
Definition Timeout:107
osgPresentation::Timeout::setIdleDurationBeforeTimeoutDisplay
void setIdleDurationBeforeTimeoutDisplay(double t)
Definition Timeout:54
osgPresentation::Timeout::setDismissBroadcastKeyPosition
void setDismissBroadcastKeyPosition(const osgPresentation::KeyPosition &keyPos)
Definition Timeout:74
osgPresentation::Timeout::_keyRunTimeoutAction
int _keyRunTimeoutAction
Definition Timeout:109
osgPresentation::Timeout::_displayBroadcastKeyPos
osgPresentation::KeyPosition _displayBroadcastKeyPos
Definition Timeout:111
osgPresentation::Timeout::getDismissBroadcastKeyPosition
const osgPresentation::KeyPosition & getDismissBroadcastKeyPosition() const
Definition Timeout:75
osgPresentation::Timeout::getActionKeyPosition
const osgPresentation::KeyPosition & getActionKeyPosition() const
Definition Timeout:78
osgPresentation::Timeout::computeWorldToLocalMatrix
virtual bool computeWorldToLocalMatrix(osg::Matrix &matrix, osg::NodeVisitor *) const
osgPresentation::Timeout::getKeyRunTimoutAction
int getKeyRunTimoutAction() const
Definition Timeout:68
osgPresentation::Timeout::getKeyStartsTimoutDisplay
int getKeyStartsTimoutDisplay() const
Definition Timeout:62
osgPresentation::Timeout::_idleDurationBeforeTimeoutAction
double _idleDurationBeforeTimeoutAction
Definition Timeout:105
osgPresentation::Timeout::computeLocalToWorldMatrix
virtual bool computeLocalToWorldMatrix(osg::Matrix &matrix, osg::NodeVisitor *nv) const
osgPresentation::Timeout::_previousFrameNumber
int _previousFrameNumber
Definition Timeout:100
osgPresentation::Timeout::getIdleDurationBeforeTimeoutAction
double getIdleDurationBeforeTimeoutAction() const
Definition Timeout:58
osgPresentation::Timeout::setKeyDismissTimoutDisplay
void setKeyDismissTimoutDisplay(int key)
Definition Timeout:64
osgPresentation::Timeout::Timeout
Timeout(const Timeout &timeout, const osg::CopyOp &copyop=osg::CopyOp::SHALLOW_COPY)
osgViewer::Viewer
Definition Viewer:28
osg::CopyOp
Definition CopyOp:41
osg::CopyOp::SHALLOW_COPY
@ SHALLOW_COPY
Definition CopyOp:47
osg::NodeVisitor
Definition NodeVisitor:82
osg::Referenced
Definition Referenced:44
osg::Transform
Definition Transform:75
osg::ref_ptr
Definition ref_ptr:32
osgPresentation
Definition AnimationMaterial:26
osg::Matrix
Matrixd Matrix
Definition Matrix:27
OSGPRESENTATION_EXPORT
#define OSGPRESENTATION_EXPORT
Definition osgPresentation/Export:38
osgPresentation::JumpData
Definition SlideEventHandler:46
osgPresentation::KeyPosition
Definition SlideEventHandler:161