Changeset 874

Show
Ignore:
Timestamp:
01/29/08 21:31:19
Author:
robert
Message:

Changed the defaults to use the pathways for creating task sets and destination graph

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/vpb/BuildOptions.cpp

    r859 r874  
    3131    _decorateWithMultiTextureControl = true; 
    3232    _defaultColor.set(0.5f,0.5f,1.0f,1.0f); 
    33     _useInterpolatedImagerySampling = false; 
    34     _useInterpolatedTerrainSampling = false; 
     33    _useInterpolatedImagerySampling = true; 
     34    _useInterpolatedTerrainSampling = true; 
    3535    _destinationCoordinateSystemString = ""; 
    3636    _destinationCoordinateSystem = new osg::CoordinateSystemNode;  
    3737    _destinationCoordinateSystem->setEllipsoidModel(new osg::EllipsoidModel); 
    3838    _directory = ""; 
    39     _outputTaskDirectories = false; 
     39    _outputTaskDirectories = true; 
    4040    _geometryType = POLYGONAL; 
    4141    _imageExtension = ".dds"; 
  • trunk/src/vpb/DataSet.cpp

    r869 r874  
    422422     
    423423    _newDestinationGraph = true; 
    424     
    425     typedef std::list< osg::ref_ptr<Source> > SourceList; 
    426     SourceList modelSources; 
    427      
    428  
     424 
     425    int highestLevelFound = 0; 
     426 
     427    // first populate the destination graph from imagery and DEM sources extents/resolution 
    429428    for(CompositeSource::source_iterator itr(_sourceGraph.get());itr.valid();++itr) 
    430429    { 
     
    462461        if (source->getType()!=Source::IMAGE && source->getType()!=Source::HEIGHT_FIELD) 
    463462        { 
    464             // place models and shapefiles into a separate temporary source list and then process these after 
    465             // the main handling of terrain/imagery sources. 
    466             modelSources.push_back(source); 
    467              
    468463            continue; 
    469              
    470464        } 
    471465         
     
    473467        if (!computeOptimumLevel(source, maxNumLevels-1, k)) continue; 
    474468         
     469 
     470        if (k>highestLevelFound) highestLevelFound = k; 
     471 
    475472        // log(osg::NOTICE,"     opt level = %i",k); 
    476473 
     
    522519                            cd = createDestinationTile(l,i,j); 
    523520                        } 
    524 #if 0                         
    525                         if (!cd) continue; 
    526                          
    527                         for(CompositeDestination::TileList::iterator titr = cd->_tiles.begin(); 
    528                             titr != cd->_tiles.end(); 
    529                             ++titr) 
    530                         { 
    531                             DestinationTile* tile = titr->get(); 
    532                             tile->_sources.push_back(source); 
    533                         } 
    534 #endif 
    535521                    } 
    536522                } 
     
    539525    } 
    540526     
    541  
     527    // now extend the sources upwards where required. 
    542528    for(QuadMap::iterator qitr = _quadMap.begin(); 
    543529        qitr != _quadMap.end(); 
     
    623609    } 
    624610 
     611    // now insert the sources into the destination graph 
    625612    for(CompositeSource::source_iterator itr(_sourceGraph.get());itr.valid();++itr) 
    626613    { 
     
    659646         
    660647        int level = 0; 
    661          
    662         if (source->getType()!=Source::IMAGE && source->getType()!=Source::HEIGHT_FIELD) 
    663         { 
    664             // place models and shapefiles into a separate temporary source list and then process these after 
    665             // the main handling of terrain/imagery sources. 
    666             modelSources.push_back(source); 
    667              
    668             continue; 
    669              
    670         } 
    671          
    672648        int k = 0; 
    673         if (!computeOptimumLevel(source, maxNumLevels-1, k)) continue; 
     649         
     650        if (source->getType()==Source::IMAGE || source->getType()==Source::HEIGHT_FIELD) 
     651        {         
     652            if (!computeOptimumLevel(source, maxNumLevels-1, k)) continue; 
     653        } 
     654        else 
     655        { 
     656            k = highestLevelFound; 
     657        } 
     658         
    674659         
    675660        // log(osg::NOTICE,"     opt level = %i",k); 
     
    741726    } 
    742727 
    743  
    744     for(SourceList::iterator ml_itr = modelSources.begin(); 
    745         ml_itr != modelSources.end(); 
    746         ++ml_itr) 
    747     { 
    748         Source* source = (*ml_itr).get(); 
    749         SourceData* sd = (*ml_itr)->getSourceData(); 
    750  
    751         const SpatialProperties& sp = sd->computeSpatialProperties(cs); 
    752         double source_xRange = sp._extents.xMax()-sp._extents.xMin(); 
    753         double source_yRange = sp._extents.yMax()-sp._extents.yMin(); 
    754  
    755  
    756         log(osg::NOTICE,"Need to handle shapefile/model source %s.",source->getFileName().c_str()); 
    757     } 
    758      
    759728    osg::Timer_t before_computeMax = osg::Timer::instance()->tick(); 
    760729 
     
    11671136 
    11681137    // then create the destination graph accordingly. 
    1169     if (getBuildOptionsString().find("new")!=std::string::npos) 
    1170     { 
    1171         createNewDestinationGraph(_intermediateCoordinateSystem.get(), 
    1172                                   _destinationExtents, 
    1173                                   _maximumTileImageSize, 
    1174                                   _maximumTileTerrainSize, 
    1175                                   numLevels); 
    1176     } 
    1177     else 
     1138    if (getBuildOptionsString().find("old_dg")!=std::string::npos) 
    11781139    { 
    11791140        _destinationGraph = createDestinationGraph(0, 
     
    11861147                                                   0, 
    11871148                                                   numLevels); 
     1149    } 
     1150    else 
     1151    { 
     1152        // new default scheme. 
     1153        createNewDestinationGraph(_intermediateCoordinateSystem.get(), 
     1154                                  _destinationExtents, 
     1155                                  _maximumTileImageSize, 
     1156                                  _maximumTileTerrainSize, 
     1157                                  numLevels); 
    11881158    } 
    11891159                                                                
     
    17001670                filename = getDirectory() + _tileBasename + _tileExtension;     
    17011671 
     1672                if (_decorateWithMultiTextureControl) 
     1673                { 
     1674                    node = decorateWithMultiTextureControl(node.get()); 
     1675                } 
     1676 
    17021677                if (_decorateWithCoordinateSystemNode) 
    17031678                { 
    17041679                    node = decorateWithCoordinateSystemNode(node.get()); 
    1705                 } 
    1706  
    1707                 if (_decorateWithMultiTextureControl) 
    1708                 { 
    1709                     node = decorateWithMultiTextureControl(node.get()); 
    17101680                } 
    17111681 
     
    18411811            _rootNode = _destinationGraph->createScene(); 
    18421812 
     1813            if (_decorateWithMultiTextureControl) 
     1814            { 
     1815                _rootNode = decorateWithMultiTextureControl(_rootNode.get()); 
     1816            } 
     1817 
    18431818            if (_decorateWithCoordinateSystemNode) 
    18441819            { 
    18451820                _rootNode = decorateWithCoordinateSystemNode(_rootNode.get()); 
    1846             } 
    1847  
    1848             if (_decorateWithMultiTextureControl) 
    1849             { 
    1850                 _rootNode = decorateWithMultiTextureControl(_rootNode.get()); 
    18511821            } 
    18521822 
     
    23332303 
    23342304    bool result = false; 
    2335     if (getBuildOptionsString().find("tm")!=std::string::npos) 
     2305    if (getBuildOptionsString().find("old_tm")!=std::string::npos) 
     2306    { 
     2307        result = generateTasks_old(taskManager); 
     2308    } 
     2309    else 
    23362310    { 
    23372311        result = generateTasks_new(taskManager); 
    2338     } 
    2339     else 
    2340     { 
    2341         result = generateTasks_old(taskManager); 
    23422312    } 
    23432313