Changeset 798

Show
Ignore:
Timestamp:
12/18/07 17:08:43
Author:
robert
Message:

Added command line support for setting polar and equator radii via --radius-polar <radius>, --radius-equator <radius> respectively.

Added command line support for --spherical option that sets the polar and equator radii to the same value, its value is computed by
averaging the original polar and equator radius.

Files:

Legend:

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

    r785 r798  
    3232    _defaultColor.set(0.5f,0.5f,1.0f,1.0f); 
    3333    _destinationCoordinateSystemString = ""; 
    34     _destinationCoordinateSystem = new osg::CoordinateSystemNode; _destinationCoordinateSystem->setEllipsoidModel(new osg::EllipsoidModel); 
     34    _destinationCoordinateSystem = new osg::CoordinateSystemNode;  
     35    _destinationCoordinateSystem->setEllipsoidModel(new osg::EllipsoidModel); 
    3536    _directory = ""; 
    3637    _geometryType = POLYGONAL; 
  • trunk/src/vpb/Commandline.cpp

    r794 r798  
    422422    usage.addCommandLineOption("--bluemarble-west","Set the coordinates system for next texture or dem to represent the western hemisphere of the earth.");      
    423423    usage.addCommandLineOption("--whole-globe","Set the coordinates system for next texture or dem to represent the whole hemisphere of the earth."); 
    424     usage.addCommandLineOption("--geocentric",""); 
     424    usage.addCommandLineOption("--geocentric","Build a database in geocentric (i.e. whole earth) database."); 
     425    usage.addCommandLineOption("--radius-polar","Set the polar radius of the ellipsoid model when building a geocentric database."); 
     426    usage.addCommandLineOption("--radius-equator","Set the polar radius of the ellipsoid model when building a geocentric database."); 
     427    usage.addCommandLineOption("--spherical","Set the polar and equator radius both to the average of the two."); 
    425428    usage.addCommandLineOption("--range","");      
    426429    usage.addCommandLineOption("--xx","");      
     
    617620    } 
    618621 
     622    while (arguments.read("--geocentric")) 
     623    { 
     624        buildOptions->setConvertFromGeographicToGeocentric(true); 
     625        fout<<"--geocentric "<<currentCS<<std::endl; 
     626    } 
     627 
     628    double radius; 
     629    while (arguments.read("--radius-polar", radius)) 
     630    { 
     631        osg::EllipsoidModel* ellipsoid = buildOptions->getEllipsoidModel(); 
     632        ellipsoid->setRadiusPolar(radius); 
     633    } 
     634     
     635    while (arguments.read("--radius-equator", radius)) 
     636    { 
     637        osg::EllipsoidModel* ellipsoid = buildOptions->getEllipsoidModel(); 
     638        ellipsoid->setRadiusEquator(radius); 
     639    } 
     640     
     641    while (arguments.read("--spherical")) 
     642    { 
     643        osg::EllipsoidModel* ellipsoid = buildOptions->getEllipsoidModel(); 
     644        double radius = (ellipsoid->getRadiusPolar() + ellipsoid->getRadiusEquator())*0.5; 
     645        ellipsoid->setRadiusPolar(radius); 
     646        ellipsoid->setRadiusEquator(radius); 
     647        fout<<"--spherical, new radius set to "<<radius<<std::endl; 
     648    } 
     649 
     650 
    619651    std::string str; 
    620652    while (arguments.read("--default-color",str) || 
     
    705737            } 
    706738        } 
    707         else if (arguments.read(pos, "--geocentric")) 
    708         { 
    709             buildOptions->setConvertFromGeographicToGeocentric(true); 
    710             fout<<"--geocentric "<<currentCS<<std::endl; 
    711         } 
    712  
    713739        else if (arguments.read(pos, "--bluemarble-east")) 
    714740        {