X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FDriverUNV%2FDriverUNV_R_SMESHDS_Document.cxx;h=8b904cf4c6a155921e4fc4d4ae493120b592ba21;hp=8debd497b777b763fa0bc1a7573c7693dc8ea107;hb=8d2ecd75b04ac82778c48882c4f19d4561be0985;hpb=49b22b1c40b88469c8f2dace3fcb278dd83528a9 diff --git a/src/DriverUNV/DriverUNV_R_SMESHDS_Document.cxx b/src/DriverUNV/DriverUNV_R_SMESHDS_Document.cxx index 8debd497b..8b904cf4c 100644 --- a/src/DriverUNV/DriverUNV_R_SMESHDS_Document.cxx +++ b/src/DriverUNV/DriverUNV_R_SMESHDS_Document.cxx @@ -4,25 +4,30 @@ using namespace std; #include "utilities.h" -int getOne() { - printf("in getOne"); - return (1); +int getOne() +{ + printf("in getOne"); + return (1); } -extern "C" { - // Document_Reader* maker() { - DriverUNV_R_SMESHDS_Document* maker() { - fprintf(stdout,"here in maker\n"); - return new DriverUNV_R_SMESHDS_Document; - } +extern "C" +{ + // Document_Reader* maker() { + DriverUNV_R_SMESHDS_Document *maker() + { + fprintf(stdout, "here in maker\n"); + return new DriverUNV_R_SMESHDS_Document; + } } -DriverUNV_R_SMESHDS_Document::DriverUNV_R_SMESHDS_Document() { - myFile = string(""); +DriverUNV_R_SMESHDS_Document::DriverUNV_R_SMESHDS_Document() +{ + myFile = string(""); } -DriverUNV_R_SMESHDS_Document::~DriverUNV_R_SMESHDS_Document() { -; +DriverUNV_R_SMESHDS_Document::~DriverUNV_R_SMESHDS_Document() +{ + ; } //void DriverUNV_R_SMESHDS_Document::SetFile(string aFile) { @@ -33,53 +38,53 @@ DriverUNV_R_SMESHDS_Document::~DriverUNV_R_SMESHDS_Document() { //myDocument = aDoc; //} -void DriverUNV_R_SMESHDS_Document::Read() { +void DriverUNV_R_SMESHDS_Document::Read() +{ - int myMeshId; - SCRUTE(myFile); - //Handle(SMESHDS_Document) myDocument = new SMESHDS_Document(1); + int myMeshId; + SCRUTE(myFile); + //Handle(SMESHDS_Document) myDocument = new SMESHDS_Document(1); /**************************************************************************** * OUVERTURE DU FICHIER EN LECTURE * ****************************************************************************/ - char* file2Read = (char*)myFile.c_str(); - FILE* fid = fopen(file2Read,"r"); - if (fid < 0) - { - fprintf(stderr,">> ERREUR : ouverture du fichier %s \n",file2Read); - exit(EXIT_FAILURE); - } + char *file2Read = (char *)myFile.c_str(); + FILE *fid = fopen(file2Read, "r"); + if (fid < 0) + { + fprintf(stderr, ">> ERREUR : ouverture du fichier %s \n", file2Read); + exit(EXIT_FAILURE); + } /**************************************************************************** * COMBIEN DE MAILLAGES ? * ****************************************************************************/ - int nmaa = 1; + int nmaa = 1; /**************************************************************************** * FERMETURE DU FICHIER * ****************************************************************************/ - fclose(fid); - - printf("Nombre de maillages = %d\n",nmaa); + fclose(fid); - string myClass = string("SMESHDS_Mesh"); - string myExtension = string("UNV"); + printf("Nombre de maillages = %d\n", nmaa); - for (int meshIt=1;meshIt<=nmaa;meshIt++) { - myMeshId = myDocument->NewMesh(); + string myClass = string("SMESHDS_Mesh"); + string myExtension = string("UNV"); - Handle(SMDS_Mesh) myMesh = myDocument->GetMesh(myMeshId); + for (int meshIt = 1; meshIt <= nmaa; meshIt++) + { + myMeshId = myDocument->NewMesh(); - DriverUNV_R_SMESHDS_Mesh* myReader = new DriverUNV_R_SMESHDS_Mesh; + SMDS_Mesh * myMesh = myDocument->GetMesh(myMeshId); + DriverUNV_R_SMESHDS_Mesh *myReader = new DriverUNV_R_SMESHDS_Mesh; - myReader->SetMesh(myMesh); - myReader->SetFile(myFile); - //myReader->SetFileId(fid); + myReader->SetMesh(myMesh); + myReader->SetFile(myFile); + //myReader->SetFileId(fid); - myReader->Read(); - - } + myReader->Read(); + } }