From c687b5fc6f5dd1ea3e55706255d6392842fdb09f Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Mon, 4 Apr 2005 15:23:18 +0000 Subject: [PATCH] Added layer support --- applications/osgdem/osgdem.cpp | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/applications/osgdem/osgdem.cpp b/applications/osgdem/osgdem.cpp index 3f0978cb4..151b1f109 100644 --- a/applications/osgdem/osgdem.cpp +++ b/applications/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