Changeset 285


Ignore:
Timestamp:
May 26, 2011, 8:51:45 AM (13 years ago)
Author:
Torben Dannhauer
Message:

KdTree? Issue fixed

Location:
experimental/TerrainTest
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • experimental/TerrainTest/ModificationManager/ModificationManager.vcproj

    r284 r285  
    5959                        <Tool
    6060                                Name="VCPreLinkEventTool"
     61                                Description=""
     62                                CommandLine=""
    6163                        />
    6264                        <Tool
     
    9294                        <Tool
    9395                                Name="VCPostBuildEventTool"
     96                                Description="Move Library to OSG_ROOT\lib"
     97                                CommandLine="move $(OSG_ROOT)\bin\$(ProjectName)d.lib $(OSG_ROOT)\lib"
    9498                        />
    9599                </Configuration>
     
    137141                        <Tool
    138142                                Name="VCPreLinkEventTool"
     143                                Description="Move Library to OSG_ROOT\lib"
     144                                CommandLine="move $(OSG_ROOT)\bin\$(ProjectName).lib $(OSG_ROOT)\lib"
    139145                        />
    140146                        <Tool
  • experimental/TerrainTest/ReaderWriterTerrainMod.cpp

    r284 r285  
    2828                options->getBuildKdTreesHint() == Options::BUILD_KDTREES :
    2929                                osgDB::Registry::instance()->getBuildKdTreesHint() == Options::BUILD_KDTREES;
    30         // TODO: Modify passed option or create option with Options::DO_NOT_BUILD_KDTREES
    31         if(!options)
    32                 options = new osgDB::ReaderWriter::Options();
    33         options->setBuildKdTreesHint(Options::DO_NOT_BUILD_KDTREES);
    34          
    35 
     30        // Save original KdTree Hint
     31        Options::BuildKdTreesHint originalHint = Options::NO_PREFERENCE;
     32        if(options)
     33        {
     34                originalHint = options->getBuildKdTreesHint();
     35                const_cast<osgDB::ReaderWriter::Options*>(options)->setBuildKdTreesHint(Options::DO_NOT_BUILD_KDTREES);
     36        }
    3637
    3738        // Load real file
     
    5152        node->accept( modVisitor );
    5253
    53         // Finally create KdTree
     54        // Finally create KdTree and restore options
    5455        if(doKdTreeBuilder)
    5556        {
    56                 OSG_WARN << "Building KdTree" << std::endl;
    5757                osg::ref_ptr<osg::KdTreeBuilder> builder = osgDB::Registry::instance()->getKdTreeBuilder();
    5858                node->accept(*builder);
    5959        }
    60         else OSG_WARN << "No KdTree" << std::endl;
    61 
     60        // Restore original KdTree Hint
     61        if(options) const_cast<osgDB::ReaderWriter::Options*>(options)->setBuildKdTreesHint(originalHint);
    6262
    6363        return node;
Note: See TracChangeset for help on using the changeset viewer.