]> SALOME platform Git repositories - modules/geom.git/blob - src/BREPImport/BREPImport.cxx
Salome HOME
Modified a method createAndDisplayGO
[modules/geom.git] / src / BREPImport / BREPImport.cxx
1 // File:        BREPImport.cxx
2 // Created:     Wed May 19 14:29:52 2004
3 // Author:      Pavel TELKOV
4 //              <ptv@mutex.nnov.opencascade.com>
5
6 #include "utilities.h"
7
8 #include <BRepTools.hxx>
9 #include <BRep_Builder.hxx>
10
11 #include <TCollection_AsciiString.hxx>
12 #include <TopoDS_Shape.hxx>
13
14 #ifdef WNT
15 #include <SALOME_WNT.hxx>
16 #else
17 #define SALOME_WNT_EXPORT
18 #endif
19
20 //=============================================================================
21 /*!
22  *
23  */
24 //=============================================================================
25
26 extern "C"
27 {
28 SALOME_WNT_EXPORT
29   TopoDS_Shape Import (const TCollection_AsciiString& theFileName,
30                        TCollection_AsciiString&       theError)
31   {
32     MESSAGE("Import BREP from file " << theFileName);
33     TopoDS_Shape aShape;
34     BRep_Builder B;
35     BRepTools::Read(aShape, theFileName.ToCString(), B);
36     if (aShape.IsNull()) {
37       theError = "BREP Import failed";
38     }
39     return aShape;
40   }
41 }