Changeset 347 for experimental/distortionNG/DistortionManipulator.cpp
- Timestamp:
- Apr 20, 2012, 10:51:36 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
experimental/distortionNG/DistortionManipulator.cpp
r346 r347 18 18 19 19 #include "DistortionManipulator.h" 20 21 #include<osgViewer/Viewer> 20 22 21 23 using namespace osg; … … 44 46 bool DistortionManipulator::handle(const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& aa, osg::Object*, osg::NodeVisitor* nv) 45 47 { 46 switch(ea.getEventType()) 48 osgViewer::View* viewer = dynamic_cast<osgViewer::View*>(&aa); 49 if ( viewer ) 50 { 51 //osg::notify(osg::ALWAYS)<<"viewer!"<<std::endl; 52 } 53 54 switch(ea.getEventType()) 47 55 { 48 56 case(osgGA::GUIEventAdapter::MOVE): … … 55 63 case(osgGA::GUIEventAdapter::RELEASE): 56 64 case(osgGA::GUIEventAdapter::KEYDOWN): 65 { 66 if (ea.getKey()==osgGA::GUIEventAdapter::KEY_KP_End) // KP 1: reset distortion 67 { 68 resetDistortion(); 69 return(true); 70 } 71 if (ea.getKey()==osgGA::GUIEventAdapter::KEY_KP_Down) // KP 2: reset intensity map 72 { 73 resetIntensityMap(); 74 return(true); 75 } 76 if (ea.getKey()==osgGA::GUIEventAdapter::KEY_KP_Left) // KP 4: Toggles Setup Mode between DISABLED, MANUAL & DELEGATED. 77 { 78 osg::notify(osg::ALWAYS)<<"KEY_KP_4"<<std::endl; 79 return(true); 80 } 81 if (ea.getKey()==osgGA::GUIEventAdapter::KEY_KP_Begin) // KP 5: MANUAL Mode: Toggle between blending & distortion setup. 82 { 83 osg::notify(osg::ALWAYS)<<"KEY_KP_5"<<std::endl; 84 return(true); 85 } 86 if (ea.getKey()==osgGA::GUIEventAdapter::KEY_KP_Right) // KP 6: MANUAL Mode: Toggle if distortion drags affect mesh or rtt texture coordinates -> defaults to Mesh 87 { 88 osg::notify(osg::ALWAYS)<<"KEY_KP_6"<<std::endl; 89 return(true); 90 } 91 if (ea.getKey()==osgGA::GUIEventAdapter::KEY_KP_Home) // KP 7: Show distortion mesh / intensity map / none. 92 { 93 osg::notify(osg::ALWAYS)<<"KEY_KP_7"<<std::endl; 94 return(true); 95 } 96 if (ea.getKey()==osgGA::GUIEventAdapter::KEY_KP_Up) // KP 8: Save distortion set via plugin 97 { 98 osg::notify(osg::ALWAYS)<<"KEY_KP_8"<<std::endl; 99 return(true); 100 } 101 102 103 return false; // Event ignored 104 } 57 105 case(osgGA::GUIEventAdapter::KEYUP): 58 106 case(osgGA::GUIEventAdapter::FRAME): 59 107 { 60 osg::notify(osg::ALWAYS)<<"FRAME!"<<std::endl;108 //osg::notify(osg::ALWAYS)<<"FRAME!"<<std::endl; 61 109 break; 62 110 } … … 72 120 return false; 73 121 } 122 123 void DistortionManipulator::resetIntensityMap() 124 { 125 osg::notify(osg::ALWAYS)<<"ToDo: resetIntensityMap()"<<std::endl; 126 } 127 128 void DistortionManipulator::resetDistortion() 129 { 130 osg::notify(osg::ALWAYS)<<"ToDo: resetDistortion()"<<std::endl; 131 }
Note: See TracChangeset
for help on using the changeset viewer.