]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/GeomAlgoAPI/GeomAlgoAPI_Rotation.cpp
Salome HOME
Compsolids in boolean operations
[modules/shaper.git] / src / GeomAlgoAPI / GeomAlgoAPI_Rotation.cpp
index 3b24af85bb92f9399f6c5f0492eaac967f980aa9..0ecd76ecc0c14b9c3172600eef44a8913540b805 100644 (file)
@@ -18,10 +18,7 @@ GeomAlgoAPI_Rotation::GeomAlgoAPI_Rotation(std::shared_ptr<GeomAPI_Shape> theSou
                                            std::shared_ptr<GeomAPI_Ax1>   theAxis,
                                            double                         theAngle,
                                            bool theSimpleTransform)
-: myDone(false),
-  myShape(new GeomAPI_Shape()),
-  myMap(new GeomAPI_DataMapOfShapeShape()),
-  myMkShape(new GeomAlgoAPI_MakeShape())
+: myDone(false)
 {
   build(theSourceShape, theAxis, theAngle, theSimpleTransform);
 }
@@ -59,6 +56,7 @@ void GeomAlgoAPI_Rotation::build(std::shared_ptr<GeomAPI_Shape> theSourceShape,
     if(!aBuilder) {
       return;
     }
+    myMkShape.reset(new GeomAlgoAPI_MakeShape(aBuilder));
 
     myDone = aBuilder->IsDone() == Standard_True;
 
@@ -68,14 +66,15 @@ void GeomAlgoAPI_Rotation::build(std::shared_ptr<GeomAPI_Shape> theSourceShape,
 
     aResult = aBuilder->Shape();
     // Fill data map to keep correct orientation of sub-shapes.
+    myMap.reset(new GeomAPI_DataMapOfShapeShape());
     for(TopExp_Explorer anExp(aResult, TopAbs_FACE); anExp.More(); anExp.Next()) {
       std::shared_ptr<GeomAPI_Shape> aCurrentShape(new GeomAPI_Shape());
       aCurrentShape->setImpl(new TopoDS_Shape(anExp.Current()));
       myMap->bind(aCurrentShape, aCurrentShape);
     }
-    myMkShape->setImpl(aBuilder);
   }
 
+  myShape.reset(new GeomAPI_Shape());
   myShape->setImpl(new TopoDS_Shape(aResult));
 }