Changeset 874
- Timestamp:
- 01/29/08 21:31:19
- Files:
-
- trunk/src/vpb/BuildOptions.cpp (modified) (1 diff)
- trunk/src/vpb/DataSet.cpp (modified) (13 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/vpb/BuildOptions.cpp
r859 r874 31 31 _decorateWithMultiTextureControl = true; 32 32 _defaultColor.set(0.5f,0.5f,1.0f,1.0f); 33 _useInterpolatedImagerySampling = false;34 _useInterpolatedTerrainSampling = false;33 _useInterpolatedImagerySampling = true; 34 _useInterpolatedTerrainSampling = true; 35 35 _destinationCoordinateSystemString = ""; 36 36 _destinationCoordinateSystem = new osg::CoordinateSystemNode; 37 37 _destinationCoordinateSystem->setEllipsoidModel(new osg::EllipsoidModel); 38 38 _directory = ""; 39 _outputTaskDirectories = false;39 _outputTaskDirectories = true; 40 40 _geometryType = POLYGONAL; 41 41 _imageExtension = ".dds"; trunk/src/vpb/DataSet.cpp
r869 r874 422 422 423 423 _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 429 428 for(CompositeSource::source_iterator itr(_sourceGraph.get());itr.valid();++itr) 430 429 { … … 462 461 if (source->getType()!=Source::IMAGE && source->getType()!=Source::HEIGHT_FIELD) 463 462 { 464 // place models and shapefiles into a separate temporary source list and then process these after465 // the main handling of terrain/imagery sources.466 modelSources.push_back(source);467 468 463 continue; 469 470 464 } 471 465 … … 473 467 if (!computeOptimumLevel(source, maxNumLevels-1, k)) continue; 474 468 469 470 if (k>highestLevelFound) highestLevelFound = k; 471 475 472 // log(osg::NOTICE," opt level = %i",k); 476 473 … … 522 519 cd = createDestinationTile(l,i,j); 523 520 } 524 #if 0525 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 #endif535 521 } 536 522 } … … 539 525 } 540 526 541 527 // now extend the sources upwards where required. 542 528 for(QuadMap::iterator qitr = _quadMap.begin(); 543 529 qitr != _quadMap.end(); … … 623 609 } 624 610 611 // now insert the sources into the destination graph 625 612 for(CompositeSource::source_iterator itr(_sourceGraph.get());itr.valid();++itr) 626 613 { … … 659 646 660 647 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 after665 // the main handling of terrain/imagery sources.666 modelSources.push_back(source);667 668 continue;669 670 }671 672 648 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 674 659 675 660 // log(osg::NOTICE," opt level = %i",k); … … 741 726 } 742 727 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 759 728 osg::Timer_t before_computeMax = osg::Timer::instance()->tick(); 760 729 … … 1167 1136 1168 1137 // 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) 1178 1139 { 1179 1140 _destinationGraph = createDestinationGraph(0, … … 1186 1147 0, 1187 1148 numLevels); 1149 } 1150 else 1151 { 1152 // new default scheme. 1153 createNewDestinationGraph(_intermediateCoordinateSystem.get(), 1154 _destinationExtents, 1155 _maximumTileImageSize, 1156 _maximumTileTerrainSize, 1157 numLevels); 1188 1158 } 1189 1159 … … 1700 1670 filename = getDirectory() + _tileBasename + _tileExtension; 1701 1671 1672 if (_decorateWithMultiTextureControl) 1673 { 1674 node = decorateWithMultiTextureControl(node.get()); 1675 } 1676 1702 1677 if (_decorateWithCoordinateSystemNode) 1703 1678 { 1704 1679 node = decorateWithCoordinateSystemNode(node.get()); 1705 }1706 1707 if (_decorateWithMultiTextureControl)1708 {1709 node = decorateWithMultiTextureControl(node.get());1710 1680 } 1711 1681 … … 1841 1811 _rootNode = _destinationGraph->createScene(); 1842 1812 1813 if (_decorateWithMultiTextureControl) 1814 { 1815 _rootNode = decorateWithMultiTextureControl(_rootNode.get()); 1816 } 1817 1843 1818 if (_decorateWithCoordinateSystemNode) 1844 1819 { 1845 1820 _rootNode = decorateWithCoordinateSystemNode(_rootNode.get()); 1846 }1847 1848 if (_decorateWithMultiTextureControl)1849 {1850 _rootNode = decorateWithMultiTextureControl(_rootNode.get());1851 1821 } 1852 1822 … … 2333 2303 2334 2304 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 2336 2310 { 2337 2311 result = generateTasks_new(taskManager); 2338 }2339 else2340 {2341 result = generateTasks_old(taskManager);2342 2312 } 2343 2313
