diff --git a/examples/osgdem/osgdem.cpp b/examples/osgdem/osgdem.cpp index 3f0978cb4..151b1f109 100644 --- a/examples/osgdem/osgdem.cpp +++ b/examples/osgdem/osgdem.cpp @@ -109,6 +109,7 @@ void processFile(std::string filename, bool geoTransformSet, bool geoTransformScale, bool minmaxLevelSet, unsigned int min_level, unsigned int max_level, + unsigned int layerNum, osg::ref_ptr dataset) { if(filename.empty()) return; @@ -137,6 +138,10 @@ void processFile(std::string filename, { source->setMinMaxLevel(min_level, max_level); } + + source->setLayer(layerNum); + + std::cout<<"Reading as layer = "<addSource(source); } @@ -153,6 +158,7 @@ void processFile(std::string filename, processFile(fullfilename, type, currentCS, geoTransform, geoTransformSet, geoTransformScale, minmaxLevelSet, min_level, max_level, + layerNum, dataset); } } @@ -176,6 +182,8 @@ int main( int argc, char **argv ) arguments.getApplicationUsage()->addCommandLineOption("-a ","Specify the archive to place the generated database"); arguments.getApplicationUsage()->addCommandLineOption("-o ","Specify the output master file to generate"); arguments.getApplicationUsage()->addCommandLineOption("-l ","Specify the number of PagedLOD levels to generate"); + arguments.getApplicationUsage()->addCommandLineOption("--levels ","Specify the range of lavels that the next source Texture or DEM will contribute to."); + arguments.getApplicationUsage()->addCommandLineOption("--layer ","Specify the layer that the next source Texture will contribute to.."); arguments.getApplicationUsage()->addCommandLineOption("-e ","Extents of the model to generate"); arguments.getApplicationUsage()->addCommandLineOption("-h or --help","Display this information"); arguments.getApplicationUsage()->addCommandLineOption("--cs ","Set the coordinates system of source imagery, DEM or destination database. The string may be any of the usual GDAL/OGR forms, complete WKT, PROJ.4, EPS"); @@ -321,6 +329,7 @@ int main( int argc, char **argv ) double xMin, xMax, yMin, yMax; bool minmaxLevelSet = false; unsigned int min_level=0, max_level=maximumPossibleLevel; + unsigned int currentLayerNum = 0; int pos = 1; while(pos_source = this; } SourceData* getSourceData() { return _sourceData.get(); } @@ -319,6 +325,7 @@ class OSGTERRAIN_EXPORT DataSet : public osg::Referenced unsigned int _minLevel; unsigned int _maxLevel; + unsigned int _layer; osg::ref_ptr _sourceData;