Salome HOME
FIx for issue #360 : make switching on/off checking of transactions in Session -...
[modules/shaper.git] / src / GeomAlgoAPI / GeomAlgoAPI_MakeShape.cpp
index 679526befc0e3e94fad7d9fa0f636cd8516ac822..f28779de5f60f244d5c41124d2541b00fdeefcbf 100644 (file)
@@ -1,30 +1,43 @@
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+
 // File:        GeomAlgoAPI_MakeShape.cpp
 // Created:     20 Oct 2014
 // Author:      Sergey ZARITCHNY
 
 #include <GeomAlgoAPI_MakeShape.h>
+#include <BRepBuilderAPI_MakeShape.hxx>
 #include <TopTools_ListOfShape.hxx>
 #include <TopTools_ListIteratorOfListOfShape.hxx>
 GeomAlgoAPI_MakeShape::GeomAlgoAPI_MakeShape(void* theMkShape)
-  : GeomAPI_Interface(theMkShape)
+  : GeomAPI_Interface(theMkShape),myShape(new GeomAPI_Shape())
+{
+  myShape->setImpl((void *)&implPtr<BRepBuilderAPI_MakeShape>()->Shape());
+}
+
+GeomAlgoAPI_MakeShape::GeomAlgoAPI_MakeShape()
+  : GeomAPI_Interface(),myShape(new GeomAPI_Shape())
 {}
+void GeomAlgoAPI_MakeShape::init(void* theMkShape)
+{
+  setImpl((void *)implPtr<BRepBuilderAPI_MakeShape>());
+}
 
-const boost::shared_ptr<GeomAPI_Shape> GeomAlgoAPI_MakeShape::shape() const
+const std::shared_ptr<GeomAPI_Shape> GeomAlgoAPI_MakeShape::shape() const
 {
   return myShape;
 }
 
 /// Returns the  list   of shapes generated   from the shape <theShape>
 void GeomAlgoAPI_MakeShape::generated(
-  const boost::shared_ptr<GeomAPI_Shape> theShape, ListOfShape& theHistory)
+  const std::shared_ptr<GeomAPI_Shape> theShape, ListOfShape& theHistory)
 {
   BRepBuilderAPI_MakeShape* aBuilder = implPtr<BRepBuilderAPI_MakeShape>();
   if(aBuilder) {
     const TopTools_ListOfShape& aList =  aBuilder->Generated(theShape->impl<TopoDS_Shape>());
     TopTools_ListIteratorOfListOfShape it(aList);
     for(;it.More();it.Next()) {
-      boost::shared_ptr<GeomAPI_Shape> aShape(new GeomAPI_Shape());
-      aShape->setImpl(&(it.Value()));
+      std::shared_ptr<GeomAPI_Shape> aShape(new GeomAPI_Shape());
+      aShape->setImpl(new TopoDS_Shape(it.Value()));
       theHistory.push_back(aShape);
     }
   }
@@ -32,22 +45,22 @@ void GeomAlgoAPI_MakeShape::generated(
 
 /// Returns the  list   of shapes modified   from the shape <theShape>
 void GeomAlgoAPI_MakeShape::modified(
-  const boost::shared_ptr<GeomAPI_Shape> theShape, ListOfShape& theHistory)
+  const std::shared_ptr<GeomAPI_Shape> theShape, ListOfShape& theHistory)
 {
   BRepBuilderAPI_MakeShape* aBuilder = implPtr<BRepBuilderAPI_MakeShape>();
   if(aBuilder) {
     const TopTools_ListOfShape& aList =  aBuilder->Modified(theShape->impl<TopoDS_Shape>());
     TopTools_ListIteratorOfListOfShape it(aList);
     for(;it.More();it.Next()) {
-      boost::shared_ptr<GeomAPI_Shape> aShape(new GeomAPI_Shape());
-      aShape->setImpl(&(it.Value()));
+      std::shared_ptr<GeomAPI_Shape> aShape(new GeomAPI_Shape());
+      aShape->setImpl(new TopoDS_Shape(it.Value()));
       theHistory.push_back(aShape);
     }
   }
 }
 
 /// Returns whether the shape is an edge
-bool GeomAlgoAPI_MakeShape::isDeleted(const boost::shared_ptr<GeomAPI_Shape> theShape)
+bool GeomAlgoAPI_MakeShape::isDeleted(const std::shared_ptr<GeomAPI_Shape> theShape)
 {
   bool isDeleted(false);
   BRepBuilderAPI_MakeShape* aBuilder = implPtr<BRepBuilderAPI_MakeShape>();