Salome HOME
bos #24368 EDF 23667 - Duplicates nodes
[modules/smesh.git] / src / DriverDAT / DriverDAT_R_SMDS_Mesh.cxx
index d44951e8689d9f90d59042fea28eef73a00485fe..d0f233ecc9ed9cca4ea835da0547a661bafa31f8 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2021  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
@@ -47,13 +47,17 @@ Driver_Mesh::Status DriverDAT_R_SMDS_Mesh::Perform()
   int NoeudsMaille[20];
   int NoeudMaille;
   
-  MESSAGE("in DriverDAT_R_SMDS_Mesh::Read()");
   /****************************************************************************
    *                      OUVERTURE DU FICHIER EN LECTURE                      *
    ****************************************************************************/
+#if defined(WIN32) && defined(UNICODE)
+  std::wstring file2Read = Kernel_Utils::utf8_decode_s(myFile);
+  FILE* aFileId = _wfopen(file2Read.c_str(), L"r");
+#else
   char *file2Read = (char *)myFile.c_str();
   FILE* aFileId = fopen(file2Read, "r");
-  if (aFileId < 0) {
+#endif
+  if ( !aFileId ) {
     fprintf(stderr, ">> ERREUR : ouverture du fichier %s \n", file2Read);
     return DRS_FAIL;
   }
@@ -72,7 +76,7 @@ Driver_Mesh::Status DriverDAT_R_SMDS_Mesh::Perform()
     myMesh->AddNodeWithID(coordX, coordY, coordZ, intNumPoint);
   }
   
-  fprintf(stdout, "%d noeuds\n", myMesh->NbNodes());
+  fprintf(stdout, "%ld noeuds\n", static_cast< long >( myMesh->NbNodes() ));
   /****************************************************************************
    *                       LECTURE DES ELEMENTS                                *
    ****************************************************************************/