Salome HOME
62d63ac24b4d063b5935f0574ae1218610851160
[modules/shaper.git] / src / GeomAlgoAPI / GeomAlgoAPI_BREPImport.cpp
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 #include <GeomAlgoAPI_BREPImport.h>
4
5 #include <BRepTools.hxx>
6 #include <BRep_Builder.hxx>
7
8 //=============================================================================
9 /*!
10  *
11  */
12 //=============================================================================
13 TopoDS_Shape BREPImport(const std::string& theFileName,
14                         const std::string&,
15                         std::string& theError)
16 {
17   #ifdef _DEBUG
18   std::cout << "Import BREP from file " << theFileName << std::endl;
19   #endif
20   TopoDS_Shape aShape;
21   BRep_Builder aBuilder;
22   BRepTools::Read(aShape, theFileName.c_str(), aBuilder);
23   if (aShape.IsNull()) {
24     theError = "BREP Import failed";
25   }
26   return aShape;
27 }