Changeset 621

Show
Ignore:
Timestamp:
04/05/07 16:10:41
Author:
robert
Message:

Various updates to build properly.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/Make/help.sh

    r220 r621  
    125125above 'make' usage.  For example, 
    126126 
    127   make INST_LOCATION=/usr/local/OpenSceneGraph \\ 
    128        INST_SHARE=/usr/share/OpenSceneGraph \\ 
     127  make INST_LOCATION=/usr/local/bin \\ 
    129128       install 
    130129 
  • trunk/Make/makedefs

    r617 r621  
    9595INST_INCLUDE   = $(INST_LOCATION)/include 
    9696INST_SHARE     = $(INST_LOCATION)/share 
    97 INST_EXAMPLES  = $(INST_SHARE)/OpenSceneGraph/bin 
    98 INST_SRC       = $(INST_SHARE)/OpenSceneGraph/src 
    99 INST_DOC       = $(INST_SHARE)/OpenSceneGraph/doc 
    100 INST_DATA      = $(INST_SHARE)/OpenSceneGraph/data 
    101 INST_EXAMPLE_SRC  = $(INST_SRC)/examples 
     97INST_EXAMPLES  = $(INST_LOCATION)/bin 
    10298LINK           = ln -sf 
    10399INSTBINCMD     = install -m 755 
  • trunk/Make/makedirdefs

    r617 r621  
    1010# Directories traversed in the TOPDIR/src directory 
    1111SRC_DIRS = \ 
    12         vpb 
     12        vpb \ 
     13        osgPlugins 
    1314         
    1415################################################################ 
  • trunk/applications/osgdem/GNUmakefile

    r600 r621  
    55        osgdem.cpp\ 
    66 
    7 LIBS     += -losgViewer -losgTerrain -losgFX -losgText -losgGA -losgDB -losgUtil -losg $(GDAL_LIBS) $(GL_LIBS) $(X_LIBS) $(OTHER_LIBS)  
     7LIBS     += -losgViewer -lvpb -losgFX -losgText -losgGA -losgDB -losgUtil -losg $(GDAL_LIBS) $(GL_LIBS) $(X_LIBS) $(OTHER_LIBS)  
    88 
    99INSTFILES = \ 
  • trunk/applications/osgdem/GNUmakefile.inst

    r600 r621  
    66 
    77 
    8 LIBS     += -losgViewer -losgTerrain -losgFX -losgDB -losgText -losgUtil -losg $(GDAL_LIBS) $(GL_LIBS) $(X_LIBS) $(OTHER_LIBS)  
     8LIBS     += -losgViewer -lvpb -losgFX -losgDB -losgText -losgUtil -losg $(GDAL_LIBS) $(GL_LIBS) $(X_LIBS) $(OTHER_LIBS)  
    99 
    1010EXEC = osgdem 
  • trunk/applications/osgdem/osgdem.cpp

    r600 r621  
    3636#include <osg/Switch> 
    3737 
    38 #include <osgTerrain/DataSet> 
     38#include <vpb/DataSet> 
    3939 
    4040#include <iostream> 
     
    112112 
    113113void processFile(std::string filename, 
    114                    osgTerrain::DataSet::Source::Type type, 
     114                   vpb::DataSet::Source::Type type, 
     115                   vpb::DataSet::SpatialProperties::DataType dataType, 
    115116                   std::string currentCS,  
    116117                   osg::Matrixd &geoTransform, 
     
    119120                   bool minmaxLevelSet, unsigned int min_level, unsigned int max_level, 
    120121                   unsigned int layerNum, 
    121                    osg::ref_ptr<osgTerrain::DataSet> dataset) { 
     122                   osg::ref_ptr<vpb::DataSet> dataset) { 
    122123 
    123124    if(filename.empty()) return; 
     
    125126    if(osgDB::fileType(filename) == osgDB::REGULAR_FILE) { 
    126127         
    127         osgTerrain::DataSet::Source* source = new osgTerrain::DataSet::Source(type, filename);                 
     128        vpb::DataSet::Source* source = new vpb::DataSet::Source(type, filename);                 
    128129        if (source) 
    129130        { 
     131            // set type of data 
     132            source->_dataType = dataType; 
     133 
    130134            if (!currentCS.empty()) 
    131135            { 
    132136                std::cout<<"source->setCoordySystem "<<currentCS<<std::endl; 
    133                 source->setCoordinateSystemPolicy(osgTerrain::DataSet::Source::PREFER_CONFIG_SETTINGS); 
     137                source->setCoordinateSystemPolicy(vpb::DataSet::Source::PREFER_CONFIG_SETTINGS); 
    134138                source->setCoordinateSystem(currentCS); 
    135139            }  
     
    139143                std::cout<<"source->setGeoTransform "<<geoTransform<<std::endl; 
    140144                source->setGeoTransformPolicy(geoTransformScale ?  
    141                                               osgTerrain::DataSet::Source::PREFER_CONFIG_SETTINGS_BUT_SCALE_BY_FILE_RESOLUTION :  
    142                                               osgTerrain::DataSet::Source::PREFER_CONFIG_SETTINGS); 
     145                                              vpb::DataSet::Source::PREFER_CONFIG_SETTINGS_BUT_SCALE_BY_FILE_RESOLUTION :  
     146                                              vpb::DataSet::Source::PREFER_CONFIG_SETTINGS); 
    143147                source->setGeoTransform(geoTransform); 
    144148            } 
     
    164168            if((*i != ".") && (*i != "..")) { 
    165169                fullfilename = filename + '/' + *i; 
    166                 processFile(fullfilename, type, currentCS,  
     170                processFile(fullfilename, type, dataType, currentCS,  
    167171                            geoTransform, geoTransformSet, geoTransformScale,  
    168172                            minmaxLevelSet, min_level, max_level, 
     
    211215    arguments.getApplicationUsage()->addCommandLineOption("--RGB-16","Use 16bit RGBA destination imagery");      
    212216    arguments.getApplicationUsage()->addCommandLineOption("--RGBA","Use 32bit RGBA destination imagery");      
     217    arguments.getApplicationUsage()->addCommandLineOption("--vector","Interpret input as a vector data set"); 
     218    arguments.getApplicationUsage()->addCommandLineOption("--raster","Interpret input as a raster data set (default)"); 
    213219    arguments.getApplicationUsage()->addCommandLineOption("--max-visible-distance-of-top-level","Set the maximum visible distance that the top most tile can be viewed at");      
    214220    arguments.getApplicationUsage()->addCommandLineOption("--no-terrain-simplification","Switch off terrain simplification."); 
     
    235241    arguments.getApplicationUsage()->addCommandLineOption("-O","string option to pass to write plugins, use \" \" for multiple options");     
    236242    // create DataSet. 
    237     osg::ref_ptr<osgTerrain::DataSet> dataset = new osgTerrain::DataSet; 
     243    osg::ref_ptr<vpb::DataSet> dataset = new vpb::DataSet; 
    238244 
    239245 
     
    241247    while (arguments.read("-e",x,y,w,h)) 
    242248    { 
    243         dataset->setDestinationExtents(osgTerrain::GeospatialExtents(x,y,x+w,y+h,false)); // FIXME - need to check whether we a geographic extents of not 
     249        dataset->setDestinationExtents(vpb::GeospatialExtents(x,y,x+w,y+h,false)); // FIXME - need to check whether we a geographic extents of not 
    244250    } 
    245251     
    246252    while (arguments.read("--HEIGHT_FIELD")) 
    247253    { 
    248         dataset->setGeometryType(osgTerrain::DataSet::HEIGHT_FIELD); 
     254        dataset->setGeometryType(vpb::DataSet::HEIGHT_FIELD); 
    249255    } 
    250256 
    251257    while (arguments.read("--POLYGONAL")) 
    252258    { 
    253         dataset->setGeometryType(osgTerrain::DataSet::POLYGONAL); 
     259        dataset->setGeometryType(vpb::DataSet::POLYGONAL); 
    254260    } 
    255261 
    256262    while (arguments.read("--LOD")) 
    257263    { 
    258         dataset->setDatabaseType(osgTerrain::DataSet::LOD_DATABASE); 
     264        dataset->setDatabaseType(vpb::DataSet::LOD_DATABASE); 
    259265    } 
    260266     
    261267    while (arguments.read("--PagedLOD")) 
    262268    { 
    263         dataset->setDatabaseType(osgTerrain::DataSet::PagedLOD_DATABASE); 
    264     } 
    265  
    266     while (arguments.read("--compressed")) { dataset->setTextureType(osgTerrain::DataSet::COMPRESSED_TEXTURE); } 
    267     while (arguments.read("--RGBA-compressed")) { dataset->setTextureType(osgTerrain::DataSet::COMPRESSED_RGBA_TEXTURE); } 
    268     while (arguments.read("--RGB_16") || arguments.read("--RGB-16") ) { dataset->setTextureType(osgTerrain::DataSet::RGB_16); } 
    269     while (arguments.read("--RGBA_16") || arguments.read("--RGBA-16") ) { dataset->setTextureType(osgTerrain::DataSet::RGBA_16); } 
    270     while (arguments.read("--RGB_24") || arguments.read("--RGB-24") ) { dataset->setTextureType(osgTerrain::DataSet::RGB_24); } 
    271     while (arguments.read("--RGBA") || arguments.read("--RGBA") ) { dataset->setTextureType(osgTerrain::DataSet::RGBA); } 
    272  
    273     while (arguments.read("--no_mip_mapping") || arguments.read("--no-mip-mapping")) { dataset->setMipMappingMode(osgTerrain::DataSet::NO_MIP_MAPPING); } 
    274     while (arguments.read("--mip_mapping_hardware") || arguments.read("--mip-mapping-hardware")) { dataset->setMipMappingMode(osgTerrain::DataSet::MIP_MAPPING_HARDWARE); } 
    275     while (arguments.read("--mip_mapping_imagery") || arguments.read("--mip-mapping-imagery")) { dataset->setMipMappingMode(osgTerrain::DataSet::MIP_MAPPING_IMAGERY); } 
     269        dataset->setDatabaseType(vpb::DataSet::PagedLOD_DATABASE); 
     270    } 
     271 
     272    while (arguments.read("--compressed")) { dataset->setTextureType(vpb::DataSet::COMPRESSED_TEXTURE); } 
     273    while (arguments.read("--RGBA-compressed")) { dataset->setTextureType(vpb::DataSet::COMPRESSED_RGBA_TEXTURE); } 
     274    while (arguments.read("--RGB_16") || arguments.read("--RGB-16") ) { dataset->setTextureType(vpb::DataSet::RGB_16); } 
     275    while (arguments.read("--RGBA_16") || arguments.read("--RGBA-16") ) { dataset->setTextureType(vpb::DataSet::RGBA_16); } 
     276    while (arguments.read("--RGB_24") || arguments.read("--RGB-24") ) { dataset->setTextureType(vpb::DataSet::RGB_24); } 
     277    while (arguments.read("--RGBA") || arguments.read("--RGBA") ) { dataset->setTextureType(vpb::DataSet::RGBA); } 
     278 
     279    while (arguments.read("--no_mip_mapping") || arguments.read("--no-mip-mapping")) { dataset->setMipMappingMode(vpb::DataSet::NO_MIP_MAPPING); } 
     280    while (arguments.read("--mip_mapping_hardware") || arguments.read("--mip-mapping-hardware")) { dataset->setMipMappingMode(vpb::DataSet::MIP_MAPPING_HARDWARE); } 
     281    while (arguments.read("--mip_mapping_imagery") || arguments.read("--mip-mapping-imagery")) { dataset->setMipMappingMode(vpb::DataSet::MIP_MAPPING_IMAGERY); } 
    276282 
    277283    float maxAnisotropy; 
     
    392398    unsigned int min_level=0, max_level=maximumPossibleLevel; 
    393399    unsigned int currentLayerNum = 0; 
     400    vpb::DataSet::SpatialProperties::DataType dataType = vpb::DataSet::SpatialProperties::RASTER; 
    394401          
    395402    int pos = 1; 
     
    400407        if (arguments.read(pos, "--cs",def)) 
    401408        { 
    402             currentCS = !def.empty() ? osgTerrain::DataSet::coordinateSystemStringToWTK(def) : ""; 
     409            currentCS = !def.empty() ? vpb::DataSet::coordinateSystemStringToWTK(def) : ""; 
    403410            std::cout<<"--cs \""<<def<<"\" converted to "<<currentCS<<std::endl; 
    404411        } 
     
    431438        else if (arguments.read(pos, "--bluemarble-east")) 
    432439        { 
    433             currentCS = osgTerrain::DataSet::coordinateSystemStringToWTK("WGS84"); 
     440            currentCS = vpb::DataSet::coordinateSystemStringToWTK("WGS84"); 
    434441            geoTransformSet = true; 
    435442            geoTransformScale = true; 
     
    442449        else if (arguments.read(pos, "--bluemarble-west")) 
    443450        { 
    444             currentCS = osgTerrain::DataSet::coordinateSystemStringToWTK("WGS84"); 
     451            currentCS = vpb::DataSet::coordinateSystemStringToWTK("WGS84"); 
    445452            geoTransformSet = true; 
    446453            geoTransformScale = true; 
     
    453460        else if (arguments.read(pos, "--whole-globe")) 
    454461        { 
    455             currentCS = osgTerrain::DataSet::coordinateSystemStringToWTK("WGS84"); 
     462            currentCS = vpb::DataSet::coordinateSystemStringToWTK("WGS84"); 
    456463            geoTransformSet = true; 
    457464            geoTransformScale = true; 
     
    566573        } 
    567574 
     575        else if (arguments.read(pos, "--vector")) 
     576        { 
     577            dataType = vpb::DataSet::SpatialProperties::VECTOR; 
     578            std::cout<<"--vector input data"<<std::endl; 
     579        } 
     580 
     581        else if (arguments.read(pos, "--raster")) 
     582        { 
     583            dataType = vpb::DataSet::SpatialProperties::RASTER; 
     584            std::cout<<"--raster input data"<<std::endl; 
     585        } 
     586 
    568587        else if (arguments.read(pos, "-d",filename)) 
    569588        { 
    570589            std::cout<<"-d "<<filename<<std::endl; 
    571             processFile(filename, osgTerrain::DataSet::Source::HEIGHT_FIELD, currentCS,  
     590            processFile(filename, vpb::DataSet::Source::HEIGHT_FIELD, dataType, currentCS,  
    572591                        geoTransform, geoTransformSet, geoTransformScale, 
    573592                        minmaxLevelSet, min_level, max_level, 
     
    583602            geoTransformScale = false; 
    584603            geoTransform.makeIdentity(); 
    585  
     604            dataType = vpb::DataSet::SpatialProperties::RASTER; 
    586605        } 
    587606        else if (arguments.read(pos, "-t",filename)) 
    588607        { 
    589608            std::cout<<"-t "<<filename<<std::endl; 
    590             processFile(filename, osgTerrain::DataSet::Source::IMAGE, currentCS,  
     609            processFile(filename, vpb::DataSet::Source::IMAGE, dataType, currentCS,  
    591610                        geoTransform, geoTransformSet, geoTransformScale,  
    592611                        minmaxLevelSet, min_level, max_level,  
     
    602621            geoTransformScale = false; 
    603622            geoTransform.makeIdentity();             
     623            dataType = vpb::DataSet::SpatialProperties::RASTER; 
    604624        } 
    605625/*         
     
    607627        { 
    608628            std::cout<<"-m "<<filename<<std::endl; 
    609             processFile(filename, osgTerrain::DataSet::Source::MODEL, currentCS,  
     629            processFile(filename, vpb::DataSet::Source::MODEL, currentCS,  
    610630                        geoTransform, geoTransformSet, geoTransformScale,  
    611631                        minmaxLevelSet, min_level, max_level,