]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/GeomAlgoAPI/GeomAlgoAPI_Partition.cpp
Salome HOME
Compsolids in boolean operations
[modules/shaper.git] / src / GeomAlgoAPI / GeomAlgoAPI_Partition.cpp
index 05bc5d2f4749c7b4322ef68496966bb4dd22ed96..512ac28c6d5620e2dadda12f183db3c4a0168c84 100644 (file)
@@ -28,10 +28,7 @@ std::shared_ptr<GeomAPI_Shape> GeomAlgoAPI_Partition::make(const ListOfShape& th
 //=================================================================================================
 GeomAlgoAPI_Partition::GeomAlgoAPI_Partition(const ListOfShape& theObjects,
                                              const ListOfShape& theTools)
-: myDone(false),
-  myShape(new GeomAPI_Shape()),
-  myMap(new GeomAPI_DataMapOfShapeShape()),
-  myMkShape(new GeomAlgoAPI_MakeShape())
+: myDone(false)
 {
   build(theObjects, theTools);
 }
@@ -46,8 +43,8 @@ void GeomAlgoAPI_Partition::build(const ListOfShape& theObjects,
   }
 
   // Creating partition operation.
-  GEOMAlgo_Splitter * anOperation = new GEOMAlgo_Splitter;
-  myMkShape->setImpl(anOperation);
+  GEOMAlgo_Splitter* anOperation = new GEOMAlgo_Splitter;
+  myMkShape.reset(new GeomAlgoAPI_MakeShape(anOperation, GeomAlgoAPI_MakeShape::BOPAlgoBuilder));
 
   // Getting objects.
   TopTools_ListOfShape anObjects;
@@ -76,11 +73,13 @@ void GeomAlgoAPI_Partition::build(const ListOfShape& theObjects,
   }
 
   // fill data map to keep correct orientation of sub-shapes
+  myMap.reset(new GeomAPI_DataMapOfShapeShape());
   for (TopExp_Explorer Exp(aResult,TopAbs_FACE); Exp.More(); Exp.Next()) {
     std::shared_ptr<GeomAPI_Shape> aCurrentShape(new GeomAPI_Shape());
     aCurrentShape->setImpl(new TopoDS_Shape(Exp.Current()));
     myMap->bind(aCurrentShape, aCurrentShape);
   }
+  myShape.reset(new GeomAPI_Shape());
   myShape->setImpl(new TopoDS_Shape(aResult));
 
 }