Salome HOME
Issue #608: Usage of OCCT in interface -- Remove OCCT from *Export interfaces
[modules/shaper.git] / src / GeomAlgoAPI / GeomAlgoAPI_BREPExport.cpp
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:    GEOMALGOAPI_BREPExport.cpp
4 // Created: May 14, 2015
5 // Author:  Sergey POKHODENKO
6
7 #include <GeomAlgoAPI_BREPExport.h>
8
9 #include "GeomAlgoAPI_Tools.h"
10
11 #include <BRepTools.hxx>
12 #include <BRep_Builder.hxx>
13
14 //=============================================================================
15 /*!
16  *
17  */
18 //=============================================================================
19 namespace BREPExport {
20
21 bool Export(const std::string& theFileName,
22             const std::string&,
23             const TopoDS_Shape& theShape,
24             std::string& theError)
25 {
26   #ifdef _DEBUG
27   std::cout << "Export BREP into file " << theFileName << std::endl;
28   #endif
29
30   // Set "C" numeric locale to save numbers correctly
31   GeomAlgoAPI_Tools::Localizer loc;
32
33   if (!BRepTools::Write(theShape, theFileName.c_str())) {
34     theError = "BREP Export failed";
35     return false;
36   }
37   return true;
38 }
39
40 } // namespace BREPExport