Salome HOME
Merge branch 'Dev_1.2.0' of newgeom:newgeom into Dev_1.2.0
[modules/shaper.git] / src / GeomAlgoAPI / GeomAlgoAPI_BREPExport.cpp
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 #include <GeomAlgoAPI_BREPExport.h>
4
5 #include "GeomAlgoAPI_Tools.h"
6
7 #include <BRepTools.hxx>
8 #include <BRep_Builder.hxx>
9
10 //=============================================================================
11 /*!
12  *
13  */
14 //=============================================================================
15 //extern "C" {
16 namespace BREPExport {
17 bool Export(const TCollection_AsciiString& theFileName,
18             const TCollection_AsciiString&,
19             const TopoDS_Shape& theShape,
20             TCollection_AsciiString& theError)
21 {
22   #ifdef _DEBUG
23   std::cout << "Export BREP into file " << theFileName << std::endl;
24   #endif
25
26   // Set "C" numeric locale to save numbers correctly
27   GeomAlgoAPI_Tools::Localizer loc;
28
29   if ( !BRepTools::Write( theShape, theFileName.ToCString() ) ) {
30     theError = "BREP Export failed";
31     return false;
32   }
33   return true;
34 }
35
36 }
37 //}