Salome HOME
Renamming function and files
authorYoann Audouin <yoann.audouin@edf.fr>
Tue, 13 Sep 2022 14:45:33 +0000 (16:45 +0200)
committerYoann Audouin <yoann.audouin@edf.fr>
Tue, 18 Oct 2022 13:01:44 +0000 (15:01 +0200)
src/SMESH/CMakeLists.txt
src/SMESH/DriverMesh.cxx [deleted file]
src/SMESH/DriverMesh.hxx [deleted file]
src/SMESH/DriverStep.cxx [deleted file]
src/SMESH/DriverStep.hxx [deleted file]
src/SMESH/SMESH_DriverMesh.cxx [new file with mode: 0644]
src/SMESH/SMESH_DriverMesh.hxx [new file with mode: 0644]
src/SMESH/SMESH_DriverStep.cxx [new file with mode: 0644]
src/SMESH/SMESH_DriverStep.hxx [new file with mode: 0644]
src/SMESH/SMESH_Gen.cxx

index 2dfa654663269d4758c5a3ca1121492feb07644c..75c964b9970c54574aece7784c22a3bca0b7e497 100644 (file)
@@ -90,8 +90,8 @@ SET(SMESHimpl_HEADERS
   SMESH_SMESH.hxx
   MG_ADAPT.hxx
   SMESH_Homard.hxx
-  DriverMesh.hxx
-  DriverStep.hxx
+  SMESH_DriverMesh.hxx
+  SMESH_DriverStep.hxx
 )
 
 # --- sources ---
@@ -112,8 +112,8 @@ SET(SMESHimpl_SOURCES
   SMESH_MesherHelper.cxx
   MG_ADAPT.cxx
   SMESH_Homard.cxx
-  DriverMesh.cxx
-  DriverStep.cxx
+  SMESH_DriverMesh.cxx
+  SMESH_DriverStep.cxx
 )
 
 # --- rules ---
diff --git a/src/SMESH/DriverMesh.cxx b/src/SMESH/DriverMesh.cxx
deleted file mode 100644 (file)
index 29d4a6f..0000000
+++ /dev/null
@@ -1,95 +0,0 @@
-// 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
-//
-// 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, 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
-// 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-//  File   : DriverMesh.cxx
-//  Author : Yoann AUDOUIN, EDF
-//  Module : SMESH
-//
-
-#include "DriverMesh.hxx"
-
-#include "SMESH_Mesh.hxx"
-#include "SMESH_Gen.hxx"
-
-#include <MEDFileMesh.hxx>
-#include <MEDCouplingUMesh.hxx>
-
-using namespace MEDCoupling;
-
-/**
- * @brief Compares the mesh from two mesh files (MED)
- *
- * @param mesh_file1 First file
- * @param mesh_file2 Second file
- * @param mesh_name Name of the mesh in the files
- *
- * @return true if the mesh within the files are identical
- */
-bool diff_med_file(const std::string mesh_file1, const std::string mesh_file2, const std::string mesh_name){
-  MEDFileUMesh* medmesh1 = MEDFileUMesh::New(mesh_file1, mesh_name);
-  MEDFileUMesh* medmesh2 = MEDFileUMesh::New(mesh_file2, mesh_name);
-  MEDCouplingUMesh *m0_1=medmesh1->getMeshAtLevel(0,false);
-  MEDCouplingUMesh *m0_2=medmesh2->getMeshAtLevel(0,false);
-  return m0_1->isEqual(m0_2, 1e-12);
-}
-
-/**
- * @brief Import a mesh from a mesh file (MED) into a SMESH_Mesh object
- *
- * @param mesh_file the file
- * @param aMesh the object
- * @param mesh_name the name of the mesh in the file
- *
- * @return error code
- */
-int import_mesh(const std::string mesh_file, SMESH_Mesh& aMesh, const std::string mesh_name){
-  // TODO: change that as it depends on the language
-  std::cout << "Importing mesh from " << mesh_file << std::endl;
-  int ret = aMesh.MEDToMesh(mesh_file.c_str(), mesh_name.c_str());
-  return ret;
-}
-
-/**
- * @brief Export the content of a SMESH_Mesh into a mesh file (MED)
- *
- * @param mesh_file the file
- * @param aMesh the object
- * @param mesh_name name of the mesh in the file
- *
- * @return error code
- */
-int export_mesh(const std::string mesh_file, SMESH_Mesh& aMesh, const std::string mesh_name){
-
-  // TODO: See how to get the name of the mesh. Is it usefull ?
-  std::cout << "Exporting mesh to " << mesh_file << std::endl;
-  aMesh.ExportMED(mesh_file.c_str(), // theFile
-                  mesh_name.c_str(), // theMeshName
-                  false, // theAutoGroups
-                  -1, // theVersion
-                  nullptr, // theMeshPart
-                  true, // theAutoDimension
-                  true, // theAddODOnVertices
-                  1e-8, // theZTolerance
-                  true // theSaveNumbers
-                  );
-  return true;
-}
diff --git a/src/SMESH/DriverMesh.hxx b/src/SMESH/DriverMesh.hxx
deleted file mode 100644 (file)
index 5a1485f..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-// 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
-//
-// 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, 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
-// 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-//  File   : DriverMesh.hxx
-//  Author : Yoann AUDOUIN, EDF
-//  Module : SMESH
-//
-
-#ifndef _DRIVERMESH_HXX_
-#define _DRIVERMESH_HXX_
-
-#include <string>
-#include <cassert>
-
-class SMESH_Mesh;
-
-bool diff_med_file(const std::string mesh_file1,
-                   const std::string mesh_file2,
-                   const std::string mesh_name);
-int import_mesh(const std::string mesh_file,
-                SMESH_Mesh& aMesh,
-                const std::string meshName);
-int export_mesh(const std::string mesh_file,
-                SMESH_Mesh& aMesh,
-                const std::string meshName);
-
-#endif
diff --git a/src/SMESH/DriverStep.cxx b/src/SMESH/DriverStep.cxx
deleted file mode 100644 (file)
index 54d4e8d..0000000
+++ /dev/null
@@ -1,128 +0,0 @@
-// 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
-//
-// 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, 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
-// 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-//  File   : DriverStep.cxx
-//  Author : Yoann AUDOUIN, EDF
-//  Module : SMESH
-//
-
-#include "DriverStep.hxx"
-
-#include <STEPControl_Reader.hxx>
-#include <STEPControl_Writer.hxx>
-#include <Interface_Static.hxx>
-
-//Occ include
-#include <TopoDS.hxx>
-
-
-/**
- * @brief Compares two shape file (STEP)
- *
- * @param file1 first file
- * @param file2 second file
- *
- * @return true if the files are the same
- */
-bool diff_step_file(std::string file1, std::string file2){
-  std::ifstream sfile1(file1);
-  std::ifstream sfile2(file2);
-  std::string line1, line2;
-  int nb_lines = 0;
-
-  while(!sfile1.eof() && !sfile2.eof()){
-    std::getline(sfile1, line1);
-    std::getline(sfile2, line2);
-    nb_lines++;
-    // Skipping 4th line contain date of creation
-    if (nb_lines==4){
-      std::cout << "Skipping line" << std::endl;
-      continue;
-    }
-
-    // if lines are different end of read
-    if(line1 != line2){
-      return false;
-    }
-
-  }
-  // True if we reached the end of both files
-  return sfile1.eof() && sfile2.eof();
-}
-
-/**
- * @brief Import the content of a shape file (STEP) into a TopDS_Shape object
- *
- * @param shape_file the shape file
- * @param aShape the object
- *
- * @return error code
- */
-int import_shape(const std::string shape_file, TopoDS_Shape& aShape){
-
-  std::cout << "Importing shape from " << shape_file << std::endl;
-  STEPControl_Reader reader;
-  // Forcing Unit in meter
-  Interface_Static::SetCVal("xstep.cascade.unit","M");
-  Interface_Static::SetIVal("read.step.ideas", 1);
-  Interface_Static::SetIVal("read.step.nonmanifold", 1);
-  IFSelect_ReturnStatus aStat = reader.ReadFile(shape_file.c_str());
-  if(aStat != IFSelect_RetDone)
-    std::cout << "Reading error for "  << shape_file << std::endl;
-
-  int NbTrans = reader.TransferRoots();
-  // There should be only one shape within the file
-  assert(NbTrans==1);
-  aShape = reader.OneShape();
-
-  return true;
-}
-
-/**
- * @brief Export the content of a TopoDS_Shape into a shape file (STEP)
- *
- * @param shape_file the shape file
- * @param aShape the object
- *
- * @return error code
- */
-int export_shape(const std::string shape_file, const TopoDS_Shape& aShape){
-
-  std::cout << "Exporting shape to " << shape_file << std::endl;
-
-  STEPControl_Writer aWriter;
-  // Forcing Unit in meter
-  Interface_Static::SetCVal("xstep.cascade.unit","M");
-  Interface_Static::SetCVal("write.step.unit","M");
-  Interface_Static::SetIVal("write.step.nonmanifold", 1);
-
-  IFSelect_ReturnStatus aStat = aWriter.Transfer(aShape,STEPControl_AsIs);
-  if(aStat != IFSelect_RetDone)
-    std::cout << "Transfer error for "  << shape_file << std::endl;
-
-  aStat = aWriter.Write(shape_file.c_str());
-
-  if(aStat != IFSelect_RetDone)
-    std::cout << "Writing error for "  << shape_file << std::endl;
-
-  return aStat;
-}
diff --git a/src/SMESH/DriverStep.hxx b/src/SMESH/DriverStep.hxx
deleted file mode 100644 (file)
index ab13d1e..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-// 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
-//
-// 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, 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
-// 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-//  File   : DriverStep.hxx
-//  Author : Yoann AUDOUIN, EDF
-//  Module : SMESH
-//
-
-#ifndef _DRIVERSTEP_HXX_
-#define _DRIVERSTEP_HXX_
-
-#include <string>
-#include <cassert>
-
-class TopoDS_Shape;
-
-int import_shape(const std::string shape_file, TopoDS_Shape& aShape);
-int export_shape(const std::string shape_file, const TopoDS_Shape& aShape);
-bool diff_step_file(std::string file1, std::string file2);
-
-
-#endif
\ No newline at end of file
diff --git a/src/SMESH/SMESH_DriverMesh.cxx b/src/SMESH/SMESH_DriverMesh.cxx
new file mode 100644 (file)
index 0000000..2c01523
--- /dev/null
@@ -0,0 +1,95 @@
+// 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
+//
+// 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, 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
+// 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+//  File   : SMESH_DriverMesh.cxx
+//  Author : Yoann AUDOUIN, EDF
+//  Module : SMESH
+//
+
+#include "SMESH_DriverMesh.hxx"
+
+#include "SMESH_Mesh.hxx"
+#include "SMESH_Gen.hxx"
+
+#include <MEDFileMesh.hxx>
+#include <MEDCouplingUMesh.hxx>
+
+using namespace MEDCoupling;
+
+/**
+ * @brief Compares the mesh from two mesh files (MED)
+ *
+ * @param mesh_file1 First file
+ * @param mesh_file2 Second file
+ * @param mesh_name Name of the mesh in the files
+ *
+ * @return true if the mesh within the files are identical
+ */
+bool diffMEDFile(const std::string mesh_file1, const std::string mesh_file2, const std::string mesh_name){
+  MEDFileUMesh* medmesh1 = MEDFileUMesh::New(mesh_file1, mesh_name);
+  MEDFileUMesh* medmesh2 = MEDFileUMesh::New(mesh_file2, mesh_name);
+  MEDCouplingUMesh *m0_1=medmesh1->getMeshAtLevel(0,false);
+  MEDCouplingUMesh *m0_2=medmesh2->getMeshAtLevel(0,false);
+  return m0_1->isEqual(m0_2, 1e-12);
+}
+
+/**
+ * @brief Import a mesh from a mesh file (MED) into a SMESH_Mesh object
+ *
+ * @param mesh_file the file
+ * @param aMesh the object
+ * @param mesh_name the name of the mesh in the file
+ *
+ * @return error code
+ */
+int importMesh(const std::string mesh_file, SMESH_Mesh& aMesh, const std::string mesh_name){
+  // TODO: change that as it depends on the language
+  std::cout << "Importing mesh from " << mesh_file << std::endl;
+  int ret = aMesh.MEDToMesh(mesh_file.c_str(), mesh_name.c_str());
+  return ret;
+}
+
+/**
+ * @brief Export the content of a SMESH_Mesh into a mesh file (MED)
+ *
+ * @param mesh_file the file
+ * @param aMesh the object
+ * @param mesh_name name of the mesh in the file
+ *
+ * @return error code
+ */
+int exportMesh(const std::string mesh_file, SMESH_Mesh& aMesh, const std::string mesh_name){
+
+  // TODO: See how to get the name of the mesh. Is it usefull ?
+  std::cout << "Exporting mesh to " << mesh_file << std::endl;
+  aMesh.ExportMED(mesh_file.c_str(), // theFile
+                  mesh_name.c_str(), // theMeshName
+                  false, // theAutoGroups
+                  -1, // theVersion
+                  nullptr, // theMeshPart
+                  true, // theAutoDimension
+                  true, // theAddODOnVertices
+                  1e-8, // theZTolerance
+                  true // theSaveNumbers
+                  );
+  return true;
+}
diff --git a/src/SMESH/SMESH_DriverMesh.hxx b/src/SMESH/SMESH_DriverMesh.hxx
new file mode 100644 (file)
index 0000000..eaf2ed1
--- /dev/null
@@ -0,0 +1,46 @@
+// 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
+//
+// 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, 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
+// 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+//  File   : SMESH_DriverMesh.hxx
+//  Author : Yoann AUDOUIN, EDF
+//  Module : SMESH
+//
+
+#ifndef _SMESH_DRIVERMESH_HXX_
+#define _SMESH_DRIVERMESH_HXX_
+
+#include <string>
+#include <cassert>
+
+class SMESH_Mesh;
+
+bool diffMEDFile(const std::string mesh_file1,
+                   const std::string mesh_file2,
+                   const std::string mesh_name);
+int importMesh(const std::string mesh_file,
+                SMESH_Mesh& aMesh,
+                const std::string meshName);
+int exportMesh(const std::string mesh_file,
+                SMESH_Mesh& aMesh,
+                const std::string meshName);
+
+#endif
diff --git a/src/SMESH/SMESH_DriverStep.cxx b/src/SMESH/SMESH_DriverStep.cxx
new file mode 100644 (file)
index 0000000..b19be48
--- /dev/null
@@ -0,0 +1,128 @@
+// 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
+//
+// 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, 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
+// 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+//  File   : SMESH_DriverStep.cxx
+//  Author : Yoann AUDOUIN, EDF
+//  Module : SMESH
+//
+
+#include "SMESH_DriverStep.hxx"
+
+#include <STEPControl_Reader.hxx>
+#include <STEPControl_Writer.hxx>
+#include <Interface_Static.hxx>
+
+//Occ include
+#include <TopoDS.hxx>
+
+
+/**
+ * @brief Compares two shape file (STEP)
+ *
+ * @param file1 first file
+ * @param file2 second file
+ *
+ * @return true if the files are the same
+ */
+bool diffStepFile(std::string file1, std::string file2){
+  std::ifstream sfile1(file1);
+  std::ifstream sfile2(file2);
+  std::string line1, line2;
+  int nb_lines = 0;
+
+  while(!sfile1.eof() && !sfile2.eof()){
+    std::getline(sfile1, line1);
+    std::getline(sfile2, line2);
+    nb_lines++;
+    // Skipping 4th line contain date of creation
+    if (nb_lines==4){
+      std::cout << "Skipping line" << std::endl;
+      continue;
+    }
+
+    // if lines are different end of read
+    if(line1 != line2){
+      return false;
+    }
+
+  }
+  // True if we reached the end of both files
+  return sfile1.eof() && sfile2.eof();
+}
+
+/**
+ * @brief Import the content of a shape file (STEP) into a TopDS_Shape object
+ *
+ * @param shape_file the shape file
+ * @param aShape the object
+ *
+ * @return error code
+ */
+int importShape(const std::string shape_file, TopoDS_Shape& aShape){
+
+  std::cout << "Importing shape from " << shape_file << std::endl;
+  STEPControl_Reader reader;
+  // Forcing Unit in meter
+  Interface_Static::SetCVal("xstep.cascade.unit","M");
+  Interface_Static::SetIVal("read.step.ideas", 1);
+  Interface_Static::SetIVal("read.step.nonmanifold", 1);
+  IFSelect_ReturnStatus aStat = reader.ReadFile(shape_file.c_str());
+  if(aStat != IFSelect_RetDone)
+    std::cout << "Reading error for "  << shape_file << std::endl;
+
+  int NbTrans = reader.TransferRoots();
+  // There should be only one shape within the file
+  assert(NbTrans==1);
+  aShape = reader.OneShape();
+
+  return true;
+}
+
+/**
+ * @brief Export the content of a TopoDS_Shape into a shape file (STEP)
+ *
+ * @param shape_file the shape file
+ * @param aShape the object
+ *
+ * @return error code
+ */
+int exportShape(const std::string shape_file, const TopoDS_Shape& aShape){
+
+  std::cout << "Exporting shape to " << shape_file << std::endl;
+
+  STEPControl_Writer aWriter;
+  // Forcing Unit in meter
+  Interface_Static::SetCVal("xstep.cascade.unit","M");
+  Interface_Static::SetCVal("write.step.unit","M");
+  Interface_Static::SetIVal("write.step.nonmanifold", 1);
+
+  IFSelect_ReturnStatus aStat = aWriter.Transfer(aShape,STEPControl_AsIs);
+  if(aStat != IFSelect_RetDone)
+    std::cout << "Transfer error for "  << shape_file << std::endl;
+
+  aStat = aWriter.Write(shape_file.c_str());
+
+  if(aStat != IFSelect_RetDone)
+    std::cout << "Writing error for "  << shape_file << std::endl;
+
+  return aStat;
+}
diff --git a/src/SMESH/SMESH_DriverStep.hxx b/src/SMESH/SMESH_DriverStep.hxx
new file mode 100644 (file)
index 0000000..18158ae
--- /dev/null
@@ -0,0 +1,41 @@
+// 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
+//
+// 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, 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
+// 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+//  File   : SMESH_DriverStep.hxx
+//  Author : Yoann AUDOUIN, EDF
+//  Module : SMESH
+//
+
+#ifndef _SMESH_DRIVERSTEP_HXX_
+#define _SMESH_DRIVERSTEP_HXX_
+
+#include <string>
+#include <cassert>
+
+class TopoDS_Shape;
+
+int importShape(const std::string shape_file, TopoDS_Shape& aShape);
+int exportShape(const std::string shape_file, const TopoDS_Shape& aShape);
+bool diffStepFile(std::string file1, std::string file2);
+
+
+#endif
\ No newline at end of file
index fd053da6909ba75845098e05e3aac33bd7d86f76..e2d908f1f109356d65406034fa7ae8ed842aad13 100644 (file)
@@ -30,7 +30,7 @@
 
 #include "SMESH_Gen.hxx"
 
-#include "DriverMesh.hxx"
+#include "SMESH_DriverMesh.hxx"
 #include "SMDS_Mesh.hxx"
 #include "SMDS_MeshElement.hxx"
 #include "SMDS_MeshNode.hxx"
@@ -293,7 +293,7 @@ bool SMESH_Gen::Compute(SMESH_Mesh &                aMesh,
         {
           fs::path mesh_file = fs::path(aMesh.tmp_folder) / fs::path(file_name);
           // TODO: change mesh name
-          export_mesh(mesh_file.string(), aMesh, "Maillage_1");
+          exportMesh(mesh_file.string(), aMesh, "Maillage_1");
 
         }
         //Resetting threaded pool info