Changeset 13172
- Timestamp:
- 05/23/13 14:29:55 (62 minutes ago)
- Location:
- OpenSceneGraph/trunk
- Files:
-
- 7 added
- 8 modified
-
include/osgDB/ReadFile (modified) (1 diff)
-
include/osgGA/Device (added)
-
include/osgViewer/View (modified) (3 diffs)
-
include/osgViewer/ViewerBase (modified) (1 diff)
-
src/osgGA/CMakeLists.txt (modified) (2 diffs)
-
src/osgGA/Device.cpp (added)
-
src/osgPlugins/CMakeLists.txt (modified) (1 diff)
-
src/osgPlugins/sdl (added)
-
src/osgPlugins/sdl/CMakeLists.txt (added)
-
src/osgPlugins/sdl/JoystickDevice.cpp (added)
-
src/osgPlugins/sdl/JoystickDevice.h (added)
-
src/osgPlugins/sdl/ReaderWriterSDL.cpp (added)
-
src/osgViewer/CompositeViewer.cpp (modified) (2 diffs)
-
src/osgViewer/View.cpp (modified) (1 diff)
-
src/osgViewer/Viewer.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/include/osgDB/ReadFile
r13041 r13172 44 44 inline osg::Object* readObjectFile(const std::string& filename) 45 45 { 46 return readObjectFile(filename,Registry::instance()->getOptions()); 47 } 46 return readObjectFile(filename, Registry::instance()->getOptions()); 47 } 48 49 template<typename T> 50 inline T* readFile(const std::string& filename, const Options* options) 51 { 52 osg::ref_ptr<osg::Object> object = readObjectFile(filename, options); 53 osg::ref_ptr<T> t = dynamic_cast<T*>(object.get()); 54 object = 0; 55 return t.release(); 56 } 57 58 template<typename T> 59 inline T* readFile(const std::string& filename) 60 { 61 return readFile<T>(filename, Registry::instance()->getOptions()); 62 } 63 48 64 49 65 /** Read an osg::Image from file. -
OpenSceneGraph/trunk/include/osgViewer/View
r13053 r13172 25 25 #include <osgGA/EventVisitor> 26 26 #include <osgGA/EventQueue> 27 #include <osgGA/Device> 27 28 28 29 #include <osgViewer/Scene> … … 109 110 const osgDB::ImagePager* getImagePager() const; 110 111 112 113 /** Add a Device. 114 * The Device is polled on each new frame via it's Device::checkEvents() method and any events generated then collected via Device::getEventQueue()*/ 115 void addDevice(osgGA::Device* eventSource); 116 117 /** Remove a Device. /*/ 118 void removeDevice(osgGA::Device* eventSource); 119 120 typedef std::vector< osg::ref_ptr<osgGA::Device> > Devices; 121 122 Devices& getDevices() { return _eventSources; } 123 const Devices& getDevices() const { return _eventSources; } 124 111 125 112 126 /* Set the EventQueue that the View uses to integrate external non window related events.*/ … … 251 265 osg::Timer_t _startTick; 252 266 267 Devices _eventSources; 268 253 269 osg::ref_ptr<osgViewer::Scene> _scene; 254 270 osg::ref_ptr<osgGA::EventQueue> _eventQueue; -
OpenSceneGraph/trunk/include/osgViewer/ViewerBase
r13041 r13172 118 118 119 119 120 121 120 /** Set the done flag to signal the viewer's work is done and should exit the frame loop.*/ 122 121 void setDone(bool done) { _done = done; } -
OpenSceneGraph/trunk/src/osgGA/CMakeLists.txt
r12208 r13172 11 11 ${HEADER_PATH}/AnimationPathManipulator 12 12 ${HEADER_PATH}/DriveManipulator 13 ${HEADER_PATH}/Device 13 14 ${HEADER_PATH}/EventQueue 14 15 ${HEADER_PATH}/EventVisitor … … 37 38 AnimationPathManipulator.cpp 38 39 DriveManipulator.cpp 40 Device.cpp 39 41 EventQueue.cpp 40 42 EventVisitor.cpp -
OpenSceneGraph/trunk/src/osgPlugins/CMakeLists.txt
r13161 r13172 257 257 ADD_SUBDIRECTORY(pvr) 258 258 259 #################################################### 260 # 261 # Device integration plugins 262 # 263 IF (SDL_FOUND) 264 ADD_SUBDIRECTORY(sdl) 265 ENDIF(SDL_FOUND) 266 267 259 268 ##########to get all the variables of Cmake 260 269 #GET_CMAKE_PROPERTY(MYVARS VARIABLES) -
OpenSceneGraph/trunk/src/osgViewer/CompositeViewer.cpp
r13111 r13172 736 736 } 737 737 738 // get events from all windows attached to Viewer. 738 739 for(Contexts::iterator citr = contexts.begin(); 739 740 citr != contexts.end(); … … 926 927 { 927 928 View* view = vitr->get(); 929 930 // get events from user Devices attached to Viewer. 931 for(osgViewer::View::Devices::iterator eitr = view->getDevices().begin(); 932 eitr != view->getDevices().end(); 933 ++eitr) 934 { 935 osgGA::Device* es = eitr->get(); 936 es->checkEvents(); 937 938 // open question, will we need to reproject mouse coordinates into current view's coordinate frame as is down for GraphicsWindow provided events? 939 // for now assume now and just get the events directly without any reprojection. 940 es->getEventQueue()->takeEvents(viewEventsMap[view], cutOffTime); 941 } 942 928 943 view->getEventQueue()->takeEvents(viewEventsMap[view], cutOffTime); 929 944 } -
OpenSceneGraph/trunk/src/osgViewer/View.cpp
r13041 r13172 2218 2218 2219 2219 2220 void View::addDevice(osgGA::Device* eventSource) 2221 { 2222 Devices::iterator itr = std::find( _eventSources.begin(), _eventSources.end(), eventSource ); 2223 if (itr==_eventSources.end()) 2224 { 2225 _eventSources.push_back(eventSource); 2226 } 2227 } 2228 2229 void View::removeDevice(osgGA::Device* eventSource) 2230 { 2231 Devices::iterator itr = std::find( _eventSources.begin(), _eventSources.end(), eventSource ); 2232 if (itr!=_eventSources.end()) 2233 { 2234 _eventSources.erase(itr); 2235 } 2236 } -
OpenSceneGraph/trunk/src/osgViewer/Viewer.cpp
r13136 r13172 646 646 647 647 648 // get events from user Devices attached to Viewer. 649 for(Devices::iterator eitr = _eventSources.begin(); 650 eitr != _eventSources.end(); 651 ++eitr) 652 { 653 osgGA::Device* es = eitr->get(); 654 es->checkEvents(); 655 656 // open question, will we need to reproject mouse coordinates into current view's coordinate frame as is down for GraphicsWindow provided events? 657 // for now assume now and just get the events directly without any reprojection. 658 es->getEventQueue()->takeEvents(events, cutOffTime); 659 } 660 661 // get events from all windows attached to Viewer. 648 662 for(Contexts::iterator citr = contexts.begin(); 649 663 citr != contexts.end();
