X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FDriverUNV%2FDriverUNV_W_SMESHDS_Document.cxx;h=97e6d6d21c020f1a2bfd3c8bd91d4e5c67393c6a;hp=7fb740cdded603b3522ce6b68a6429158ac8bf23;hb=8d2ecd75b04ac82778c48882c4f19d4561be0985;hpb=0b959120c59670d73c0a1f6d46bfa72a6ceb49cf diff --git a/src/DriverUNV/DriverUNV_W_SMESHDS_Document.cxx b/src/DriverUNV/DriverUNV_W_SMESHDS_Document.cxx index 7fb740cdd..97e6d6d21 100644 --- a/src/DriverUNV/DriverUNV_W_SMESHDS_Document.cxx +++ b/src/DriverUNV/DriverUNV_W_SMESHDS_Document.cxx @@ -4,19 +4,22 @@ using namespace std; #include "utilities.h" -extern "C" +extern "C" { - Document_Writer* Wmaker() { - return new DriverUNV_W_SMESHDS_Document; - } + Document_Writer *Wmaker() + { + return new DriverUNV_W_SMESHDS_Document; + } } -DriverUNV_W_SMESHDS_Document::DriverUNV_W_SMESHDS_Document() { -; +DriverUNV_W_SMESHDS_Document::DriverUNV_W_SMESHDS_Document() +{ + ; } -DriverUNV_W_SMESHDS_Document::~DriverUNV_W_SMESHDS_Document() { -; +DriverUNV_W_SMESHDS_Document::~DriverUNV_W_SMESHDS_Document() +{ + ; } //void DriverUNV_W_SMESHDS_Document::SetFile(string aFile) { @@ -27,52 +30,54 @@ DriverUNV_W_SMESHDS_Document::~DriverUNV_W_SMESHDS_Document() { //myDocument = aDocument; //} -void DriverUNV_W_SMESHDS_Document::Write() { +void DriverUNV_W_SMESHDS_Document::Write() +{ - Handle(SMESHDS_Mesh) myMesh; + SMESHDS_Mesh * myMesh; /**************************************************************************** * OUVERTURE DU FICHIER EN ECRITURE * ****************************************************************************/ - char* file2Write = (char*)myFile.c_str(); - FILE* fid = fopen(file2Write,"w+"); - if (fid < 0) - { - fprintf(stderr,">> ERREUR : ouverture du fichier %s \n",file2Write); - exit(EXIT_FAILURE); - } + char *file2Write = (char *)myFile.c_str(); + FILE *fid = fopen(file2Write, "w+"); + if (fid < 0) + { + fprintf(stderr, ">> ERREUR : ouverture du fichier %s \n", file2Write); + exit(EXIT_FAILURE); + } /**************************************************************************** * FERMETURE DU FICHIER * ****************************************************************************/ - fclose(fid); + fclose(fid); /******** Nombre de maillages ********/ - int nb_of_meshes = myDocument->NbMeshes(); //voir avec Yves - //nb_of_meshes = 1; - int numero = 0; - - string myClass = string("SMESHDS_Mesh"); - string myExtension = string("UNV"); - - //while (numeroGetMesh(numero); - myDocument->InitMeshesIterator(); - for (;myDocument->MoreMesh();myDocument->NextMesh()) { - numero++; - myMesh = myDocument->CurrentMesh(); - - DriverUNV_W_SMESHDS_Mesh* myWriter = new DriverUNV_W_SMESHDS_Mesh; - //Mesh_Writer* myWriter = Driver::GetMeshWriter(myExtension, myClass); - - myWriter->SetMesh(myMesh); - myWriter->SetFile(myFile); - SCRUTE(myMesh); - //myWriter->SetFileId(fid); - myWriter->SetMeshId(numero); - myWriter->Write(); - } + int nb_of_meshes = myDocument->NbMeshes(); //voir avec Yves + //nb_of_meshes = 1; + int numero = 0; + + string myClass = string("SMESHDS_Mesh"); + string myExtension = string("UNV"); + + //while (numeroGetMesh(numero); + myDocument->InitMeshesIterator(); + while(myDocument->MoreMesh()) + { + numero++; + myMesh = myDocument->NextMesh(); + + DriverUNV_W_SMESHDS_Mesh *myWriter = new DriverUNV_W_SMESHDS_Mesh; + //Mesh_Writer* myWriter = Driver::GetMeshWriter(myExtension, myClass); + + myWriter->SetMesh(myMesh); + myWriter->SetFile(myFile); + SCRUTE(myMesh); + //myWriter->SetFileId(fid); + myWriter->SetMeshId(numero); + myWriter->Write(); + } }