1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: GeomAlgoAPI_BREPImport.cpp
4 // Created: May 14, 2015
5 // Author: Sergey POKHODENKO
7 #include <GeomAlgoAPI_BREPImport.h>
9 #include <TopoDS_Shape.hxx>
11 #include <BRepTools.hxx>
12 #include <BRep_Builder.hxx>
14 //=============================================================================
18 //=============================================================================
19 std::shared_ptr<GeomAPI_Shape> BREPImport(const std::string& theFileName,
21 std::string& theError)
24 std::cout << "Import BREP from file " << theFileName << std::endl;
27 BRep_Builder aBuilder;
28 BRepTools::Read(aShape, theFileName.c_str(), aBuilder);
29 if (aShape.IsNull()) {
30 theError = "BREP Import failed";
33 std::shared_ptr<GeomAPI_Shape> aGeomShape(new GeomAPI_Shape);
34 aGeomShape->setImpl(new TopoDS_Shape(aShape));