Salome HOME
Issue #1942: group - names are empty strings
[modules/shaper.git] / src / GeomAlgoAPI / GeomAlgoAPI_BREPImport.cpp
index 62d63ac24b4d063b5935f0574ae1218610851160..e067acc9e94b3d09067a197063934ac7bebac752 100644 (file)
@@ -1,7 +1,13 @@
 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
 
+// File:    GeomAlgoAPI_BREPImport.cpp
+// Created: May 14, 2015
+// Author:  Sergey POKHODENKO
+
 #include <GeomAlgoAPI_BREPImport.h>
 
+#include <TopoDS_Shape.hxx>
+
 #include <BRepTools.hxx>
 #include <BRep_Builder.hxx>
 
@@ -10,9 +16,9 @@
  *
  */
 //=============================================================================
-TopoDS_Shape BREPImport(const std::string& theFileName,
-                        const std::string&,
-                        std::string& theError)
+std::shared_ptr<GeomAPI_Shape> BREPImport(const std::string& theFileName,
+                                          const std::string&,
+                                          std::string& theError)
 {
   #ifdef _DEBUG
   std::cout << "Import BREP from file " << theFileName << std::endl;
@@ -23,5 +29,8 @@ TopoDS_Shape BREPImport(const std::string& theFileName,
   if (aShape.IsNull()) {
     theError = "BREP Import failed";
   }
-  return aShape;
+
+  std::shared_ptr<GeomAPI_Shape> aGeomShape(new GeomAPI_Shape);
+  aGeomShape->setImpl(new TopoDS_Shape(aShape));
+  return aGeomShape;
 }