X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FDriverDAT%2FDriverDAT_W_SMDS_Mesh.cxx;h=a86d1b2954c189c842503a854a0ff485098ca8d2;hb=952c6dca84049d14f1e92be5363e20ae5ca315cd;hp=ae1632dca8b45d2594294b2c9e52b87aa7f9171e;hpb=3e2ff42c8608ec99d93c5e3c60ecc815bc1ec0e1;p=modules%2Fsmesh.git diff --git a/src/DriverDAT/DriverDAT_W_SMDS_Mesh.cxx b/src/DriverDAT/DriverDAT_W_SMDS_Mesh.cxx index ae1632dca..a86d1b295 100644 --- a/src/DriverDAT/DriverDAT_W_SMDS_Mesh.cxx +++ b/src/DriverDAT/DriverDAT_W_SMDS_Mesh.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -6,7 +6,7 @@ // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2.1 of the License. +// version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -38,11 +38,10 @@ Driver_Mesh::Status DriverDAT_W_SMDS_Mesh::Perform() Status aResult = DRS_OK; int nbNodes, nbCells; - //int i; - + char *file2Read = (char *)myFile.c_str(); FILE* aFileId = fopen(file2Read, "w+"); - if (aFileId < 0) { + if ( !aFileId ) { fprintf(stderr, ">> ERREUR : ouverture du fichier %s \n", file2Read); return DRS_FAIL; } @@ -50,12 +49,12 @@ Driver_Mesh::Status DriverDAT_W_SMDS_Mesh::Perform() /**************************************************************************** * NOMBRES D'OBJETS * ****************************************************************************/ - + /* Combien de noeuds ? */ nbNodes = myMesh->NbNodes(); - + /* Combien de mailles, faces ou aretes ? */ - int /*nb_of_nodes,*/ nb_of_edges, nb_of_faces, nb_of_volumes; + int nb_of_edges, nb_of_faces, nb_of_volumes; nb_of_edges = myMesh->NbEdges(); nb_of_faces = myMesh->NbFaces(); nb_of_volumes = myMesh->NbVolumes(); @@ -63,18 +62,18 @@ Driver_Mesh::Status DriverDAT_W_SMDS_Mesh::Perform() SCRUTE(nb_of_edges); SCRUTE(nb_of_faces); SCRUTE(nb_of_volumes); - - fprintf(stdout, "%d %d\n", nbNodes, nbCells); + + //fprintf(stdout, "%d %d\n", nbNodes, nbCells); fprintf(aFileId, "%d %d\n", nbNodes, nbCells); - + /**************************************************************************** * ECRITURE DES NOEUDS * ****************************************************************************/ - + SMDS_NodeIteratorPtr itNodes=myMesh->nodesIterator(); while(itNodes->more()){ const SMDS_MeshNode * node = itNodes->next(); - fprintf(aFileId, "%d %e %e %e\n", node->GetID(), node->X(), node->Y(), node->Z()); + fprintf(aFileId, "%d %.14e %.14e %.14e\n", node->GetID(), node->X(), node->Y(), node->Z()); } /****************************************************************************