Salome HOME
correct a small bug appearing when using the gcc 3.2.1.
[modules/med.git] / src / MEDMEM / test_gibi_driver.cxx
1 using namespace std;
2
3 #include "MEDMEM_GibiMeshDriver.hxx"
4 #include "MEDMEM_Mesh.hxx"
5 using namespace MEDMEM;
6 int main (int argc, char ** argv)
7 {
8     /* process the arguments */
9     if (argc != 2) 
10     {
11         cerr << "Usage : " << argv[0] 
12         << "Gibifilename" << endl << endl
13         << "-> lit le fichier gibi filename ,crée un fichier MED" << endl;
14         exit(-1);
15     }
16     string gibifilename  = argv[1];
17
18     // Construction des noms de fichier
19     const string ext=".sauve";
20     string::size_type pos=gibifilename.find(ext,0);
21     string basename (gibifilename, 0, pos);
22     string medfile=basename+".med";
23     string cast2medfile="cast_"+basename+".med";
24
25     // lecture du fichier gibi
26     MESH * myMesh= new MESH() ; 
27     GIBI_MESH_RDONLY_DRIVER myGibiMeshDriver(gibifilename, myMesh) ;
28     myGibiMeshDriver.open() ;
29     myGibiMeshDriver.read() ;
30     myGibiMeshDriver.close() ;
31
32     cout << "Impression de MESH : " << endl;
33     cout << *myMesh;
34
35     // creation d'un fichier med
36     int idMed = myMesh->addDriver(MED_DRIVER, medfile, basename);
37     myMesh->write(idMed) ;
38     delete myMesh;
39
40 }