Changeset 358 for experimental


Ignore:
Timestamp:
Apr 22, 2012, 9:12:22 AM (12 years ago)
Author:
Torben Dannhauer
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • experimental/distortionNG/DistortionManipulator.cpp

    r357 r358  
    1919#include "DistortionManipulator.h"
    2020
    21 #include<osgViewer/Viewer>
    22 #include<osg/Point>
     21#include <osgViewer/Viewer>
     22#include <osg/Point>
     23#include <osg/PolygonMode>
    2324
    2425using namespace osg;
     
    183184                                        {
    184185                                                activeVisualizationMode = INTENSITY_MAP;
    185                                                 showDistortionMesh(true);
    186                                                 showIntensityMap(false);
     186                                                showDistortionMesh(false);
     187                                                showIntensityMap(true);
    187188                                                break;
    188189                                        }
     
    191192                                                activeVisualizationMode = NONE;
    192193                                                showDistortionMesh(false);
    193                                                 showIntensityMap(true);
     194                                                showIntensityMap(false);
    194195                                                break;
    195196                                        }
     
    197198                                        {
    198199                                                activeVisualizationMode = DISTORTION_MESH;
    199                                                 showDistortionMesh(false);
     200                                                showDistortionMesh(true);
    200201                                                showIntensityMap(false);
    201202                                                break;
     
    269270void DistortionManipulator::showDistortionMesh(bool show)
    270271{
    271         OSG_ALWAYS<<"ToDo: showDistortionMesh(bool) is now "<<show<<std::endl;
    272 
    273         // Todo: Stateset muss das von der MeshGeode sein.
    274 
    275    /* osg::PolygonMode* polyModeObj = dynamic_cast<osg::PolygonMode*>(_stateset->getAttribute(osg::StateAttribute::POLYGONMODE));
     272        osg::StateSet* stateset = _distortionSet->getDistortionInternals()->getChild(DistortionSet::MESH)->getOrCreateStateSet();
     273
     274        // Append a PolygonMode stateset if required
     275    osg::PolygonMode* polyModeObj = dynamic_cast<osg::PolygonMode*>(stateset->getAttribute(osg::StateAttribute::POLYGONMODE));
    276276    if (!polyModeObj)
    277277    {
    278278        polyModeObj = new osg::PolygonMode;
    279         _stateset->setAttribute(polyModeObj);
     279        stateset->setAttribute(polyModeObj);
    280280    }
    281281 
     282        // Set Polygonmode
    282283        if(show)
    283284                polyModeObj->setMode(osg::PolygonMode::FRONT_AND_BACK,osg::PolygonMode::LINE);
    284285        else
    285                 polyModeObj->setMode(osg::PolygonMode::FRONT_AND_BACK,osg::PolygonMode::FILL);*/
     286                polyModeObj->setMode(osg::PolygonMode::FRONT_AND_BACK,osg::PolygonMode::FILL);
    286287}
    287288
Note: See TracChangeset for help on using the changeset viewer.