Changeset 357
- Timestamp:
- Apr 22, 2012, 9:01:45 AM (13 years ago)
- Location:
- experimental/distortionNG
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
experimental/distortionNG/DistortionManipulator.cpp
r356 r357 68 68 if ( activeSetupMode == MANUAL) 69 69 { 70 osg::notify(osg::ALWAYS)<<std::endl<<"Drag:"<<std::endl<<"ea.getGraphicsContext()="<<ea.getGraphicsContext()<<std::endl; 71 osg::notify(osg::ALWAYS)<<"ea.getXnormalized()="<<ea.getXnormalized()<<std::endl; 72 osg::notify(osg::ALWAYS)<<"ea.getYnormalized()="<<ea.getYnormalized()<<std::endl; 73 osg::notify(osg::ALWAYS)<<"ea.getX()="<<ea.getX()<<std::endl; 74 osg::notify(osg::ALWAYS)<<"ea.getXin()="<<ea.getXmin()<<std::endl; 75 osg::notify(osg::ALWAYS)<<"ea.getXmax()="<<ea.getXmax()<<std::endl; 76 osg::notify(osg::ALWAYS)<<"ea.getY()="<<ea.getY()<<std::endl; 77 osg::notify(osg::ALWAYS)<<"ea.getYin()="<<ea.getYmin()<<std::endl; 78 osg::notify(osg::ALWAYS)<<"ea.getYmax()="<<ea.getYmax()<<std::endl; 70 OSG_ALWAYS<<std::endl<<"Drag:"<<std::endl<<"ea.getGraphicsContext()="<<ea.getGraphicsContext()<<std::endl; 71 OSG_ALWAYS<<"ea.getXnormalized()="<<ea.getXnormalized()<<std::endl; 72 OSG_ALWAYS<<"ea.getYnormalized()="<<ea.getYnormalized()<<std::endl; 73 OSG_ALWAYS<<"ea.getX()="<<ea.getX()<<std::endl; 74 OSG_ALWAYS<<"ea.getXin()="<<ea.getXmin()<<std::endl; 75 OSG_ALWAYS<<"ea.getXmax()="<<ea.getXmax()<<std::endl; 76 OSG_ALWAYS<<"ea.getY()="<<ea.getY()<<std::endl; 77 OSG_ALWAYS<<"ea.getYin()="<<ea.getYmin()<<std::endl; 78 OSG_ALWAYS<<"ea.getYmax()="<<ea.getYmax()<<std::endl; 79 80 if(activeDistortionMode == MESH) 81 { 82 OSG_ALWAYS<<"MESH!"<<std::endl; 83 } 84 else if (activeDistortionMode == TEXCOORDINATES) 85 { 86 OSG_ALWAYS<<"TEXCOORDINATES!"<<std::endl; 87 } 79 88 80 89 return true; // true means event handled: not forwarded to the camera manipulator; … … 109 118 case(osgGA::GUIEventAdapter::KEYDOWN): 110 119 { 111 if (ea.getKey()==osgGA::GUIEventAdapter::KEY_KP_Insert) // KP 0: Show/Hide HUD // definition: child #0 = mesh, #1 = highlighter, #2 HUD112 { 113 bool oldValue = _distortionSet->getDistortionInternals()->getValue( 2);114 _distortionSet->getDistortionInternals()->setValue( 2, !oldValue);120 if (ea.getKey()==osgGA::GUIEventAdapter::KEY_KP_Insert) // KP 0: Show/Hide HUD 121 { 122 bool oldValue = _distortionSet->getDistortionInternals()->getValue(DistortionSet::HUD); 123 _distortionSet->getDistortionInternals()->setValue(DistortionSet::HUD, !oldValue); 115 124 return(true); 116 125 } … … 133 142 activeSetupMode = MANUAL; 134 143 OSG_NOTICE<<"SetupMode MANUAL activated"<<std::endl; 135 _distortionSet->getDistortionInternals()->setValue( 1, true); // definition: child #0 = mesh, #1 = highlighter, #2 HUD144 _distortionSet->getDistortionInternals()->setValue(DistortionSet::HIGHLIGHTER, true); 136 145 break; 137 146 } … … 139 148 { 140 149 activeSetupMode = DELEGATED; 141 _distortionSet->getDistortionInternals()->setValue( 1, false); // definition: child #0 = mesh, #1 = highlighter, #2 HUD150 _distortionSet->getDistortionInternals()->setValue(DistortionSet::HIGHLIGHTER, false); 142 151 OSG_NOTICE<<"SetupMode DELEGATED activated"<<std::endl; 143 152 break; … … 146 155 { 147 156 activeSetupMode = DISABLED; 148 _distortionSet->getDistortionInternals()->setValue( 1, false); // definition: child #0 = mesh, #1 = highlighter, #2 HUD157 _distortionSet->getDistortionInternals()->setValue(DistortionSet::HIGHLIGHTER, false); 149 158 OSG_NOTICE<<"SetupMode DISABLED activated"<<std::endl; 150 159 break; -
experimental/distortionNG/DistortionSet.h
r353 r357 29 29 { 30 30 public: 31 enum DistortionInternals { 32 MESH = 0, 33 HIGHLIGHTER = 1, 34 HUD = 2 35 }; 36 31 37 META_Object(osgViewer,DistortionSet); // Required for serializer 32 38 … … 103 109 // These variable are therefor not saved/restored by the serializer but populated on runtime. 104 110 osg::observer_ptr<osg::Camera> _camera; // is used to pass the distortion cam from osgViewers setupDistortion() method to the manipulator. 105 osg::ref_ptr<osg::Switch> _distortionInternals; 111 osg::ref_ptr<osg::Switch> _distortionInternals; // definition: child #0 = mesh, #1 = highlighter, #2 HUD 106 112 }; 107 113 -
experimental/distortionNG/extViewer.cpp
r353 r357 18 18 19 19 #include "extViewer.h" 20 #include "distortionNG.h"21 20 22 21 #include <osg/Switch> … … 275 274 276 275 osg::ref_ptr<osg::Switch> root = _distortionSet->getDistortionInternals(); 277 root->addChild(geode, true); // adds mesh,shader,.. so camera renders mesh (and thus render the scene)276 root->addChild(geode, true); // Child #0 (adds mesh,shader,.. so camera renders mesh (and thus render the scene)) 278 277 camera->addChild(root); 279 278 -
experimental/distortionNG/main.cpp
r356 r357 192 192 * subsclassed function aufrufen bzw foreignClass->delegateDistortionSetup(distContainer& container) 193 193 * 194 * Vertex Highlighter für die manuelle Verzerrung soll nur eingeblendet werden wenn der Betriebsmodus MANUAL ist.194 * [done] Vertex Highlighter für die manuelle Verzerrung soll nur eingeblendet werden wenn der Betriebsmodus MANUAL ist. 195 195 * 196 196 *
Note: See TracChangeset
for help on using the changeset viewer.