Further improvements in p3d plugin

This commit is contained in:
Robert Osfield
2009-04-27 13:54:22 +00:00
parent 200c9e82f3
commit f0ff4afebc
2 changed files with 23 additions and 1 deletions

View File

@@ -632,7 +632,7 @@ SlideEventHandler::SlideEventHandler(osgViewer::Viewer* viewer):
_updateOpacityActive(false),
_previousX(0), _previousY(0),
_cursorOn(true),
_releaseAndCompileOnEachNewSlide(true),
_releaseAndCompileOnEachNewSlide(false),
_firstSlideOrLayerChange(true),
_tickAtFirstSlideOrLayerChange(0),
_tickAtLastSlideOrLayerChange(0),
@@ -729,6 +729,25 @@ double SlideEventHandler::getCurrentTimeDelayBetweenSlides() const
}
void SlideEventHandler::operator()(osg::Node* node, osg::NodeVisitor* nv)
{
osgGA::EventVisitor* ev = dynamic_cast<osgGA::EventVisitor*>(nv);
if (ev)
{
if (node->getNumChildrenRequiringEventTraversal()>0) traverse(node,nv);
if (ev->getActionAdapter() && !ev->getEvents().empty())
{
for(osgGA::EventQueue::Events::iterator itr = ev->getEvents().begin();
itr != ev->getEvents().end();
++itr)
{
handleWithCheckAgainstIgnoreHandledEventsMask(*(*itr), *(ev->getActionAdapter()), node, nv);
}
}
}
}
bool SlideEventHandler::handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionAdapter& aa)
{

View File

@@ -95,6 +95,9 @@ public:
virtual void accept(osgGA::GUIEventHandlerVisitor& v) { v.visit(*this); }
/** Event traversal node callback method.*/
virtual void operator()(osg::Node* node, osg::NodeVisitor* nv);
virtual bool handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionAdapter&);
virtual void getUsage(osg::ApplicationUsage& usage) const;