Salome HOME
yfr : Merge with v1.2
[modules/smesh.git] / src / DriverMED / DriverMED_W_SMESHDS_Mesh.cxx
index 07845bb5fe735b71d2573a35befa6734a3b87a4d..e17c1d84de34eac15bb18b20afb9c3af10fd7a29 100644 (file)
@@ -1,3 +1,29 @@
+//  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"
@@ -180,9 +206,9 @@ void DriverMED_W_SMESHDS_Mesh::Add() {
   /****************************************************************************
    *                       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;
@@ -335,9 +361,9 @@ void DriverMED_W_SMESHDS_Mesh::Add() {
   /****************************************************************************
    *                       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
@@ -389,6 +415,19 @@ void DriverMED_W_SMESHDS_Mesh::Add() {
        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();
@@ -448,10 +487,10 @@ void DriverMED_W_SMESHDS_Mesh::Add() {
   /****************************************************************************
    *                       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)