Salome HOME
Issue #608: Usage of OCCT in interface -- Wrap classes by SWIG
[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 bool BREPExport(const std::string& theFileName,
20                 const std::string&,
21                 const TopoDS_Shape& theShape,
22                 std::string& theError)
23 {
24   #ifdef _DEBUG
25   std::cout << "Export BREP into file " << theFileName << std::endl;
26   #endif
27
28   // Set "C" numeric locale to save numbers correctly
29   GeomAlgoAPI_Tools::Localizer loc;
30
31   if (!BRepTools::Write(theShape, theFileName.c_str())) {
32     theError = "BREP Export failed";
33     return false;
34   }
35   return true;
36 }