Added support for new event visitor type into osgGA and osgProducer::Viewer,
and event callback into Drawable.
This commit is contained in:
@@ -12,9 +12,40 @@
|
||||
*/
|
||||
|
||||
#include <osgGA/GUIEventHandler>
|
||||
#include <osgGA/EventVisitor>
|
||||
|
||||
using namespace osgGA;
|
||||
|
||||
|
||||
void GUIEventHandler::operator()(osg::Node* node, osg::NodeVisitor* nv)
|
||||
{
|
||||
osgGA::EventVisitor* ev = dynamic_cast<osgGA::EventVisitor*>(nv);
|
||||
if (ev && ev->getActionAdapter() && !ev->getEventList().empty())
|
||||
{
|
||||
for(osgGA::EventVisitor::EventList::iterator itr = ev->getEventList().begin();
|
||||
itr != ev->getEventList().end();
|
||||
++itr)
|
||||
{
|
||||
handle(*(*itr), *(ev->getActionAdapter()));
|
||||
}
|
||||
}
|
||||
traverse(node,nv);
|
||||
}
|
||||
|
||||
void GUIEventHandler::event(osg::NodeVisitor* nv, osg::Drawable* /*drawable*/)
|
||||
{
|
||||
osgGA::EventVisitor* ev = dynamic_cast<osgGA::EventVisitor*>(nv);
|
||||
if (ev && ev->getActionAdapter() && !ev->getEventList().empty())
|
||||
{
|
||||
for(osgGA::EventVisitor::EventList::iterator itr = ev->getEventList().begin();
|
||||
itr != ev->getEventList().end();
|
||||
++itr)
|
||||
{
|
||||
handle(*(*itr), *(ev->getActionAdapter()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CompositeGUIEventHandler::getUsage(osg::ApplicationUsage& usage) const
|
||||
{
|
||||
for (ChildList::const_iterator itr=_children.begin();
|
||||
|
||||
Reference in New Issue
Block a user