Changeset 10454
- Timestamp:
- 07/03/09 21:16:53 (4 years ago)
- Location:
- OpenSceneGraph/trunk
- Files:
-
- 8 modified
-
applications/osgviewer/osgviewer.cpp (modified) (3 diffs)
-
examples/osgmanipulator/osgmanipulator.cpp (modified) (2 diffs)
-
examples/osgvolume/osgvolume.cpp (modified) (1 diff)
-
include/osgManipulator/Dragger (modified) (1 diff)
-
src/osgManipulator/Dragger.cpp (modified) (3 diffs)
-
src/osgPlugins/ffmpeg/CMakeLists.txt (modified) (1 diff)
-
src/osgVolume/RayTracedTechnique.cpp (modified) (1 diff)
-
src/osgWrappers/osgManipulator/Dragger.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/applications/osgviewer/osgviewer.cpp
r10244 r10454 1 1 /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield 2 *3 * This application is open source and may be redistributed and/or modified4 * freely and without restriction, both in commericial and non commericial applications,5 * as long as this copyright notice is maintained.6 *7 * This application is distributed in the hope that it will be useful,8 * but WITHOUT ANY WARRANTY; without even the implied warranty of9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.2 * 3 * This application is open source and may be redistributed and/or modified 4 * freely and without restriction, both in commericial and non commericial applications, 5 * as long as this copyright notice is maintained. 6 * 7 * This application is distributed in the hope that it will be useful, 8 * but WITHOUT ANY WARRANTY; without even the implied warranty of 9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 10 10 */ 11 11 … … 16 16 #include <osg/Switch> 17 17 #include <osgText/Text> 18 #include <osg/Group> 18 19 19 20 #include <osgViewer/Viewer> … … 27 28 #include <osgGA/AnimationPathManipulator> 28 29 #include <osgGA/TerrainManipulator> 29 #include <osgGA/SphericalManipulator>30 30 31 31 #include <iostream> 32 32 33 #ifdef _WINDOWS 34 #include <Windows.h> 35 #include <GL/glext.h> 36 #include <GL/wglext.h> 37 #include "vsynctoggle_custom.h" 38 #endif 39 33 40 int main(int argc, char** argv) 34 41 { 35 // use an ArgumentParser object to manage the program arguments.36 osg::ArgumentParser arguments(&argc,argv);42 // use an ArgumentParser object to manage the program arguments. 43 osg::ArgumentParser arguments(&argc,argv); 37 44 38 arguments.getApplicationUsage()->setApplicationName(arguments.getApplicationName());39 arguments.getApplicationUsage()->setDescription(arguments.getApplicationName()+" is the standard OpenSceneGraph example which loads and visualises 3d models.");40 arguments.getApplicationUsage()->setCommandLineUsage(arguments.getApplicationName()+" [options] filename ...");41 arguments.getApplicationUsage()->addCommandLineOption("--image <filename>","Load an image and render it on a quad");42 arguments.getApplicationUsage()->addCommandLineOption("--dem <filename>","Load an image/DEM and render it on a HeightField");43 arguments.getApplicationUsage()->addCommandLineOption("--login <url> <username> <password>","Provide authentication information for http file access.");45 arguments.getApplicationUsage()->setApplicationName(arguments.getApplicationName()); 46 arguments.getApplicationUsage()->setDescription(arguments.getApplicationName()+" is the standard OpenSceneGraph example which loads and visualises 3d models."); 47 arguments.getApplicationUsage()->setCommandLineUsage(arguments.getApplicationName()+" [options] filename ..."); 48 arguments.getApplicationUsage()->addCommandLineOption("--image <filename>","Load an image and render it on a quad"); 49 arguments.getApplicationUsage()->addCommandLineOption("--dem <filename>","Load an image/DEM and render it on a HeightField"); 50 arguments.getApplicationUsage()->addCommandLineOption("--login <url> <username> <password>","Provide authentication information for http file access."); 44 51 45 osgViewer::Viewer viewer(arguments);52 osgViewer::Viewer viewer(arguments); 46 53 47 unsigned int helpType = 0; 48 if ((helpType = arguments.readHelpType())) 54 unsigned int helpType = 0; 55 if ((helpType = arguments.readHelpType())) 56 { 57 arguments.getApplicationUsage()->write(std::cout, helpType); 58 return 1; 59 } 60 61 // report any errors if they have occurred when parsing the program arguments. 62 if (arguments.errors()) 63 { 64 arguments.writeErrorMessages(std::cout); 65 return 1; 66 } 67 68 if (arguments.argc()<=1) 69 { 70 arguments.getApplicationUsage()->write(std::cout,osg::ApplicationUsage::COMMAND_LINE_OPTION); 71 return 1; 72 } 73 74 std::string url, username, password; 75 while(arguments.read("--login",url, username, password)) 76 { 77 if (!osgDB::Registry::instance()->getAuthenticationMap()) 49 78 { 50 arguments.getApplicationUsage()->write(std::cout, helpType); 51 return 1; 79 osgDB::Registry::instance()->setAuthenticationMap(new osgDB::AuthenticationMap); 80 osgDB::Registry::instance()->getAuthenticationMap()->addAuthenticationDetails( 81 url, 82 new osgDB::AuthenticationDetails(username, password) 83 ); 52 84 } 53 54 // report any errors if they have occurred when parsing the program arguments. 55 if (arguments.errors()) 85 } 86 87 // set up the camera manipulators. 88 { 89 osg::ref_ptr<osgGA::KeySwitchMatrixManipulator> keyswitchManipulator = new osgGA::KeySwitchMatrixManipulator; 90 91 keyswitchManipulator->addMatrixManipulator( '1', "Trackball", new osgGA::TrackballManipulator() ); 92 keyswitchManipulator->addMatrixManipulator( '2', "Flight", new osgGA::FlightManipulator() ); 93 keyswitchManipulator->addMatrixManipulator( '3', "Drive", new osgGA::DriveManipulator() ); 94 keyswitchManipulator->addMatrixManipulator( '4', "Terrain", new osgGA::TerrainManipulator() ); 95 96 std::string pathfile; 97 char keyForAnimationPath = '5'; 98 while (arguments.read("-p",pathfile)) 56 99 { 57 arguments.writeErrorMessages(std::cout);58 return 1;59 }60 61 if (arguments.argc()<=1)62 {63 arguments.getApplicationUsage()->write(std::cout,osg::ApplicationUsage::COMMAND_LINE_OPTION);64 return 1;100 osgGA::AnimationPathManipulator* apm = new osgGA::AnimationPathManipulator(pathfile); 101 if (apm || !apm->valid()) 102 { 103 unsigned int num = keyswitchManipulator->getNumMatrixManipulators(); 104 keyswitchManipulator->addMatrixManipulator( keyForAnimationPath, "Path", apm ); 105 keyswitchManipulator->selectMatrixManipulator(num); 106 ++keyForAnimationPath; 107 } 65 108 } 66 109 67 std::string url, username, password; 68 while(arguments.read("--login",url, username, password)) 69 { 70 if (!osgDB::Registry::instance()->getAuthenticationMap()) 71 { 72 osgDB::Registry::instance()->setAuthenticationMap(new osgDB::AuthenticationMap); 73 osgDB::Registry::instance()->getAuthenticationMap()->addAuthenticationDetails( 74 url, 75 new osgDB::AuthenticationDetails(username, password) 76 ); 77 } 78 } 110 viewer.setCameraManipulator( keyswitchManipulator.get() ); 111 } 79 112 80 // set up the camera manipulators. 81 { 82 osg::ref_ptr<osgGA::KeySwitchMatrixManipulator> keyswitchManipulator = new osgGA::KeySwitchMatrixManipulator; 113 // add the state manipulator 114 viewer.addEventHandler( new osgGA::StateSetManipulator(viewer.getCamera()->getOrCreateStateSet()) ); 83 115 84 keyswitchManipulator->addMatrixManipulator( '1', "Trackball", new osgGA::TrackballManipulator() ); 85 keyswitchManipulator->addMatrixManipulator( '2', "Flight", new osgGA::FlightManipulator() ); 86 keyswitchManipulator->addMatrixManipulator( '3', "Drive", new osgGA::DriveManipulator() ); 87 keyswitchManipulator->addMatrixManipulator( '4', "Terrain", new osgGA::TerrainManipulator() ); 88 keyswitchManipulator->addMatrixManipulator( '5', "Spherical", new osgGA::SphericalManipulator() ); 116 // add the thread model handler 117 viewer.addEventHandler(new osgViewer::ThreadingHandler); 89 118 90 std::string pathfile; 91 char keyForAnimationPath = '6'; 92 while (arguments.read("-p",pathfile)) 93 { 94 osgGA::AnimationPathManipulator* apm = new osgGA::AnimationPathManipulator(pathfile); 95 if (apm || !apm->valid()) 96 { 97 unsigned int num = keyswitchManipulator->getNumMatrixManipulators(); 98 keyswitchManipulator->addMatrixManipulator( keyForAnimationPath, "Path", apm ); 99 keyswitchManipulator->selectMatrixManipulator(num); 100 ++keyForAnimationPath; 101 } 102 } 119 // add the window size toggle handler 120 viewer.addEventHandler(new osgViewer::WindowSizeHandler); 103 121 104 viewer.setCameraManipulator( keyswitchManipulator.get() );105 }122 // add the stats handler 123 viewer.addEventHandler(new osgViewer::StatsHandler); 106 124 107 // add the state manipulator 108 viewer.addEventHandler( new osgGA::StateSetManipulator(viewer.getCamera()->getOrCreateStateSet()) ); 109 110 // add the thread model handler 111 viewer.addEventHandler(new osgViewer::ThreadingHandler); 125 // add the help handler 126 viewer.addEventHandler(new osgViewer::HelpHandler(arguments.getApplicationUsage())); 112 127 113 // add the window size toggle handler 114 viewer.addEventHandler(new osgViewer::WindowSizeHandler); 115 116 // add the stats handler 117 viewer.addEventHandler(new osgViewer::StatsHandler); 128 // add the record camera path handler 129 viewer.addEventHandler(new osgViewer::RecordCameraPathHandler); 118 130 119 // add the helphandler120 viewer.addEventHandler(new osgViewer::HelpHandler(arguments.getApplicationUsage()));131 // add the LOD Scale handler 132 viewer.addEventHandler(new osgViewer::LODScaleHandler); 121 133 122 // add the record camera pathhandler123 viewer.addEventHandler(new osgViewer::RecordCameraPathHandler);134 // add the screen capture handler 135 viewer.addEventHandler(new osgViewer::ScreenCaptureHandler); 124 136 125 // add the LOD Scale handler 126 viewer.addEventHandler(new osgViewer::LODScaleHandler); 137 // load the data 138 osg::ref_ptr<osg::Node> loadedModel = osgDB::readNodeFiles(arguments); 139 if (!loadedModel) 140 { 141 std::cout << arguments.getApplicationName() <<": No data loaded" << std::endl; 142 return 1; 143 } 127 144 128 // add the screen capture handler129 viewer.addEventHandler(new osgViewer::ScreenCaptureHandler);145 // any option left unread are converted into errors to write out later. 146 arguments.reportRemainingOptionsAsUnrecognized(); 130 147 131 // load the data 132 osg::ref_ptr<osg::Node> loadedModel = osgDB::readNodeFiles(arguments); 133 if (!loadedModel) 134 { 135 std::cout << arguments.getApplicationName() <<": No data loaded" << std::endl; 136 return 1; 137 } 138 139 // any option left unread are converted into errors to write out later. 140 arguments.reportRemainingOptionsAsUnrecognized(); 141 142 // report any errors if they have occurred when parsing the program arguments. 143 if (arguments.errors()) 144 { 145 arguments.writeErrorMessages(std::cout); 146 return 1; 147 } 148 // report any errors if they have occurred when parsing the program arguments. 149 if (arguments.errors()) 150 { 151 arguments.writeErrorMessages(std::cout); 152 return 1; 153 } 148 154 149 155 150 // optimize the scene graph, remove redundant nodes and state etc.151 osgUtil::Optimizer optimizer;152 optimizer.optimize(loadedModel.get());156 // optimize the scene graph, remove redundant nodes and state etc. 157 osgUtil::Optimizer optimizer; 158 optimizer.optimize(loadedModel.get()); 153 159 154 viewer.setSceneData( loadedModel.get() ); 160 osg::ref_ptr<osg::Group> group = new osg::Group(); 161 group->addChild(loadedModel.get()); 155 162 156 viewer.realize();163 viewer.setSceneData( group.get() ); 157 164 158 return viewer.run(); 165 { 166 char tmp[256]; 167 tmp[sizeof(tmp) - 1] = 0; 168 getcwd(tmp, sizeof(tmp) - 1); 169 170 std::string path(tmp); 171 path += "\\system\\cache\\planet"; 172 173 tmp[sizeof(tmp) - 1] = 0; 174 snprintf(tmp, sizeof(tmp) - 1, "%s", path.c_str()); 175 //_putenv(tmp); 176 // osgDB::Registry::instance()->setFileCache(new osgDB::FileCache( tmp ) ); 177 viewer.getDatabasePager()->setTargetMaximumNumberOfPageLOD(500); 178 179 #ifdef _WINDOWS 180 osg::ref_ptr<baronvsync::CVsyncDrawable> vsync = new baronvsync::CVsyncDrawable(); 181 osg::ref_ptr<osg::Geode> vsyncGeode = new osg::Geode(); 182 vsyncGeode->addDrawable(vsync.get()); 183 vsync->SetVSync(false); 184 group->addChild(vsyncGeode.get()); 185 #endif 186 187 } 188 189 viewer.realize(); 190 191 return viewer.run(); 159 192 160 193 } -
OpenSceneGraph/trunk/examples/osgmanipulator/osgmanipulator.cpp
r10439 r10454 99 99 osgManipulator::Dragger* dragger = createDragger(name); 100 100 101 dragger->setHandleEvents(true);102 101 103 102 osg::Group* root = new osg::Group; … … 110 109 111 110 dragger->addTransformUpdating(selection); 111 112 // we want the dragger to handle it's own events automatically 113 dragger->setHandleEvents(true); 114 115 // if we don't set an activation key or mod mask then any mouse click on 116 // the dragger will activate it, however if do define either of ActivationModKeyMask or 117 // and ActivationKeyEvent then you'll have to press either than mod key or the specified key to 118 // be able to activate the dragger when you mouse click on it. Please note the follow allows 119 // activation if either the ctrl key or the 'a' key is pressed and held down. 120 dragger->setActivationModKeyMask(osgGA::GUIEventAdapter::MODKEY_CTRL); 121 dragger->setActivationKeyEvent('a'); 112 122 113 123 return root; -
OpenSceneGraph/trunk/examples/osgvolume/osgvolume.cpp
r10448 r10454 1478 1478 dragger->setupDefaultGeometry(); 1479 1479 dragger->setHandleEvents(true); 1480 dragger->setActivationModKeyMask(osgGA::GUIEventAdapter::MODKEY_SHIFT); 1480 1481 dragger->addDraggerCallback(new DraggerVolumeTileCallback(tile.get(), tile->getLocator())); 1481 1482 dragger->setMatrix(osg::Matrix::translate(0.5,0.5,0.5)*tile->getLocator()->getTransform()); -
OpenSceneGraph/trunk/include/osgManipulator/Dragger
r10446 r10454 218 218 bool getHandleEvents() const { return _handleEvents; } 219 219 220 void setActivationModKeyMask(unsigned int mask) { _activationModKeyMask = mask; } 221 unsigned int getActivationModKeyMask() const { return _activationModKeyMask; } 222 223 void setActivationKeyEvent(int key) { _activationKeyEvent = key; } 224 int getActivationKeyEvent() const { return _activationKeyEvent; } 225 226 227 virtual void traverse(osg::NodeVisitor& nv); 228 229 virtual bool handle(const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& aa); 230 virtual bool handle(const PointerInfo&, const osgGA::GUIEventAdapter&, osgGA::GUIActionAdapter&) { return false; } 231 232 233 typedef std::vector< osg::ref_ptr<Constraint> > Constraints; 234 235 void addConstraint(Constraint* constraint); 236 void removeConstraint(Constraint* constraint); 237 238 Constraints& getConstraints() { return _constraints; } 239 const Constraints& getConstraints() const { return _constraints; } 240 241 242 typedef std::vector< osg::ref_ptr<DraggerCallback> > DraggerCallbacks; 243 244 void addDraggerCallback(DraggerCallback* dc); 245 void removeDraggerCallback(DraggerCallback* dc); 246 247 DraggerCallbacks& getDraggerCallbacks() { return _draggerCallbacks; } 248 const DraggerCallbacks& getDraggerCallbacks() const { return _draggerCallbacks; } 249 250 void addTransformUpdating(MatrixTransform* transform); 251 void removeTransformUpdating(MatrixTransform* transform); 252 253 /** Setup default geometry for dragger. */ 254 virtual void setupDefaultGeometry() {} 255 256 protected: 257 258 Dragger(); 259 Dragger(const Dragger& rhs, const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY); 260 261 virtual ~Dragger(); 262 263 virtual bool receive(const MotionCommand& command); 264 void dispatch(MotionCommand& command); 265 220 266 void setDraggerActive(bool active) { _draggerActive = active; } 221 267 bool getDraggerActive() const { return _draggerActive; } 222 268 223 224 virtual void traverse(osg::NodeVisitor& nv);225 226 virtual bool handle(const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& aa);227 virtual bool handle(const PointerInfo&, const osgGA::GUIEventAdapter&, osgGA::GUIActionAdapter&) { return false; }228 229 230 typedef std::vector< osg::ref_ptr<Constraint> > Constraints;231 232 void addConstraint(Constraint* constraint);233 void removeConstraint(Constraint* constraint);234 235 Constraints& getConstraints() { return _constraints; }236 const Constraints& getConstraints() const { return _constraints; }237 238 239 typedef std::vector< osg::ref_ptr<DraggerCallback> > DraggerCallbacks;240 241 void addDraggerCallback(DraggerCallback* dc);242 void removeDraggerCallback(DraggerCallback* dc);243 244 DraggerCallbacks& getDraggerCallbacks() { return _draggerCallbacks; }245 const DraggerCallbacks& getDraggerCallbacks() const { return _draggerCallbacks; }246 247 void addTransformUpdating(MatrixTransform* transform);248 void removeTransformUpdating(MatrixTransform* transform);249 250 /** Setup default geometry for dragger. */251 virtual void setupDefaultGeometry() {}252 253 protected:254 255 Dragger();256 Dragger(const Dragger& rhs, const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY);257 258 virtual ~Dragger();259 260 virtual bool receive(const MotionCommand& command);261 void dispatch(MotionCommand& command);262 263 269 bool _handleEvents; 264 270 bool _draggerActive; 271 272 unsigned int _activationModKeyMask; 273 int _activationKeyEvent; 274 bool _activationPermittedByModKeyMask; 275 bool _activationPermittedByKeyEvent; 276 265 277 osgManipulator::PointerInfo _pointer; 266 278 -
OpenSceneGraph/trunk/src/osgManipulator/Dragger.cpp
r10443 r10454 126 126 Dragger::Dragger() : 127 127 _handleEvents(false), 128 _draggerActive(false) 128 _draggerActive(false), 129 _activationModKeyMask(0), 130 _activationKeyEvent(0), 131 _activationPermittedByModKeyMask(false), 132 _activationPermittedByKeyEvent(false) 129 133 { 130 134 _parentDragger = this; … … 136 140 137 141 Dragger::Dragger(const Dragger& rhs, const osg::CopyOp& copyop): 138 osg::MatrixTransform(rhs, copyop) 142 osg::MatrixTransform(rhs, copyop), 143 _handleEvents(rhs._handleEvents), 144 _draggerActive(false), 145 _activationModKeyMask(rhs._activationModKeyMask), 146 _activationKeyEvent(rhs._activationKeyEvent), 147 _activationPermittedByModKeyMask(false), 148 _activationPermittedByKeyEvent(false) 139 149 { 140 150 osg::notify(osg::NOTICE)<<"CompositeDragger::CompositeDragger(const CompositeDragger& rhs, const osg::CopyOp& copyop) not Implemented yet."<<std::endl; … … 251 261 bool handled = false; 252 262 253 switch (ea.getEventType()) 254 { 255 case osgGA::GUIEventAdapter::PUSH: 256 { 257 osgUtil::LineSegmentIntersector::Intersections intersections; 258 259 _pointer.reset(); 260 261 if (view->computeIntersections(ea.getX(),ea.getY(),intersections)) 263 bool activationPermitted = true; 264 if (_activationModKeyMask!=0 || _activationKeyEvent!=0) 265 { 266 _activationPermittedByModKeyMask = (_activationModKeyMask!=0) ? 267 ((ea.getModKeyMask() & _activationModKeyMask)!=0) : 268 false; 269 270 if (_activationKeyEvent!=0) 271 { 272 switch (ea.getEventType()) 262 273 { 263 _pointer.setCamera(view->getCamera()); 264 _pointer.setMousePosition(ea.getX(), ea.getY()); 265 266 for(osgUtil::LineSegmentIntersector::Intersections::iterator hitr = intersections.begin(); 267 hitr != intersections.end(); 268 ++hitr) 274 case osgGA::GUIEventAdapter::KEYDOWN: 269 275 { 270 _pointer.addIntersection(hitr->nodePath, hitr->getLocalIntersectPoint()); 276 if (ea.getKey()==_activationKeyEvent) _activationPermittedByKeyEvent = true; 277 break; 271 278 } 272 for (osg::NodePath::iterator itr = _pointer._hitList.front().first.begin(); 273 itr != _pointer._hitList.front().first.end(); 274 ++itr) 279 case osgGA::GUIEventAdapter::KEYUP: 275 280 { 276 osgManipulator::Dragger* dragger = dynamic_cast<osgManipulator::Dragger*>(*itr); 277 if (dragger) 281 if (ea.getKey()==_activationKeyEvent) _activationPermittedByKeyEvent = false; 282 break; 283 } 284 default: 285 break; 286 } 287 } 288 289 activationPermitted = _activationPermittedByModKeyMask || _activationPermittedByKeyEvent; 290 291 } 292 293 if (activationPermitted || _draggerActive) 294 { 295 switch (ea.getEventType()) 296 { 297 case osgGA::GUIEventAdapter::PUSH: 298 { 299 osgUtil::LineSegmentIntersector::Intersections intersections; 300 301 _pointer.reset(); 302 303 if (view->computeIntersections(ea.getX(),ea.getY(),intersections)) 304 { 305 _pointer.setCamera(view->getCamera()); 306 _pointer.setMousePosition(ea.getX(), ea.getY()); 307 308 for(osgUtil::LineSegmentIntersector::Intersections::iterator hitr = intersections.begin(); 309 hitr != intersections.end(); 310 ++hitr) 278 311 { 279 if (dragger==this) 312 _pointer.addIntersection(hitr->nodePath, hitr->getLocalIntersectPoint()); 313 } 314 for (osg::NodePath::iterator itr = _pointer._hitList.front().first.begin(); 315 itr != _pointer._hitList.front().first.end(); 316 ++itr) 317 { 318 osgManipulator::Dragger* dragger = dynamic_cast<osgManipulator::Dragger*>(*itr); 319 if (dragger) 280 320 { 281 dragger->handle(_pointer, ea, aa); 282 dragger->setDraggerActive(true); 283 handled = true; 321 if (dragger==this) 322 { 323 dragger->handle(_pointer, ea, aa); 324 dragger->setDraggerActive(true); 325 handled = true; 326 } 284 327 } 285 328 } 286 329 } 287 330 } 288 } 289 case osgGA::GUIEventAdapter::DRAG: 290 case osgGA::GUIEventAdapter::RELEASE: 291 { 292 if (_draggerActive) 331 case osgGA::GUIEventAdapter::DRAG: 332 case osgGA::GUIEventAdapter::RELEASE: 293 333 { 294 _pointer._hitIter = _pointer._hitList.begin(); 295 _pointer.setCamera(view->getCamera()); 296 _pointer.setMousePosition(ea.getX(), ea.getY()); 297 298 handle(_pointer, ea, aa); 299 300 handled = true; 334 if (_draggerActive) 335 { 336 _pointer._hitIter = _pointer._hitList.begin(); 337 _pointer.setCamera(view->getCamera()); 338 _pointer.setMousePosition(ea.getX(), ea.getY()); 339 340 handle(_pointer, ea, aa); 341 342 handled = true; 343 } 344 break; 301 345 } 302 break; 303 } 304 default: 305 break; 306 } 307 308 if (_draggerActive && ea.getEventType() == osgGA::GUIEventAdapter::RELEASE) 309 { 310 setDraggerActive(false); 311 _pointer.reset(); 346 default: 347 break; 348 } 349 350 if (_draggerActive && ea.getEventType() == osgGA::GUIEventAdapter::RELEASE) 351 { 352 setDraggerActive(false); 353 _pointer.reset(); 354 } 312 355 } 313 356 -
OpenSceneGraph/trunk/src/osgPlugins/ffmpeg/CMakeLists.txt
r10414 r10454 46 46 # Remove -pedantic flag as it barfs on ffmoeg headers 47 47 STRING(REGEX REPLACE "-pedantic" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") 48 49 48 ENDIF() 50 49 -
OpenSceneGraph/trunk/src/osgVolume/RayTracedTechnique.cpp
r10445 r10454 460 460 osg::ref_ptr<TexGenLocatorCallback> locatorCallback = new TexGenLocatorCallback(texgen, masterLocator, layerLocator); 461 461 masterLocator->addCallback(locatorCallback.get()); 462 layerLocator->addCallback(locatorCallback.get());462 if (masterLocator != layerLocator) layerLocator->addCallback(locatorCallback.get()); 463 463 464 464 stateset->setTextureAttributeAndModes(0, texgen, osg::StateAttribute::ON); -
OpenSceneGraph/trunk/src/osgWrappers/osgManipulator/Dragger.cpp
r10449 r10454 216 216 "", 217 217 ""); 218 I_Method1(void, setDraggerActive, IN, bool, active, 219 Properties::NON_VIRTUAL, 220 __void__setDraggerActive__bool, 221 "", 222 ""); 223 I_Method0(bool, getDraggerActive, 224 Properties::NON_VIRTUAL, 225 __bool__getDraggerActive, 218 I_Method1(void, setActivationModKeyMask, IN, unsigned int, mask, 219 Properties::NON_VIRTUAL, 220 __void__setActivationModKeyMask__unsigned_int, 221 "", 222 ""); 223 I_Method0(unsigned int, getActivationModKeyMask, 224 Properties::NON_VIRTUAL, 225 __unsigned_int__getActivationModKeyMask, 226 "", 227 ""); 228 I_Method1(void, setActivationKeyEvent, IN, int, key, 229 Properties::NON_VIRTUAL, 230 __void__setActivationKeyEvent__int, 231 "", 232 ""); 233 I_Method0(int, getActivationKeyEvent, 234 Properties::NON_VIRTUAL, 235 __int__getActivationKeyEvent, 226 236 "", 227 237 ""); … … 315 325 "", 316 326 ""); 327 I_ProtectedMethod1(void, setDraggerActive, IN, bool, active, 328 Properties::NON_VIRTUAL, 329 Properties::NON_CONST, 330 __void__setDraggerActive__bool, 331 "", 332 ""); 333 I_ProtectedMethod0(bool, getDraggerActive, 334 Properties::NON_VIRTUAL, 335 Properties::CONST, 336 __bool__getDraggerActive, 337 "", 338 ""); 339 I_SimpleProperty(int, ActivationKeyEvent, 340 __int__getActivationKeyEvent, 341 __void__setActivationKeyEvent__int); 342 I_SimpleProperty(unsigned int, ActivationModKeyMask, 343 __unsigned_int__getActivationModKeyMask, 344 __void__setActivationModKeyMask__unsigned_int); 317 345 I_SimpleProperty(osgManipulator::CompositeDragger *, Composite, 318 346 __CompositeDragger_P1__getComposite, … … 321 349 __Constraints_R1__getConstraints, 322 350 0); 323 I_SimpleProperty(bool, DraggerActive,324 __bool__getDraggerActive,325 __void__setDraggerActive__bool);326 351 I_SimpleProperty(osgManipulator::Dragger::DraggerCallbacks &, DraggerCallbacks, 327 352 __DraggerCallbacks_R1__getDraggerCallbacks,
