Salome HOME
BREP/STEP Import moved into GeomAlgoAPI. ExchangePlugin is not linked with OCC anymore.
[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 //extern "C" {
14 namespace BREPImport {
15 TopoDS_Shape Import(const TCollection_AsciiString& theFileName,
16                     const TCollection_AsciiString&,
17                     TCollection_AsciiString& theError, const TDF_Label&)
18 {
19   #ifdef _DEBUG
20   std::cout << "Import BREP from file " << theFileName << std::endl;
21   #endif
22   TopoDS_Shape aShape;
23   BRep_Builder aBuilder;
24   BRepTools::Read(aShape, theFileName.ToCString(), aBuilder);
25   if (aShape.IsNull()) {
26     theError = "BREP Import failed";
27   }
28   return aShape;
29 }
30
31 }
32 //}