/* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield * * This software is open source and may be redistributed and/or modified under * the terms of the GNU General Public License (GPL) version 2.0. * The full license is in LICENSE.txt file included with this distribution,. * * This software 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 * include LICENSE.txt for more details. */ #include #include #include #include #include #include #include using namespace osgPresentation; PickEventHandler::PickEventHandler(osgPresentation::Operation operation, const JumpData& jumpData): _operation(operation), _jumpData(jumpData), _drawablesOnPush() { OSG_INFO<<"PickEventHandler::PickEventHandler(operation="< " << cloned_ea->getX() << "/" <getY() << std::endl; // dispatch cloned event to devices osgViewer::View::Devices& devices = viewer->getDevices(); for(osgViewer::View::Devices::iterator i = devices.begin(); i != devices.end(); ++i) { if((*i)->getCapabilities() & osgGA::Device::SEND_EVENTS) { (*i)->sendEvent(*cloned_ea); } } } else { if (ea.getEventType()==osgGA::GUIEventAdapter::PUSH) { _drawablesOnPush.insert( hitr->drawable.get() ); } else if (ea.getEventType()==osgGA::GUIEventAdapter::MOVE) { OSG_INFO<<"Tooltip..."<drawable.get()) != _drawablesOnPush.end()) doOperation(); return true; } } } } break; } case(osgGA::GUIEventAdapter::KEYDOWN): { //OSG_NOTICE<<"PickEventHandler KEYDOWN "<<(char)ea.getKey()<className()<dispatchEvent(_keyPos); break; } case(osgPresentation::JUMP): { OSG_INFO<<"Requires jump "<