Re-instated the code to allow event handler to run in standard viewers like osgviewer

This commit is contained in:
Robert Osfield
2009-04-29 20:55:48 +00:00
parent 590ac02859
commit 7cf721d1b5
3 changed files with 52 additions and 13 deletions

View File

@@ -1561,11 +1561,14 @@ osgDB::ReaderWriter::ReadResult ReaderWriterP3DXML::readNode(const std::string&
osgDB::getDataFilePathList() = previousPaths;
return constructor.takePresentation();
/*
std::cout<<"readSlide="<<readSlide<<std::endl;
std::cout<<"node="<<node<<std::endl;
return node;*/
osg::ref_ptr<osg::Node> presentation_node = constructor.takePresentation();
osgPresentation::SlideEventHandler* seh = new osgPresentation::SlideEventHandler;
seh->set(presentation_node.get());
presentation_node->setEventCallback(seh);
return presentation_node.release();
}