Changeset 357 for experimental


Ignore:
Timestamp:
Apr 22, 2012, 9:01:45 AM (12 years ago)
Author:
Torben Dannhauer
Message:
 
Location:
experimental/distortionNG
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • experimental/distortionNG/DistortionManipulator.cpp

    r356 r357  
    6868                        if ( activeSetupMode == MANUAL)
    6969                        {
    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                                }
    7988
    8089                                return true;    // true means event handled: not forwarded to the camera manipulator;
     
    109118        case(osgGA::GUIEventAdapter::KEYDOWN):
    110119                {
    111                         if (ea.getKey()==osgGA::GUIEventAdapter::KEY_KP_Insert) // KP 0: Show/Hide HUD   // definition: child #0 = mesh, #1 = highlighter, #2 HUD
    112                         {
    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);
    115124                                return(true);
    116125                        }
     
    133142                                                activeSetupMode = MANUAL;
    134143                                                OSG_NOTICE<<"SetupMode MANUAL activated"<<std::endl;
    135                                                 _distortionSet->getDistortionInternals()->setValue(1, true); // definition: child #0 = mesh, #1 = highlighter, #2 HUD
     144                                                _distortionSet->getDistortionInternals()->setValue(DistortionSet::HIGHLIGHTER, true);
    136145                                                break;
    137146                                        }
     
    139148                                        {
    140149                                                activeSetupMode = DELEGATED;
    141                                                 _distortionSet->getDistortionInternals()->setValue(1, false); // definition: child #0 = mesh, #1 = highlighter, #2 HUD
     150                                                _distortionSet->getDistortionInternals()->setValue(DistortionSet::HIGHLIGHTER, false);
    142151                                                OSG_NOTICE<<"SetupMode DELEGATED activated"<<std::endl;
    143152                                                break;
     
    146155                                        {
    147156                                                activeSetupMode = DISABLED;
    148                                                 _distortionSet->getDistortionInternals()->setValue(1, false); // definition: child #0 = mesh, #1 = highlighter, #2 HUD
     157                                                _distortionSet->getDistortionInternals()->setValue(DistortionSet::HIGHLIGHTER, false);
    149158                                                OSG_NOTICE<<"SetupMode DISABLED activated"<<std::endl;
    150159                                                break;
  • experimental/distortionNG/DistortionSet.h

    r353 r357  
    2929{
    3030public:
     31        enum DistortionInternals {
     32                MESH = 0,
     33                HIGHLIGHTER = 1,
     34                HUD = 2
     35        };
     36
    3137        META_Object(osgViewer,DistortionSet);   // Required for serializer
    3238
     
    103109        // These variable are therefor not saved/restored by the serializer but populated on runtime.
    104110        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
    106112};
    107113
  • experimental/distortionNG/extViewer.cpp

    r353 r357  
    1818
    1919#include "extViewer.h"
    20 #include "distortionNG.h"
    2120
    2221#include <osg/Switch>
     
    275274
    276275                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))
    278277                camera->addChild(root);
    279278
  • experimental/distortionNG/main.cpp

    r356 r357  
    192192 *                                                                                                                              subsclassed function aufrufen bzw foreignClass->delegateDistortionSetup(distContainer& container)
    193193 *                                                                                     
    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.
    195195 *                                                                     
    196196 *
Note: See TracChangeset for help on using the changeset viewer.