SlideEventHandler
Go to the documentation of this file.
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2018 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 SLIDEEVENTHANDLER
#define SLIDEEVENTHANDLER 1
#include <osg/Switch>
#include <osg/Timer>
#include <osg/ValueObject>
#include <osg/ImageSequence>
#include <osgGA/GUIEventHandler>
#include <osgViewer/Viewer>
#include <osgPresentation/CompileSlideCallback>
#include <osgPresentation/PropertyManager>
namespace osgPresentation
{
// forward declare
class SlideEventHandler;
enum Operation
{
RUN,
LOAD,
EVENT,
JUMP,
FORWARD_MOUSE_EVENT,
FORWARD_TOUCH_EVENT
};
struct JumpData : public osg::Object
{
JumpData():
relativeJump(true),
slideNum(0),
layerNum(0) {}
JumpData(bool in_relativeJump, int in_slideNum, int in_layerNum):
relativeJump(in_relativeJump),
slideNum(in_slideNum),
layerNum(in_layerNum) {}
JumpData(const std::string& in_slideName, const std::string& in_layerName):
relativeJump(true),
slideNum(0),
layerNum(0),
slideName(in_slideName),
layerName(in_layerName) {}
JumpData(const JumpData& rhs, const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY):
osg::Object(rhs, copyop),
relativeJump(rhs.relativeJump),
slideNum(rhs.slideNum),
layerNum(rhs.layerNum),
slideName(rhs.slideName),
layerName(rhs.layerName) {}
JumpData& operator = (const JumpData& rhs)
{
if (&rhs==this) return *this;
relativeJump = rhs.relativeJump;
slideNum = rhs.slideNum;
layerNum = rhs.layerNum;
slideName = rhs.slideName;
layerName = rhs.layerName;
return *this;
}
META_Object(osgPresentation, JumpData);
bool requiresJump() const
{
if (!slideName.empty() || !layerName.empty()) return true;
return relativeJump ? (slideNum!=0 || layerNum!=0) : true;
}
bool jump(SlideEventHandler* seh) const;
void setRelativeJump(bool flag) { relativeJump = flag; }
bool getRelativeJump() const { return relativeJump; }
void setSlideNum(int num) { slideNum = num; }
int getSlideNum() const { return slideNum; }
void setLayerNum(int num) { layerNum = num; }
int getLayerNum() const { return layerNum; }
void setSlideName(const std::string& name) { slideName = name; }
const std::string& getSlideName() const { return slideName; }
void setLayerName(const std::string& name) { layerName = name; }
const std::string& getLayerName() const { return layerName; }
bool relativeJump;
int slideNum;
int layerNum;
std::string slideName;
std::string layerName;
};
struct HomePosition : public osg::Object
{
HomePosition():
eye(0.0, -1.0, 0.0),
center(0.0, 0.0, 0.0),
up(0.0, 0.0, 1.0) {}
HomePosition(const osg::Vec3& in_eye, const osg::Vec3& in_center, const osg::Vec3& in_up):
eye(in_eye),
center(in_center),
up(in_up) {}
HomePosition(const HomePosition& rhs, const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY):
osg::Object(rhs, copyop),
eye(rhs.eye),
center(rhs.center),
up(rhs.up) {}
HomePosition& operator = (const HomePosition& rhs)
{
if (&rhs==this) return *this;
eye = rhs.eye;
center = rhs.center;
up = rhs.up;
return *this;
}
META_Object(osgPresentation, HomePosition);
void setEye(const osg::Vec3d& e) { eye = e; }
const osg::Vec3d& getEye() const { return eye; }
void setCenter(const osg::Vec3d& c) { center = c; }
const osg::Vec3d& getCenter() const { return center; }
void setUp(const osg::Vec3d& u) { up = u; }
const osg::Vec3d& getUp() const { return up; }
osg::Vec3d eye;
osg::Vec3d center;
osg::Vec3d up;
};
struct KeyPosition : public osg::Object
{
KeyPosition(unsigned int key=0, float x=FLT_MAX, float y=FLT_MAX, bool forward_to_devices = false):
_key((osgGA::GUIEventAdapter::KeySymbol)key),
_x(x),
_y(y),
_forwardToDevices(forward_to_devices) {}
KeyPosition(const KeyPosition& rhs, const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY):
osg::Object(rhs, copyop),
_key(rhs._key),
_x(rhs._x),
_y(rhs._y),
_forwardToDevices(rhs._forwardToDevices) {}
META_Object(osgPresentation, KeyPosition);
KeyPosition& operator = (const KeyPosition& rhs)
{
if (&rhs==this) return *this;
_key = rhs._key;
_x = rhs._x;
_y = rhs._y;
_forwardToDevices = rhs._forwardToDevices;
return *this;
}
void set(unsigned int key=0, float x=FLT_MAX, float y=FLT_MAX, bool forward_to_devices = false)
{
_key = (osgGA::GUIEventAdapter::KeySymbol)key;
_x = x;
_y = y;
_forwardToDevices = forward_to_devices;
}
void setKey(int key) { _key = static_cast<osgGA::GUIEventAdapter::KeySymbol>(key); }
int getKey() const { return _key; }
void setX(float x) { _x = x; }
float getX() const { return _x; }
void setY(float y) { _y = y; }
float getY() const { return _y; }
void setForwardToDevices(bool flag) { _forwardToDevices = flag; }
bool getForwardToDevices() const { return _forwardToDevices; }
osgGA::GUIEventAdapter::KeySymbol _key;
float _x;
float _y;
bool _forwardToDevices;
};
struct LayerCallback : public virtual osg::Referenced
{
virtual void operator() (osg::Node* node) const = 0;
};
struct OSGPRESENTATION_EXPORT LayerAttributes : public virtual osg::Referenced
{
LayerAttributes():_duration(0) {}
LayerAttributes(double in_duration):_duration(in_duration) {}
void setDuration(double duration) { _duration = duration; }
double getDuration() const { return _duration; }
typedef std::vector<KeyPosition> Keys;
typedef std::vector<std::string> RunStrings;
void setKeys(const Keys& keys) { _keys = keys; }
const Keys& getKeys() const { return _keys; }
void addKey(const KeyPosition& kp) { _keys.push_back(kp); }
void setRunStrings(const RunStrings& runStrings) { _runStrings = runStrings; }
const RunStrings& getRunStrings() const { return _runStrings; }
void addRunString(const std::string& runString) { _runStrings.push_back(runString); }
void setJump(const JumpData& jumpData) { _jumpData = jumpData; }
const JumpData& getJumpData() const { return _jumpData; }
double _duration;
Keys _keys;
RunStrings _runStrings;
JumpData _jumpData;
void addEnterCallback(LayerCallback* lc) { _enterLayerCallbacks.push_back(lc); }
void addLeaveCallback(LayerCallback* lc) { _leaveLayerCallbacks.push_back(lc); }
void callEnterCallbacks(osg::Node* node);
void callLeaveCallbacks(osg::Node* node);
typedef std::list< osg::ref_ptr<LayerCallback> > LayerCallbacks;
LayerCallbacks _enterLayerCallbacks;
LayerCallbacks _leaveLayerCallbacks;
};
struct FilePathData : public virtual osg::Referenced
{
FilePathData(const osgDB::FilePathList& fpl):filePathList(fpl) {}
osgDB::FilePathList filePathList;
};
struct dereference_less
{
template<class T, class U>
inline bool operator() (const T& lhs,const U& rhs) const
{
return *lhs < *rhs;
}
};
struct ObjectOperator : public osg::Referenced
{
inline bool operator < (const ObjectOperator& rhs) const { return ptr() < rhs.ptr(); }
virtual void* ptr() const = 0;
virtual void enter(SlideEventHandler*) = 0;
virtual void frame(SlideEventHandler*) {} ;
virtual void maintain(SlideEventHandler*) = 0;
virtual void leave(SlideEventHandler*) = 0;
virtual void setPause(SlideEventHandler*, bool pause) = 0;
virtual void reset(SlideEventHandler*) = 0;
virtual ~ObjectOperator() {}
};
class OSGPRESENTATION_EXPORT ActiveOperators
{
public:
ActiveOperators();
~ActiveOperators();
void collect(osg::Node* incomingNode, osg::NodeVisitor::TraversalMode tm = osg::NodeVisitor::TRAVERSE_ACTIVE_CHILDREN);
void process(SlideEventHandler* seh);
void frame(SlideEventHandler*);
void setPause(SlideEventHandler* seh, bool pause);
bool getPause() const { return _pause; }
void reset(SlideEventHandler* seh);
typedef std::set< osg::ref_ptr<ObjectOperator>, dereference_less > OperatorList;
protected:
void processOutgoing(SlideEventHandler* seh);
void processIncoming(SlideEventHandler* seh);
void processMaintained(SlideEventHandler* seh);
bool _pause;
OperatorList _previous;
OperatorList _current;
OperatorList _outgoing;
OperatorList _incoming;
OperatorList _maintained;
};
class OSGPRESENTATION_EXPORT SlideEventHandler : public osgGA::GUIEventHandler
{
public:
SlideEventHandler(osgViewer::Viewer* viewer=0);
SlideEventHandler(const SlideEventHandler& seh,const osg::CopyOp& copyop);
static SlideEventHandler* instance();
META_Object(osgPresentation,SlideEventHandler);
void set(osg::Node* model);
virtual bool handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionAdapter&);
virtual void getUsage(osg::ApplicationUsage& usage) const;
osgViewer::Viewer* getViewer() { return _viewer.get(); }
osg::Switch* getPresentationSwitch() { return _presentationSwitch.get(); }
enum WhichPosition
{
FIRST_POSITION = 0,
LAST_POSITION = -1
};
void compileSlide(unsigned int slideNum);
void releaseSlide(unsigned int slideNum);
unsigned int getNumSlides();
int getActiveSlide() const { return _activeSlide; }
int getActiveLayer() const { return _activeLayer; }
osg::Switch* getSlide(int slideNum);
osg::Node* getLayer(int slideNum, int layerNum);
bool selectSlide(int slideNum,int layerNum=FIRST_POSITION);
bool selectLayer(int layerNum);
bool nextLayerOrSlide();
bool previousLayerOrSlide();
bool nextSlide();
bool previousSlide();
bool nextLayer();
bool previousLayer();
bool home();
void setAutoSteppingActive(bool flag = true) { _autoSteppingActive = flag; }
bool getAutoSteppingActive() const { return _autoSteppingActive; }
void setTimeDelayBetweenSlides(double dt) { _timePerSlide = dt; }
double getTimeDelayBetweenSlides() const { return _timePerSlide; }
double getDuration(const osg::Node* node) const;
double getCurrentTimeDelayBetweenSlides() const;
void setReleaseAndCompileOnEachNewSlide(bool flag) { _releaseAndCompileOnEachNewSlide = flag; }
bool getReleaseAndCompileOnEachNewSlide() const { return _releaseAndCompileOnEachNewSlide; }
void setTimeDelayOnNewSlideWithMovies(float t) { _timeDelayOnNewSlideWithMovies = t; }
float getTimeDelayOnNewSlideWithMovies() const { return _timeDelayOnNewSlideWithMovies; }
void setLoopPresentation(bool loop) { _loopPresentation = loop; }
bool getLoopPresentation() const { return _loopPresentation; }
void dispatchEvent(const KeyPosition& keyPosition);
void dispatchEvent(osgGA::Event* event);
void forwardEventToDevices(osgGA::Event* event);
void setRequestReload(bool flag);
bool getRequestReload() const { return _requestReload; }
double getReferenceTime() const { return _referenceTime; }
virtual bool checkNeedToDoFrame();
protected:
~SlideEventHandler() {}
bool home(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionAdapter& aa);
void updateAlpha(bool, bool, float x, float y);
void updateLight(float x, float y);
void updateOperators();
osg::observer_ptr<osgViewer::Viewer> _viewer;
osg::observer_ptr<osg::Switch> _showSwitch;
int _activePresentation;
osg::observer_ptr<osg::Switch> _presentationSwitch;
int _activeSlide;
osg::observer_ptr<osg::Switch> _slideSwitch;
int _activeLayer;
bool _firstTraversal;
double _referenceTime;
double _previousTime;
double _timePerSlide;
bool _autoSteppingActive;
bool _loopPresentation;
bool _pause;
bool _hold;
bool _updateLightActive;
bool _updateOpacityActive;
float _previousX, _previousY;
bool _cursorOn;
bool _releaseAndCompileOnEachNewSlide;
bool _firstSlideOrLayerChange;
osg::Timer_t _tickAtFirstSlideOrLayerChange;
osg::Timer_t _tickAtLastSlideOrLayerChange;
float _timeDelayOnNewSlideWithMovies;
double _minimumTimeBetweenKeyPresses;
double _timeLastKeyPresses;
ActiveOperators _activeOperators;
osg::ref_ptr<CompileSlideCallback> _compileSlideCallback;
bool _requestReload;
};
}
#endif
CompileSlideCallback
GUIEventHandler
ImageSequence
PropertyManager
Switch
Timer
ValueObject
Viewer
osgGA::EventHandler::event
virtual void event(osg::NodeVisitor *nv, osg::Drawable *drawable)
osgGA::Event
Definition Event:27
osgGA::GUIActionAdapter
Definition GUIActionAdapter:62
osgGA::GUIEventAdapter
Definition GUIEventAdapter:82
osgGA::GUIEventAdapter::KeySymbol
KeySymbol
Definition GUIEventAdapter:113
osgGA::GUIEventHandler
Definition GUIEventHandler:50
osgPresentation::ActiveOperators
Definition SlideEventHandler:293
osgPresentation::ActiveOperators::getPause
bool getPause() const
Definition SlideEventHandler:305
osgPresentation::ActiveOperators::collect
void collect(osg::Node *incomingNode, osg::NodeVisitor::TraversalMode tm=osg::NodeVisitor::TRAVERSE_ACTIVE_CHILDREN)
osgPresentation::ActiveOperators::processMaintained
void processMaintained(SlideEventHandler *seh)
osgPresentation::ActiveOperators::setPause
void setPause(SlideEventHandler *seh, bool pause)
osgPresentation::ActiveOperators::_pause
bool _pause
Definition SlideEventHandler:317
osgPresentation::ActiveOperators::frame
void frame(SlideEventHandler *)
osgPresentation::ActiveOperators::reset
void reset(SlideEventHandler *seh)
osgPresentation::ActiveOperators::_current
OperatorList _current
Definition SlideEventHandler:320
osgPresentation::ActiveOperators::OperatorList
std::set< osg::ref_ptr< ObjectOperator >, dereference_less > OperatorList
Definition SlideEventHandler:309
osgPresentation::ActiveOperators::_maintained
OperatorList _maintained
Definition SlideEventHandler:324
osgPresentation::ActiveOperators::process
void process(SlideEventHandler *seh)
osgPresentation::ActiveOperators::processOutgoing
void processOutgoing(SlideEventHandler *seh)
osgPresentation::ActiveOperators::_incoming
OperatorList _incoming
Definition SlideEventHandler:323
osgPresentation::ActiveOperators::processIncoming
void processIncoming(SlideEventHandler *seh)
osgPresentation::ActiveOperators::_outgoing
OperatorList _outgoing
Definition SlideEventHandler:322
osgPresentation::ActiveOperators::ActiveOperators
ActiveOperators()
osgPresentation::ActiveOperators::~ActiveOperators
~ActiveOperators()
osgPresentation::ActiveOperators::_previous
OperatorList _previous
Definition SlideEventHandler:319
osgPresentation::SlideEventHandler
Definition SlideEventHandler:329
osgPresentation::SlideEventHandler::setRequestReload
void setRequestReload(bool flag)
osgPresentation::SlideEventHandler::SlideEventHandler
SlideEventHandler(osgViewer::Viewer *viewer=0)
osgPresentation::SlideEventHandler::updateLight
void updateLight(float x, float y)
osgPresentation::SlideEventHandler::dispatchEvent
void dispatchEvent(osgGA::Event *event)
osgPresentation::SlideEventHandler::getSlide
osg::Switch * getSlide(int slideNum)
osgPresentation::SlideEventHandler::_updateOpacityActive
bool _updateOpacityActive
Definition SlideEventHandler:447
osgPresentation::SlideEventHandler::_loopPresentation
bool _loopPresentation
Definition SlideEventHandler:442
osgPresentation::SlideEventHandler::_timeLastKeyPresses
double _timeLastKeyPresses
Definition SlideEventHandler:461
osgPresentation::SlideEventHandler::_activeLayer
int _activeLayer
Definition SlideEventHandler:435
osgPresentation::SlideEventHandler::home
bool home()
osgPresentation::SlideEventHandler::SlideEventHandler
SlideEventHandler(const SlideEventHandler &seh, const osg::CopyOp &copyop)
osgPresentation::SlideEventHandler::dispatchEvent
void dispatchEvent(const KeyPosition &keyPosition)
osgPresentation::SlideEventHandler::getReleaseAndCompileOnEachNewSlide
bool getReleaseAndCompileOnEachNewSlide() const
Definition SlideEventHandler:393
osgPresentation::SlideEventHandler::_timePerSlide
double _timePerSlide
Definition SlideEventHandler:440
osgPresentation::SlideEventHandler::_tickAtLastSlideOrLayerChange
osg::Timer_t _tickAtLastSlideOrLayerChange
Definition SlideEventHandler:456
osgPresentation::SlideEventHandler::_minimumTimeBetweenKeyPresses
double _minimumTimeBetweenKeyPresses
Definition SlideEventHandler:460
osgPresentation::SlideEventHandler::_tickAtFirstSlideOrLayerChange
osg::Timer_t _tickAtFirstSlideOrLayerChange
Definition SlideEventHandler:455
osgPresentation::SlideEventHandler::getNumSlides
unsigned int getNumSlides()
osgPresentation::SlideEventHandler::_previousX
float _previousX
Definition SlideEventHandler:448
osgPresentation::SlideEventHandler::selectLayer
bool selectLayer(int layerNum)
osgPresentation::SlideEventHandler::getRequestReload
bool getRequestReload() const
Definition SlideEventHandler:408
osgPresentation::SlideEventHandler::_firstTraversal
bool _firstTraversal
Definition SlideEventHandler:437
osgPresentation::SlideEventHandler::getCurrentTimeDelayBetweenSlides
double getCurrentTimeDelayBetweenSlides() const
osgPresentation::SlideEventHandler::nextSlide
bool nextSlide()
osgPresentation::SlideEventHandler::getDuration
double getDuration(const osg::Node *node) const
osgPresentation::SlideEventHandler::selectSlide
bool selectSlide(int slideNum, int layerNum=FIRST_POSITION)
osgPresentation::SlideEventHandler::handle
virtual bool handle(const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &)
osgPresentation::SlideEventHandler::_activeSlide
int _activeSlide
Definition SlideEventHandler:432
osgPresentation::SlideEventHandler::_timeDelayOnNewSlideWithMovies
float _timeDelayOnNewSlideWithMovies
Definition SlideEventHandler:458
osgPresentation::SlideEventHandler::_updateLightActive
bool _updateLightActive
Definition SlideEventHandler:446
osgPresentation::SlideEventHandler::_compileSlideCallback
osg::ref_ptr< CompileSlideCallback > _compileSlideCallback
Definition SlideEventHandler:465
osgPresentation::SlideEventHandler::_activePresentation
int _activePresentation
Definition SlideEventHandler:429
osgPresentation::SlideEventHandler::getActiveLayer
int getActiveLayer() const
Definition SlideEventHandler:363
osgPresentation::SlideEventHandler::getLoopPresentation
bool getLoopPresentation() const
Definition SlideEventHandler:399
osgPresentation::SlideEventHandler::setLoopPresentation
void setLoopPresentation(bool loop)
Definition SlideEventHandler:398
osgPresentation::SlideEventHandler::getActiveSlide
int getActiveSlide() const
Definition SlideEventHandler:362
osgPresentation::SlideEventHandler::releaseSlide
void releaseSlide(unsigned int slideNum)
osgPresentation::SlideEventHandler::getViewer
osgViewer::Viewer * getViewer()
Definition SlideEventHandler:346
osgPresentation::SlideEventHandler::_releaseAndCompileOnEachNewSlide
bool _releaseAndCompileOnEachNewSlide
Definition SlideEventHandler:452
osgPresentation::SlideEventHandler::~SlideEventHandler
~SlideEventHandler()
Definition SlideEventHandler:416
osgPresentation::SlideEventHandler::forwardEventToDevices
void forwardEventToDevices(osgGA::Event *event)
osgPresentation::SlideEventHandler::_hold
bool _hold
Definition SlideEventHandler:444
osgPresentation::SlideEventHandler::getReferenceTime
double getReferenceTime() const
Definition SlideEventHandler:410
osgPresentation::SlideEventHandler::getLayer
osg::Node * getLayer(int slideNum, int layerNum)
osgPresentation::SlideEventHandler::getAutoSteppingActive
bool getAutoSteppingActive() const
Definition SlideEventHandler:383
osgPresentation::SlideEventHandler::_presentationSwitch
osg::observer_ptr< osg::Switch > _presentationSwitch
Definition SlideEventHandler:431
osgPresentation::SlideEventHandler::instance
static SlideEventHandler * instance()
osgPresentation::SlideEventHandler::WhichPosition
WhichPosition
Definition SlideEventHandler:352
osgPresentation::SlideEventHandler::FIRST_POSITION
@ FIRST_POSITION
Definition SlideEventHandler:353
osgPresentation::SlideEventHandler::LAST_POSITION
@ LAST_POSITION
Definition SlideEventHandler:354
osgPresentation::SlideEventHandler::_autoSteppingActive
bool _autoSteppingActive
Definition SlideEventHandler:441
osgPresentation::SlideEventHandler::_viewer
osg::observer_ptr< osgViewer::Viewer > _viewer
Definition SlideEventHandler:426
osgPresentation::SlideEventHandler::compileSlide
void compileSlide(unsigned int slideNum)
osgPresentation::SlideEventHandler::META_Object
META_Object(osgPresentation, SlideEventHandler)
osgPresentation::SlideEventHandler::updateAlpha
void updateAlpha(bool, bool, float x, float y)
osgPresentation::SlideEventHandler::_previousY
float _previousY
Definition SlideEventHandler:448
osgPresentation::SlideEventHandler::nextLayerOrSlide
bool nextLayerOrSlide()
osgPresentation::SlideEventHandler::set
void set(osg::Node *model)
osgPresentation::SlideEventHandler::_firstSlideOrLayerChange
bool _firstSlideOrLayerChange
Definition SlideEventHandler:454
osgPresentation::SlideEventHandler::previousSlide
bool previousSlide()
osgPresentation::SlideEventHandler::setReleaseAndCompileOnEachNewSlide
void setReleaseAndCompileOnEachNewSlide(bool flag)
Definition SlideEventHandler:392
osgPresentation::SlideEventHandler::previousLayer
bool previousLayer()
osgPresentation::SlideEventHandler::_requestReload
bool _requestReload
Definition SlideEventHandler:467
osgPresentation::SlideEventHandler::setAutoSteppingActive
void setAutoSteppingActive(bool flag=true)
Definition SlideEventHandler:382
osgPresentation::SlideEventHandler::checkNeedToDoFrame
virtual bool checkNeedToDoFrame()
osgPresentation::SlideEventHandler::setTimeDelayOnNewSlideWithMovies
void setTimeDelayOnNewSlideWithMovies(float t)
Definition SlideEventHandler:395
osgPresentation::SlideEventHandler::getTimeDelayBetweenSlides
double getTimeDelayBetweenSlides() const
Definition SlideEventHandler:386
osgPresentation::SlideEventHandler::getUsage
virtual void getUsage(osg::ApplicationUsage &usage) const
osgPresentation::SlideEventHandler::_showSwitch
osg::observer_ptr< osg::Switch > _showSwitch
Definition SlideEventHandler:428
osgPresentation::SlideEventHandler::getTimeDelayOnNewSlideWithMovies
float getTimeDelayOnNewSlideWithMovies() const
Definition SlideEventHandler:396
osgPresentation::SlideEventHandler::_activeOperators
ActiveOperators _activeOperators
Definition SlideEventHandler:463
osgPresentation::SlideEventHandler::_pause
bool _pause
Definition SlideEventHandler:443
osgPresentation::SlideEventHandler::_previousTime
double _previousTime
Definition SlideEventHandler:439
osgPresentation::SlideEventHandler::_referenceTime
double _referenceTime
Definition SlideEventHandler:438
osgPresentation::SlideEventHandler::home
bool home(const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &aa)
osgPresentation::SlideEventHandler::_slideSwitch
osg::observer_ptr< osg::Switch > _slideSwitch
Definition SlideEventHandler:434
osgPresentation::SlideEventHandler::previousLayerOrSlide
bool previousLayerOrSlide()
osgPresentation::SlideEventHandler::_cursorOn
bool _cursorOn
Definition SlideEventHandler:450
osgPresentation::SlideEventHandler::updateOperators
void updateOperators()
osgPresentation::SlideEventHandler::getPresentationSwitch
osg::Switch * getPresentationSwitch()
Definition SlideEventHandler:348
osgPresentation::SlideEventHandler::nextLayer
bool nextLayer()
osgPresentation::SlideEventHandler::setTimeDelayBetweenSlides
void setTimeDelayBetweenSlides(double dt)
Definition SlideEventHandler:385
osgViewer::Viewer
Definition Viewer:28
osg::ApplicationUsage
Definition ApplicationUsage:26
osg::CopyOp
Definition CopyOp:41
osg::CopyOp::SHALLOW_COPY
@ SHALLOW_COPY
Definition CopyOp:47
osg::NodeVisitor::TraversalMode
TraversalMode
Definition NodeVisitor:86
osg::NodeVisitor::TRAVERSE_ACTIVE_CHILDREN
@ TRAVERSE_ACTIVE_CHILDREN
Definition NodeVisitor:90
osg::Node
Definition Node:72
osg::Object
Definition Object:61
osg::Object::Object
Object()
Definition Object:69
osg::Referenced
Definition Referenced:44
osg::Switch
Definition Switch:27
osg::Vec3d
Definition Vec3d:30
osg::observer_ptr
Definition observer_ptr:39
osg::ref_ptr
Definition ref_ptr:32
osgDB::FilePathList
std::deque< std::string > FilePathList
Definition osgDB/Callbacks:28
osgGA
Definition Callback:21
osgPresentation
Definition AnimationMaterial:26
osgPresentation::Operation
Operation
Operations related to click to run/load/key events.
Definition SlideEventHandler:36
osgPresentation::JUMP
@ JUMP
Definition SlideEventHandler:40
osgPresentation::FORWARD_TOUCH_EVENT
@ FORWARD_TOUCH_EVENT
Definition SlideEventHandler:42
osgPresentation::FORWARD_MOUSE_EVENT
@ FORWARD_MOUSE_EVENT
Definition SlideEventHandler:41
osgPresentation::EVENT
@ EVENT
Definition SlideEventHandler:39
osgPresentation::LOAD
@ LOAD
Definition SlideEventHandler:38
osgPresentation::RUN
@ RUN
Definition SlideEventHandler:37
osg
Definition AlphaFunc:19
osg::Vec3
Vec3f Vec3
Definition Vec3:21
osg::Timer_t
unsigned long long Timer_t
Definition Timer:24
OSGPRESENTATION_EXPORT
#define OSGPRESENTATION_EXPORT
Definition osgPresentation/Export:38
osgPresentation::FilePathData::FilePathData
FilePathData(const osgDB::FilePathList &fpl)
Definition SlideEventHandler:261
osgPresentation::FilePathData::filePathList
osgDB::FilePathList filePathList
Definition SlideEventHandler:263
osgPresentation::HomePosition::eye
osg::Vec3d eye
Definition SlideEventHandler:155
osgPresentation::HomePosition::operator=
HomePosition & operator=(const HomePosition &rhs)
Definition SlideEventHandler:135
osgPresentation::HomePosition::META_Object
META_Object(osgPresentation, HomePosition)
osgPresentation::HomePosition::setCenter
void setCenter(const osg::Vec3d &c)
Definition SlideEventHandler:149
osgPresentation::HomePosition::up
osg::Vec3d up
Definition SlideEventHandler:157
osgPresentation::HomePosition::getEye
const osg::Vec3d & getEye() const
Definition SlideEventHandler:147
osgPresentation::HomePosition::getUp
const osg::Vec3d & getUp() const
Definition SlideEventHandler:153
osgPresentation::HomePosition::center
osg::Vec3d center
Definition SlideEventHandler:156
osgPresentation::HomePosition::setUp
void setUp(const osg::Vec3d &u)
Definition SlideEventHandler:152
osgPresentation::HomePosition::HomePosition
HomePosition(const osg::Vec3 &in_eye, const osg::Vec3 &in_center, const osg::Vec3 &in_up)
Definition SlideEventHandler:124
osgPresentation::HomePosition::setEye
void setEye(const osg::Vec3d &e)
Definition SlideEventHandler:146
osgPresentation::HomePosition::getCenter
const osg::Vec3d & getCenter() const
Definition SlideEventHandler:150
osgPresentation::HomePosition::HomePosition
HomePosition(const HomePosition &rhs, const osg::CopyOp &copyop=osg::CopyOp::SHALLOW_COPY)
Definition SlideEventHandler:129
osgPresentation::HomePosition::HomePosition
HomePosition()
Definition SlideEventHandler:119
osgPresentation::JumpData
Definition SlideEventHandler:46
osgPresentation::JumpData::JumpData
JumpData(bool in_relativeJump, int in_slideNum, int in_layerNum)
Definition SlideEventHandler:52
osgPresentation::JumpData::getSlideNum
int getSlideNum() const
Definition SlideEventHandler:97
osgPresentation::JumpData::relativeJump
bool relativeJump
Definition SlideEventHandler:108
osgPresentation::JumpData::setLayerNum
void setLayerNum(int num)
Definition SlideEventHandler:99
osgPresentation::JumpData::getRelativeJump
bool getRelativeJump() const
Definition SlideEventHandler:94
osgPresentation::JumpData::JumpData
JumpData(const std::string &in_slideName, const std::string &in_layerName)
Definition SlideEventHandler:57
osgPresentation::JumpData::getLayerName
const std::string & getLayerName() const
Definition SlideEventHandler:106
osgPresentation::JumpData::slideName
std::string slideName
Definition SlideEventHandler:112
osgPresentation::JumpData::jump
bool jump(SlideEventHandler *seh) const
osgPresentation::JumpData::getSlideName
const std::string & getSlideName() const
Definition SlideEventHandler:103
osgPresentation::JumpData::setSlideNum
void setSlideNum(int num)
Definition SlideEventHandler:96
osgPresentation::JumpData::layerNum
int layerNum
Definition SlideEventHandler:110
osgPresentation::JumpData::setRelativeJump
void setRelativeJump(bool flag)
Definition SlideEventHandler:93
osgPresentation::JumpData::layerName
std::string layerName
Definition SlideEventHandler:113
osgPresentation::JumpData::META_Object
META_Object(osgPresentation, JumpData)
osgPresentation::JumpData::slideNum
int slideNum
Definition SlideEventHandler:109
osgPresentation::JumpData::requiresJump
bool requiresJump() const
Definition SlideEventHandler:85
osgPresentation::JumpData::JumpData
JumpData()
Definition SlideEventHandler:47
osgPresentation::JumpData::getLayerNum
int getLayerNum() const
Definition SlideEventHandler:100
osgPresentation::JumpData::operator=
JumpData & operator=(const JumpData &rhs)
Definition SlideEventHandler:72
osgPresentation::JumpData::setSlideName
void setSlideName(const std::string &name)
Definition SlideEventHandler:102
osgPresentation::JumpData::JumpData
JumpData(const JumpData &rhs, const osg::CopyOp &copyop=osg::CopyOp::SHALLOW_COPY)
Definition SlideEventHandler:64
osgPresentation::JumpData::setLayerName
void setLayerName(const std::string &name)
Definition SlideEventHandler:105
osgPresentation::KeyPosition
Definition SlideEventHandler:161
osgPresentation::KeyPosition::_x
float _x
Definition SlideEventHandler:209
osgPresentation::KeyPosition::getKey
int getKey() const
Definition SlideEventHandler:196
osgPresentation::KeyPosition::getForwardToDevices
bool getForwardToDevices() const
Definition SlideEventHandler:205
osgPresentation::KeyPosition::KeyPosition
KeyPosition(const KeyPosition &rhs, const osg::CopyOp &copyop=osg::CopyOp::SHALLOW_COPY)
Definition SlideEventHandler:168
osgPresentation::KeyPosition::_y
float _y
Definition SlideEventHandler:210
osgPresentation::KeyPosition::setX
void setX(float x)
Definition SlideEventHandler:198
osgPresentation::KeyPosition::META_Object
META_Object(osgPresentation, KeyPosition)
osgPresentation::KeyPosition::getY
float getY() const
Definition SlideEventHandler:202
osgPresentation::KeyPosition::operator=
KeyPosition & operator=(const KeyPosition &rhs)
Definition SlideEventHandler:177
osgPresentation::KeyPosition::set
void set(unsigned int key=0, float x=FLT_MAX, float y=FLT_MAX, bool forward_to_devices=false)
Definition SlideEventHandler:187
osgPresentation::KeyPosition::_key
osgGA::GUIEventAdapter::KeySymbol _key
Definition SlideEventHandler:208
osgPresentation::KeyPosition::setKey
void setKey(int key)
Definition SlideEventHandler:195
osgPresentation::KeyPosition::_forwardToDevices
bool _forwardToDevices
Definition SlideEventHandler:211
osgPresentation::KeyPosition::setForwardToDevices
void setForwardToDevices(bool flag)
Definition SlideEventHandler:204
osgPresentation::KeyPosition::setY
void setY(float y)
Definition SlideEventHandler:201
osgPresentation::KeyPosition::KeyPosition
KeyPosition(unsigned int key=0, float x=FLT_MAX, float y=FLT_MAX, bool forward_to_devices=false)
Definition SlideEventHandler:162
osgPresentation::KeyPosition::getX
float getX() const
Definition SlideEventHandler:199
osgPresentation::LayerAttributes::Keys
std::vector< KeyPosition > Keys
Definition SlideEventHandler:227
osgPresentation::LayerAttributes::addRunString
void addRunString(const std::string &runString)
Definition SlideEventHandler:238
osgPresentation::LayerAttributes::_enterLayerCallbacks
LayerCallbacks _enterLayerCallbacks
Definition SlideEventHandler:255
osgPresentation::LayerAttributes::addLeaveCallback
void addLeaveCallback(LayerCallback *lc)
Definition SlideEventHandler:249
osgPresentation::LayerAttributes::setJump
void setJump(const JumpData &jumpData)
Definition SlideEventHandler:240
osgPresentation::LayerAttributes::RunStrings
std::vector< std::string > RunStrings
Definition SlideEventHandler:228
osgPresentation::LayerAttributes::_runStrings
RunStrings _runStrings
Definition SlideEventHandler:245
osgPresentation::LayerAttributes::_duration
double _duration
Definition SlideEventHandler:243
osgPresentation::LayerAttributes::callEnterCallbacks
void callEnterCallbacks(osg::Node *node)
osgPresentation::LayerAttributes::_leaveLayerCallbacks
LayerCallbacks _leaveLayerCallbacks
Definition SlideEventHandler:256
osgPresentation::LayerAttributes::getKeys
const Keys & getKeys() const
Definition SlideEventHandler:231
osgPresentation::LayerAttributes::addKey
void addKey(const KeyPosition &kp)
Definition SlideEventHandler:233
osgPresentation::LayerAttributes::LayerAttributes
LayerAttributes()
Definition SlideEventHandler:221
osgPresentation::LayerAttributes::LayerCallbacks
std::list< osg::ref_ptr< LayerCallback > > LayerCallbacks
Definition SlideEventHandler:254
osgPresentation::LayerAttributes::_jumpData
JumpData _jumpData
Definition SlideEventHandler:246
osgPresentation::LayerAttributes::getRunStrings
const RunStrings & getRunStrings() const
Definition SlideEventHandler:236
osgPresentation::LayerAttributes::_keys
Keys _keys
Definition SlideEventHandler:244
osgPresentation::LayerAttributes::getJumpData
const JumpData & getJumpData() const
Definition SlideEventHandler:241
osgPresentation::LayerAttributes::setDuration
void setDuration(double duration)
Definition SlideEventHandler:224
osgPresentation::LayerAttributes::getDuration
double getDuration() const
Definition SlideEventHandler:225
osgPresentation::LayerAttributes::setKeys
void setKeys(const Keys &keys)
Definition SlideEventHandler:230
osgPresentation::LayerAttributes::setRunStrings
void setRunStrings(const RunStrings &runStrings)
Definition SlideEventHandler:235
osgPresentation::LayerAttributes::addEnterCallback
void addEnterCallback(LayerCallback *lc)
Definition SlideEventHandler:248
osgPresentation::LayerAttributes::callLeaveCallbacks
void callLeaveCallbacks(osg::Node *node)
osgPresentation::LayerAttributes::LayerAttributes
LayerAttributes(double in_duration)
Definition SlideEventHandler:222
osgPresentation::LayerCallback
Definition SlideEventHandler:215
osgPresentation::LayerCallback::operator()
virtual void operator()(osg::Node *node) const =0
osgPresentation::ObjectOperator
Definition SlideEventHandler:277
osgPresentation::ObjectOperator::~ObjectOperator
virtual ~ObjectOperator()
Definition SlideEventHandler:289
osgPresentation::ObjectOperator::ptr
virtual void * ptr() const =0
osgPresentation::ObjectOperator::leave
virtual void leave(SlideEventHandler *)=0
osgPresentation::ObjectOperator::setPause
virtual void setPause(SlideEventHandler *, bool pause)=0
osgPresentation::ObjectOperator::operator<
bool operator<(const ObjectOperator &rhs) const
Definition SlideEventHandler:278
osgPresentation::ObjectOperator::frame
virtual void frame(SlideEventHandler *)
Definition SlideEventHandler:283
osgPresentation::ObjectOperator::maintain
virtual void maintain(SlideEventHandler *)=0
osgPresentation::ObjectOperator::enter
virtual void enter(SlideEventHandler *)=0
osgPresentation::ObjectOperator::reset
virtual void reset(SlideEventHandler *)=0
osgPresentation::dereference_less
Definition SlideEventHandler:268
osgPresentation::dereference_less::operator()
bool operator()(const T &lhs, const U &rhs) const
Definition SlideEventHandler:270