+// SMESH DriverMED : driver to read and write 'med' files
+//
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// 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.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+//
+//
+//
+// File : DriverMED_W_SMESHDS_Mesh.cxx
+// Module : SMESH
+
using namespace std;
#include "DriverMED_W_SMESHDS_Mesh.h"
#include "DriverMED_W_SMDS_Mesh.h"
/****************************************************************************
* NOMBRES D'OBJETS MED *
****************************************************************************/
- fprintf(stdout,"\n(****************************)\n");
- fprintf(stdout,"(* INFORMATIONS GENERALES : *)\n");
- fprintf(stdout,"(****************************)\n");
+ MESSAGE("(****************************)");
+ MESSAGE("(* INFORMATIONS GENERALES : *)");
+ MESSAGE("(****************************)");
/* calcul de la dimension */
mdim=2;
/****************************************************************************
* ECRITURE DES NOEUDS *
****************************************************************************/
- fprintf(stdout,"\n(************************)\n");
- fprintf(stdout,"(* NOEUDS DU MAILLAGE : *)\n");
- fprintf(stdout,"(************************)\n");
+ MESSAGE("(************************)");
+ MESSAGE("(* NOEUDS DU MAILLAGE : *)");
+ MESSAGE("(************************)");
/* Allocations memoires */
/* table des coordonnees
coo[i*3]=node->X();
coo[i*3+1]=node->Y();
coo[i*3+2]=node->Z();
+ } else if(mdim==2) {
+ if ( dimX ) {
+ coo[i*2]=node->Y();
+ coo[i*2+1]=node->Z();
+ }
+ if ( dimY ) {
+ coo[i*2]=node->X();
+ coo[i*2+1]=node->Z();
+ }
+ if ( dimZ ) {
+ coo[i*2]=node->X();
+ coo[i*2+1]=node->Y();
+ }
} else {
if ( dimX ) {
coo[i*2]=node->Y();
/****************************************************************************
* ECRITURE DES ELEMENTS *
****************************************************************************/
- fprintf(stdout,"\n(**************************)\n");
- fprintf(stdout,"(* ELEMENTS DU MAILLAGE : *)\n");
- fprintf(stdout,"(**************************)\n");
-
+ MESSAGE("(**************************)");
+ MESSAGE("(* ELEMENTS DU MAILLAGE : *)");
+ MESSAGE("(**************************)");
+
/* Ecriture des connectivites, noms, numeros des mailles */
if (ret == 0)