1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: GEOMALGOAPI_BREPExport.cpp
4 // Created: May 14, 2015
5 // Author: Sergey POKHODENKO
7 #include <GeomAlgoAPI_BREPExport.h>
9 #include "GeomAlgoAPI_Tools.h"
11 #include <TopoDS_Shape.hxx>
13 #include <BRepTools.hxx>
14 #include <BRep_Builder.hxx>
16 //=============================================================================
20 //=============================================================================
21 bool BREPExport(const std::string& theFileName,
23 const std::shared_ptr<GeomAPI_Shape>& theShape,
24 std::string& theError)
27 std::cout << "Export BREP into file " << theFileName << std::endl;
30 if (!theShape.get()) {
31 theError = "BREP Export failed: An invalid argument";
35 // Set "C" numeric locale to save numbers correctly
36 GeomAlgoAPI_Tools::Localizer loc;
38 if (!BRepTools::Write(theShape->impl<TopoDS_Shape>(), theFileName.c_str())) {
39 theError = "BREP Export failed";