Ignore:
Timestamp:
06/20/11 13:06:09 (13 years ago)
Author:
hozdoba
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • XMLIO_V2/dev/dev_rv/src4/xmlio/main_server.cpp

    r215 r229  
    1616#include "xmlioserver_spl.hpp" 
    1717 
     18#include "inetcdf4.hpp" 
     19#include "inetcdf4_impl.hpp" 
     20#include "inetcdf4_adv.hpp" 
     21#include "inetcdf4_adv_impl.hpp" 
     22#include "lscereader.hpp" 
     23 
    1824namespace xios = xmlioserver; 
    1925//~ using namespace xios::data; 
    20 //~ using namespace xios::io; 
     26using namespace xios::io; 
    2127//~ using namespace xios::tree; 
    2228//~ using namespace xios::xml; 
    2329//~ using namespace xios::comm; 
    2430//~ using namespace xios::func; 
     31using namespace xios::vtk; 
    2532 
    2633// Point d'entrée du programme serveur principal. 
     
    2936   try 
    3037   { 
     38       std::cout << "Test input"  << std::endl; 
     39       CINetCDF4Adv file_coslatgrid("test/vtk/file_coslatgrid.nc4"); 
     40       CINetCDF4Adv file_xboundsybounds("test/vtk/file_xboundsybounds.nc4"); 
     41       CINetCDF4Adv sampleCurveGrid4("test/vtk/sampleCurveGrid4.nc4"); 
     42       CINetCDF4Adv sampleGenGrid3("test/vtk/sampleGenGrid3.nc4"); 
     43       CINetCDF4Adv ucov("test/vtk/ucov.nc4"); 
     44        
     45       std::vector<CINetCDF4Adv*> listinput; 
     46       listinput.push_back(&file_coslatgrid); 
     47       listinput.push_back(&file_xboundsybounds); 
     48       listinput.push_back(&sampleCurveGrid4); 
     49       listinput.push_back(&sampleGenGrid3); 
     50       listinput.push_back(&ucov); 
     51       std::vector<CINetCDF4Adv*>::iterator it = listinput.begin(), end = listinput.end(); 
     52        
     53       for (; it != end; it++) 
     54       { 
     55           std::cout << "-------------" << std::endl; 
     56           std::map<std::string, std::size_t> dims = (*it)->getDimensions(); 
     57           std::map<std::string, std::size_t>::iterator it0 = dims.begin(), end0 = dims.end(); 
     58            
     59           for (; it0 != end0; it0++) 
     60           { 
     61               std::cout << "dimensions " << it0->first << " : " << it0->second << std::endl; 
     62           } 
     63            
     64           std::vector<std::string> vars = (*it)->getVariables(); 
     65           std::vector<std::string>::iterator it1 = vars.begin(), end1 = vars.end(); 
     66           for (; it1 != end1; it1++) 
     67           { 
     68               std::map<std::string, std::size_t> dims = (*it)->getDimensions(&(*it1)); 
     69               std::map<std::string, std::size_t>::iterator it3 = dims.begin(), end3 = dims.end(); 
     70 
     71               std::cout << "Variable " << *it1 << " ["; 
     72               for (; it3 != end3; it3++) 
     73               { 
     74                   std::cout << it3->first << ":" << it3->second << " "; 
     75               } 
     76               std::cout << "] :" << std::endl; 
     77           } 
     78       } 
     79        
     80       boost::multi_array<float, 1> data; 
     81       file_coslatgrid.readData(data, "NTEMP", 1); 
     82       std::cout << data.size() << std::endl; 
     83 
     84        
     85       //vtkLSCEReader::ShowVariable("test/vtk/file_coslatgrid.nc4", "NTEMP"); 
     86       //vtkLSCEReader::ShowVariable("test/vtk/ucov.nc4", "ucov"); 
     87       vtkLSCEReader::ShowVariable("test/vtk/sampleCurveGrid4.nc4", "sample"); 
     88       //vtkLSCEReader::ShowVariable("test/vtk/sampleGenGrid3.nc4", "sample"); 
     89       //vtkLSCEReader::ShowVariable("test/vtk/file_xboundsybounds.nc4", "A"); 
     90        
    3191 
    3292   } 
Note: See TracChangeset for help on using the changeset viewer.