Changeset 381 for experimental/distortionNG
- Timestamp:
- Jun 15, 2012, 7:22:30 AM (12 years ago)
- Location:
- experimental/distortionNG
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
experimental/distortionNG/DistortionManipulator.cpp
r380 r381 23 23 #include <osg/Point> 24 24 #include <osg/PolygonMode> 25 #include <osg/TextureRectangle> 25 26 26 27 #include <osgDB/Registry> … … 261 262 if( _distortionSet->isDirty() && _viewer.valid()) 262 263 { 263 _viewer->updateDistortion();264 updateDistortionSetup(); 264 265 } 265 266 //OSG_ALWAYS<<"..done"<<std::endl; … … 512 513 _highlighter->dirtyBound(); 513 514 } 515 516 void DistortionManipulator::updateDistortionSetup() 517 { 518 updateDistortionViewProjectionMatrix(); 519 updateDistortionMesh(); 520 } 521 522 void DistortionManipulator::updateDistortionViewProjectionMatrix() 523 { 524 if(!_distortionSet.valid()) 525 { 526 osg::notify(osg::WARN) << "You cannot update the distortion without distortion set up." << std::endl; 527 return; 528 } 529 530 if(_viewer.valid()) 531 { 532 _viewer->getCamera()->setViewMatrix(_distortionSet->getViewOffset()); 533 _viewer->getCamera()->setProjectionMatrix(_distortionSet->getProjectionOffset()); 534 } 535 else 536 OSG_NOTIFY(osg::ALWAYS)<<"Invalid viewer!"<<std::endl; 537 } 538 539 void DistortionManipulator::updateDistortionMesh() 540 { 541 542 } -
experimental/distortionNG/DistortionManipulator.h
r380 r381 80 80 void updateHUD(); 81 81 82 void updateDistortionSetup(); 83 void updateDistortionViewProjectionMatrix(); 84 void updateDistortionMesh(); 85 86 82 87 SetupMode activeSetupMode; 83 88 DistortionMode activeDistortionMode; … … 90 95 osg::ref_ptr<osg::Geometry> _highlighter; 91 96 osg::observer_ptr<osg::Camera> _camera; 92 97 osg::observer_ptr<extViewer> _viewer; 93 98 osg::Geometry* _distortionMesh; 94 99 const osg::Vec4 _highlightColor; -
experimental/distortionNG/extViewer.cpp
r380 r381 397 397 setUpViewForManualDistortion(ds); 398 398 } 399 400 void extViewer::updateDistortion()401 {402 if(!_distortionSet.valid())403 {404 osg::notify(osg::WARN) << "You cannot update the distortion without distortion set up." << std::endl;405 return;406 }407 408 this->getCamera()->setViewMatrix(_distortionSet->getViewOffset());409 this->getCamera()->setProjectionMatrix(_distortionSet->getProjectionOffset());410 } -
experimental/distortionNG/extViewer.h
r380 r381 51 51 void setUpIntensityMapBlending(std::string intensityMap); 52 52 53 /**54 * \brief This functions updates the distortion setup by applying the distortionSet values to the viewers distortion setup.55 *56 */57 void updateDistortion();58 53 59 54 osgViewer::DistortionSet* getDistortionSet() {return _distortionSet;}
Note: See TracChangeset
for help on using the changeset viewer.