]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Improvement #635: Move maximum functionality to API class
authordbv <dbv@opencascade.com>
Mon, 22 Jun 2015 13:32:40 +0000 (16:32 +0300)
committerdbv <dbv@opencascade.com>
Tue, 23 Jun 2015 09:54:17 +0000 (12:54 +0300)
src/FeaturesPlugin/FeaturesPlugin_Extrusion.cpp
src/FeaturesPlugin/FeaturesPlugin_Revolution.cpp
src/GeomAlgoAPI/GeomAlgoAPI_MakeShape.cpp
src/GeomAlgoAPI/GeomAlgoAPI_Prism.cpp
src/GeomAlgoAPI/GeomAlgoAPI_Prism.h
src/GeomAlgoAPI/GeomAlgoAPI_Revolution.cpp
src/GeomAlgoAPI/GeomAlgoAPI_Revolution.h

index 0e2dc5079a636b16ae005c45a5bc74e5ffb9febe..4a3e69108abd64ad1b708626cd5dc9059a5f3479 100644 (file)
@@ -159,7 +159,7 @@ void FeaturesPlugin_Extrusion::LoadNamingDS(GeomAlgoAPI_Prism& theFeature,
 
   //Insert lateral face : Face from Edge
   std::string aLatName = "LateralFace";
-  theResultBody->loadAndOrientGeneratedShapes(theFeature.makeShape().get(), theBasis, EDGE,_LATERAL_TAG, aLatName, *aSubShapes.get());
+  theResultBody->loadAndOrientGeneratedShapes(theFeature.makeShape().get(), theBasis, EDGE,_LATERAL_TAG, aLatName, *aSubShapes);
 
   //Insert bottom face
   std::string aBotName = "BottomFace";
index 8f34e2f5657ea0ca48b7cab1bfb85430c98a1ed7..21aab45135e1d8c29ba74dff3573880bedd6a96e 100644 (file)
@@ -165,11 +165,10 @@ void FeaturesPlugin_Revolution::LoadNamingDS(GeomAlgoAPI_Revolution& theFeature,
   else
     theResultBody->storeGenerated(theContext, theFeature.shape());
 
-  GeomAPI_DataMapOfShapeShape* aSubShapes = new GeomAPI_DataMapOfShapeShape();
-  theFeature.mapOfShapes(*aSubShapes);
+  std::shared_ptr<GeomAPI_DataMapOfShapeShape> aSubShapes = theFeature.mapOfShapes();
 
   std::string aGeneratedName = "LateralFace";
-  theResultBody->loadAndOrientGeneratedShapes(theFeature.makeShape(), theBasis, EDGE,_LATERAL_TAG, aGeneratedName, *aSubShapes);
+  theResultBody->loadAndOrientGeneratedShapes(theFeature.makeShape().get(), theBasis, EDGE,_LATERAL_TAG, aGeneratedName, *aSubShapes);
 
   //Insert from face
   std::string aBotName = "FromFace";
index b0c7be684cce7a4182ff4adbdd07a2f955b3ac06..22bde17c0ada382ba535d43dd829125f31331e69 100644 (file)
@@ -11,7 +11,7 @@
 GeomAlgoAPI_MakeShape::GeomAlgoAPI_MakeShape(void* theMkShape)
   : GeomAPI_Interface(theMkShape),myShape(new GeomAPI_Shape())
 {
-  myShape->setImpl((void *)&implPtr<BRepBuilderAPI_MakeShape>()->Shape());
+  myShape->setImpl(new TopoDS_Shape(implPtr<BRepBuilderAPI_MakeShape>()->Shape()));
 }
 
 GeomAlgoAPI_MakeShape::GeomAlgoAPI_MakeShape()
index 9dbdb045c6404fb69f187df6784692661bf7c8cd..6d36708b4c699a6cfcbd55349ba7877b570eef1b 100644 (file)
 #include <TopoDS.hxx>
 
 //=================================================================================================
-GeomAlgoAPI_Prism::GeomAlgoAPI_Prism(const std::shared_ptr<GeomAPI_Shape>& theBasis,
-                                     const std::shared_ptr<GeomAPI_Shape>& theFromShape,
-                                     double                                theFromSize,
-                                     const std::shared_ptr<GeomAPI_Shape>& theToShape,
-                                     double                                theToSize)
+GeomAlgoAPI_Prism::GeomAlgoAPI_Prism(std::shared_ptr<GeomAPI_Shape> theBasis,
+                                     double                         theFromSize,
+                                     double                         theToSize)
+: myDone(false)
+{
+  build(theBasis, std::shared_ptr<GeomAPI_Shape>(), theFromSize, std::shared_ptr<GeomAPI_Shape>(), theToSize);
+}
+
+//=================================================================================================
+GeomAlgoAPI_Prism::GeomAlgoAPI_Prism(std::shared_ptr<GeomAPI_Shape> theBasis,
+                                     std::shared_ptr<GeomAPI_Shape> theFromShape,
+                                     double                         theFromSize,
+                                     std::shared_ptr<GeomAPI_Shape> theToShape,
+                                     double                         theToSize)
 : myDone(false)
 {
   build(theBasis, theFromShape, theFromSize, theToShape, theToSize);
@@ -114,7 +123,7 @@ void GeomAlgoAPI_Prism::build(const std::shared_ptr<GeomAPI_Shape>& theBasis,
       myFirst->setImpl(new TopoDS_Shape(aBuilder->Modified(aFromShape).First()));
       myLast = std::make_shared<GeomAPI_Shape>();
       myLast->setImpl(new TopoDS_Shape(aBuilder->Modified(aToShape).First()));
-      myMkShape = std::shared_ptr<GeomAlgoAPI_MakeShape>(new GeomAlgoAPI_MakeShape());
+      myMkShape = std::make_shared<GeomAlgoAPI_MakeShape>();
       myMkShape->setImpl(aBuilder);
     }
   }
index 91096aa88ff0bff3dae3f83b6e010437ef93c89c..642ff9b305f064acd07f01a3cf67724506a1ca2a 100644 (file)
@@ -24,16 +24,25 @@ class GeomAlgoAPI_Prism : public GeomAPI_Interface
 public:
   /** \brief Creates extrusion for the given shape along the normal for this shape.
    *  \param[in] theBasis face or wire to be extruded.
-   *  \param[in] theFromShape bottom bounding shape.
    *  \param[in] theFromSize offset for "from" plane.
-   *  \param[in] theToShape top bounding shape.
    *  \param[in] theToSize offset for "to" plane.
    */
-  GEOMALGOAPI_EXPORT GeomAlgoAPI_Prism(const std::shared_ptr<GeomAPI_Shape>& theBasis,
-                                       const std::shared_ptr<GeomAPI_Shape>& theFromShape,
-                                       double                                theFromSize,
-                                       const std::shared_ptr<GeomAPI_Shape>& theToShape,
-                                       double                                theToSize);
+  GEOMALGOAPI_EXPORT GeomAlgoAPI_Prism(std::shared_ptr<GeomAPI_Shape> theBasis,
+                                       double                         theFromSize,
+                                       double                         theToSize);
+
+  /** \brief Creates extrusion for the given shape along the normal for this shape.
+   *  \param[in] theBasis face or wire to be extruded.
+   *  \param[in] theFromShape bottom bounding shape. Can be empty. In this case offset will be applied to the basis.
+   *  \param[in] theFromSize offset for "from" plane.
+   *  \param[in] theToShape top bounding shape.  Can be empty. In this case offset will be applied to the basis.
+   *  \param[in] theToSize offset for "to" plane.
+   */
+  GEOMALGOAPI_EXPORT GeomAlgoAPI_Prism(std::shared_ptr<GeomAPI_Shape> theBasis,
+                                       std::shared_ptr<GeomAPI_Shape> theFromShape,
+                                       double                         theFromSize,
+                                       std::shared_ptr<GeomAPI_Shape> theToShape,
+                                       double                         theToSize);
 
   /// \return true if algorithm succeed.
   GEOMALGOAPI_EXPORT bool isDone() const;
index f2377dd32cdb133408b72bef37bf095310f44f53..295886fbda7e802c6518b9cf5dcf0016ae3431ef 100644 (file)
 #include <TopExp_Explorer.hxx>
 #include <TopoDS.hxx>
 
+//=================================================================================================
+GeomAlgoAPI_Revolution::GeomAlgoAPI_Revolution(std::shared_ptr<GeomAPI_Shape> theBasis,
+                                               std::shared_ptr<GeomAPI_Ax1>   theAxis,
+                                               double                         theFromAngle,
+                                               double                         theToAngle)
+: myDone(false)
+{
+  build(theBasis, theAxis, std::shared_ptr<GeomAPI_Shape>(), theFromAngle, std::shared_ptr<GeomAPI_Shape>(), theToAngle);
+}
+
 //=================================================================================================
 GeomAlgoAPI_Revolution::GeomAlgoAPI_Revolution(std::shared_ptr<GeomAPI_Shape> theBasis,
                                                std::shared_ptr<GeomAPI_Ax1>   theAxis,
@@ -34,16 +44,9 @@ GeomAlgoAPI_Revolution::GeomAlgoAPI_Revolution(std::shared_ptr<GeomAPI_Shape> th
                                                double                         theFromAngle,
                                                std::shared_ptr<GeomAPI_Shape> theToShape,
                                                double                         theToAngle)
-: myAxis(theAxis),
-  myFromShape(theFromShape),
-  myFromAngle(theFromAngle),
-  myToShape(theToShape),
-  myToAngle(theToAngle),
-  myDone(false),
-  myShape(new GeomAPI_Shape()),
-  myFirst(new GeomAPI_Shape()),myLast(new GeomAPI_Shape())
+: myDone(false)
 {
-  build(theBasis);
+  build(theBasis, theAxis, theFromShape, theFromAngle, theToShape, theToAngle);
 }
 
 //=================================================================================================
@@ -102,11 +105,16 @@ TopoDS_Shape GeomAlgoAPI_Revolution::findClosest(const TopoDS_Shape& theShape, c
 }
 
 //=================================================================================================
-void GeomAlgoAPI_Revolution::build(const std::shared_ptr<GeomAPI_Shape>& theBasis)
+void GeomAlgoAPI_Revolution::build(const std::shared_ptr<GeomAPI_Shape>& theBasis,
+                                   const std::shared_ptr<GeomAPI_Ax1>&   theAxis,
+                                   const std::shared_ptr<GeomAPI_Shape>& theFromShape,
+                                   double                                theFromAngle,
+                                   const std::shared_ptr<GeomAPI_Shape>& theToShape,
+                                   double                                theToAngle)
 {
-  if(!theBasis || !myAxis ||
-    (((!myFromShape && !myToShape) || (myFromShape && myToShape && myFromShape->isEqual(myToShape)))
-    && (myFromAngle == 0.0 && myToAngle == 0.0))) {
+  if(!theBasis || !theAxis ||
+    (((!theFromShape && !theToShape) || (theFromShape && theToShape && theFromShape->isEqual(theToShape)))
+    && (theFromAngle == 0.0 && theToAngle == 0.0))) {
     return;
   }
 
@@ -116,23 +124,25 @@ void GeomAlgoAPI_Revolution::build(const std::shared_ptr<GeomAPI_Shape>& theBasi
     return;
   }
   gp_Pln aBasisPln = isBasisPlanar.Plan();
-  gp_Ax1 anAxis = myAxis->impl<gp_Ax1>();
+  gp_Ax1 anAxis = theAxis->impl<gp_Ax1>();
 
   ListOfMakeShape aListOfMakeShape;
+  myFirst = std::make_shared<GeomAPI_Shape>();
+  myLast = std::make_shared<GeomAPI_Shape>();
 
   TopoDS_Shape aResult;
-  if(!myFromShape && !myToShape) { // Case 1: When only angles was set.
+  if(!theFromShape && !theToShape) { // Case 1: When only angles was set.
     // Rotating base face with the negative value of "from angle".
     gp_Trsf aBaseTrsf;
-    aBaseTrsf.SetRotation(anAxis, -myFromAngle / 180.0 * M_PI);
+    aBaseTrsf.SetRotation(anAxis, -theFromAngle / 180.0 * M_PI);
     BRepBuilderAPI_Transform* aBaseTransform = new BRepBuilderAPI_Transform(aBasisFace,
                                                                             aBaseTrsf,
                                                                             true);
-    aListOfMakeShape.push_back(std::shared_ptr<GeomAlgoAPI_MakeShape>(new GeomAlgoAPI_MakeShape(aBaseTransform)));
+    aListOfMakeShape.push_back(std::make_shared<GeomAlgoAPI_MakeShape>(aBaseTransform));
     TopoDS_Shape aRotatedBaseShape = aBaseTransform->Shape();
 
     // Making revolution to the angle equal to the sum of "from angle" and "to angle".
-    double anAngle = myFromAngle + myToAngle;
+    double anAngle = theFromAngle + theToAngle;
     BRepPrimAPI_MakeRevol* aRevolBuilder = new BRepPrimAPI_MakeRevol(aRotatedBaseShape,
                                                                      anAxis,
                                                                      anAngle / 180 * M_PI,
@@ -141,16 +151,16 @@ void GeomAlgoAPI_Revolution::build(const std::shared_ptr<GeomAPI_Shape>& theBasi
     if(!aRevolBuilder->IsDone()) {
       return;
     }
-    aListOfMakeShape.push_back(std::shared_ptr<GeomAlgoAPI_MakeShape>(new GeomAlgoAPI_MakeShape(aRevolBuilder)));
+    aListOfMakeShape.push_back(std::make_shared<GeomAlgoAPI_MakeShape>(aRevolBuilder));
     aResult = aRevolBuilder->Shape();
 
     // Setting naming.
     myFirst->setImpl(new TopoDS_Shape(aRevolBuilder->FirstShape()));
     myLast->setImpl(new TopoDS_Shape(aRevolBuilder->LastShape()));
-  } else if(myFromShape && myToShape) { // Case 2: When both bounding planes were set.
+  } else if(theFromShape && theToShape) { // Case 2: When both bounding planes were set.
     // Getting bounding faces.
-    TopoDS_Face aFromFace = TopoDS::Face(myFromShape->impl<TopoDS_Shape>());
-    TopoDS_Face aToFace   = TopoDS::Face(myToShape->impl<TopoDS_Shape>());
+    TopoDS_Face aFromFace = TopoDS::Face(theFromShape->impl<TopoDS_Shape>());
+    TopoDS_Face aToFace   = TopoDS::Face(theToShape->impl<TopoDS_Shape>());
 
     // Getting planes from bounding face.
     GeomLib_IsPlanarSurface isFromPlanar(BRep_Tool::Surface(aFromFace));
@@ -174,8 +184,8 @@ void GeomAlgoAPI_Revolution::build(const std::shared_ptr<GeomAPI_Shape>& theBasi
     // Rotating bounding planes to the specified angle.
     gp_Trsf aFromTrsf;
     gp_Trsf aToTrsf;
-    double aFromRotAngle = ((aFromPln.Axis().Direction() * aBasisPln.Axis().Direction()) > 0) ? -myFromAngle : myFromAngle;
-    double aToRotAngle = ((aToPln.Axis().Direction() * aBasisPln.Axis().Direction()) > 0) ? -myToAngle : myToAngle;
+    double aFromRotAngle = ((aFromPln.Axis().Direction() * aBasisPln.Axis().Direction()) > 0) ? -theFromAngle : theFromAngle;
+    double aToRotAngle = ((aToPln.Axis().Direction() * aBasisPln.Axis().Direction()) > 0) ? -theToAngle : theToAngle;
     aFromTrsf.SetRotation(anAxis,aFromRotAngle / 180.0 * M_PI);
     aToTrsf.SetRotation(anAxis, aToRotAngle / 180.0 * M_PI);
     BRepBuilderAPI_Transform aFromTransform(aFromSolid, aFromTrsf, true);
@@ -188,7 +198,7 @@ void GeomAlgoAPI_Revolution::build(const std::shared_ptr<GeomAPI_Shape>& theBasi
     // Making revolution to the 360 angle.
     BRepPrimAPI_MakeRevol* aRevolBuilder = new BRepPrimAPI_MakeRevol(aBasisFace, anAxis, 2 * M_PI, Standard_True);
     aRevolBuilder->Build();
-    aListOfMakeShape.push_back(std::shared_ptr<GeomAlgoAPI_MakeShape>(new GeomAlgoAPI_MakeShape(aRevolBuilder)));
+    aListOfMakeShape.push_back(std::make_shared<GeomAlgoAPI_MakeShape>(aRevolBuilder));
     TopoDS_Shape aRevolShape = aRevolBuilder->Shape();
 
     // Cutting revolution with from plane.
@@ -197,7 +207,7 @@ void GeomAlgoAPI_Revolution::build(const std::shared_ptr<GeomAPI_Shape>& theBasi
     if(!aFromCutBuilder->IsDone()) {
       return;
     }
-    aListOfMakeShape.push_back(std::shared_ptr<GeomAlgoAPI_MakeShape>(new GeomAlgoAPI_MakeShape(aFromCutBuilder)));
+    aListOfMakeShape.push_back(std::make_shared<GeomAlgoAPI_MakeShape>(aFromCutBuilder));
     aResult = aFromCutBuilder->Shape();
 
     // Cutting revolution with to plane.
@@ -206,7 +216,7 @@ void GeomAlgoAPI_Revolution::build(const std::shared_ptr<GeomAPI_Shape>& theBasi
     if(!aToCutBuilder->IsDone()) {
       return;
     }
-    aListOfMakeShape.push_back(std::shared_ptr<GeomAlgoAPI_MakeShape>(new GeomAlgoAPI_MakeShape(aToCutBuilder)));
+    aListOfMakeShape.push_back(std::make_shared<GeomAlgoAPI_MakeShape>(aToCutBuilder));
     aResult = aToCutBuilder->Shape();
 
     // If after cut we got more than one solids then take closest to the center of mass of the base face.
@@ -229,11 +239,11 @@ void GeomAlgoAPI_Revolution::build(const std::shared_ptr<GeomAPI_Shape>& theBasi
     // Getting bounding face.
     TopoDS_Face aBoundingFace;
     bool isFromFaceSet = false;
-    if(myFromShape) {
-      aBoundingFace = TopoDS::Face(myFromShape->impl<TopoDS_Shape>());
+    if(theFromShape) {
+      aBoundingFace = TopoDS::Face(theFromShape->impl<TopoDS_Shape>());
       isFromFaceSet = true;
-    } else if(myToShape) {
-      aBoundingFace = TopoDS::Face(myToShape->impl<TopoDS_Shape>());
+    } else if(theToShape) {
+      aBoundingFace = TopoDS::Face(theToShape->impl<TopoDS_Shape>());
     }
 
     // Getting plane from bounding face.
@@ -252,7 +262,7 @@ void GeomAlgoAPI_Revolution::build(const std::shared_ptr<GeomAPI_Shape>& theBasi
     TopoDS_Shape aBoundingSolid = makeSolidFromFace(aBoundingFace);
 
     // Rotating bounding plane to the specified angle.
-    double aBoundingRotAngle = isFromFaceSet ? myFromAngle : myToAngle;
+    double aBoundingRotAngle = isFromFaceSet ? theFromAngle : theToAngle;
     if(aBoundingPln.Axis().IsParallel(aBasisPln.Axis(), Precision::Confusion())) {
       if(isFromFaceSet) aBoundingRotAngle = -aBoundingRotAngle;
     } else {
@@ -271,7 +281,7 @@ void GeomAlgoAPI_Revolution::build(const std::shared_ptr<GeomAPI_Shape>& theBasi
     // Making revolution to the 360 angle.
     BRepPrimAPI_MakeRevol* aRevolBuilder = new BRepPrimAPI_MakeRevol(aBasisFace, anAxis, 2 * M_PI, Standard_True);
     aRevolBuilder->Build();
-    aListOfMakeShape.push_back(std::shared_ptr<GeomAlgoAPI_MakeShape>(new GeomAlgoAPI_MakeShape(aRevolBuilder)));
+    aListOfMakeShape.push_back(std::make_shared<GeomAlgoAPI_MakeShape>(aRevolBuilder));
     TopoDS_Shape aRevolShape = aRevolBuilder->Shape();
 
     // Cutting revolution with bounding plane.
@@ -280,7 +290,7 @@ void GeomAlgoAPI_Revolution::build(const std::shared_ptr<GeomAPI_Shape>& theBasi
     if(!aBoundingCutBuilder->IsDone()) {
       return;
     }
-    aListOfMakeShape.push_back(std::shared_ptr<GeomAlgoAPI_MakeShape>(new GeomAlgoAPI_MakeShape(aBoundingCutBuilder)));
+    aListOfMakeShape.push_back(std::make_shared<GeomAlgoAPI_MakeShape>(aBoundingCutBuilder));
     aResult = aBoundingCutBuilder->Shape();
     TopExp_Explorer anExp1(aResult, TopAbs_SOLID);
 
@@ -300,7 +310,7 @@ void GeomAlgoAPI_Revolution::build(const std::shared_ptr<GeomAPI_Shape>& theBasi
 
     // Rotating basis face to the specified angle.
     gp_Trsf aBasisTrsf;
-    double aBasisRotAngle = isFromFaceSet ? myToAngle : -myFromAngle;
+    double aBasisRotAngle = isFromFaceSet ? theToAngle : -theFromAngle;
     aBasisTrsf.SetRotation(anAxis, aBasisRotAngle / 180.0 * M_PI);
     BRepBuilderAPI_Transform aBasisTransform(aBasisSolid, aBasisTrsf, true);
     TopoDS_Shape aRotatedBasisFace = aBasisTransform.Modified(aBasisFace).First();
@@ -313,7 +323,7 @@ void GeomAlgoAPI_Revolution::build(const std::shared_ptr<GeomAPI_Shape>& theBasi
       TopoDS_Shape aCutResult = aBasisCutBuilder->Shape();
       TopExp_Explorer anExp(aCutResult, TopAbs_SOLID);
       if(anExp.More()) {
-        aListOfMakeShape.push_back(std::shared_ptr<GeomAlgoAPI_MakeShape>(new GeomAlgoAPI_MakeShape(aBasisCutBuilder)));
+        aListOfMakeShape.push_back(std::make_shared<GeomAlgoAPI_MakeShape>(aBasisCutBuilder));
         aResult = aCutResult;
       }
     }
@@ -344,13 +354,15 @@ void GeomAlgoAPI_Revolution::build(const std::shared_ptr<GeomAPI_Shape>& theBasi
   }
 
   // fill data map to keep correct orientation of sub-shapes
+  myMap = std::make_shared<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);
+    myMap->bind(aCurrentShape, aCurrentShape);
   }
+  myShape = std::make_shared<GeomAPI_Shape>();
   myShape->setImpl(new TopoDS_Shape(aResult));
-  myMkShape = new GeomAlgoAPI_MakeShapeList(aListOfMakeShape);
+  myMkShape = std::make_shared<GeomAlgoAPI_MakeShapeList>();
   myDone = true;
   return;
 }
@@ -401,21 +413,13 @@ const std::shared_ptr<GeomAPI_Shape>& GeomAlgoAPI_Revolution::lastShape()
 }
 
 //=================================================================================================
-void GeomAlgoAPI_Revolution::mapOfShapes (GeomAPI_DataMapOfShapeShape& theMap) const
+std::shared_ptr<GeomAPI_DataMapOfShapeShape> GeomAlgoAPI_Revolution::mapOfShapes() const
 {
-  theMap = myMap;
+  return myMap;
 }
 
 //=================================================================================================
-GeomAlgoAPI_MakeShape* GeomAlgoAPI_Revolution::makeShape() const
+std::shared_ptr<GeomAlgoAPI_MakeShape> GeomAlgoAPI_Revolution::makeShape() const
 {
   return myMkShape;
 }
-
-//=================================================================================================
-GeomAlgoAPI_Revolution::~GeomAlgoAPI_Revolution()
-{
-  if (myImpl) {
-    myMap.clear();
-  }
-}
index a6df8b5aaccc023c3b7b4042505079676e539909..a10b093b05f485a2dd36285423150193fe19fa9c 100644 (file)
@@ -32,13 +32,22 @@ class TopoDS_Solid;
 class GeomAlgoAPI_Revolution : public GeomAPI_Interface
 {
 public:
-  /** \brief Creates revolution for the given shape
-   *  \param[in] theBasis face for revolution
-   *  \param[in] theFromShape from bounding shape
-   *  \param[in] theFromAngle from angle
-   *  \param[in] theToShape to bounding shape
-   *  \param[in] theToAngle to angle
-   *  \return a solid which is obtained from specified one
+  /** \brief Creates revolution for the given shape.
+   *  \param[in] theBasis face for revolution.
+   *  \param[in] theFromAngle from angle.
+   *  \param[in] theToAngle to angle.
+   */
+  GEOMALGOAPI_EXPORT GeomAlgoAPI_Revolution(std::shared_ptr<GeomAPI_Shape> theBasis,
+                                            std::shared_ptr<GeomAPI_Ax1>   theAxis,
+                                            double                         theFromAngle,
+                                            double                         theToAngle);
+
+  /** \brief Creates revolution for the given shape.
+   *  \param[in] theBasis face for revolution.
+   *  \param[in] theFromShape from bounding shape. Can be empty. In this case offset will be applied to the basis.
+   *  \param[in] theFromAngle from angle.
+   *  \param[in] theToShape to bounding shape. Can be empty. In this case offset will be applied to the basis.
+   *  \param[in] theToAngle to angle.
    */
   GEOMALGOAPI_EXPORT GeomAlgoAPI_Revolution(std::shared_ptr<GeomAPI_Shape> theBasis,
                                             std::shared_ptr<GeomAPI_Ax1>   theAxis,
@@ -66,13 +75,10 @@ public:
   GEOMALGOAPI_EXPORT const std::shared_ptr<GeomAPI_Shape>& lastShape();
  
   /// \return map of sub-shapes of the result. To be used for History keeping.
-  GEOMALGOAPI_EXPORT void mapOfShapes(GeomAPI_DataMapOfShapeShape& theMap) const;
+  GEOMALGOAPI_EXPORT std::shared_ptr<GeomAPI_DataMapOfShapeShape> mapOfShapes() const;
 
   /// \return interface for History processing.
-  GEOMALGOAPI_EXPORT GeomAlgoAPI_MakeShape* makeShape() const;
-
-  /// Destructor.
-  GEOMALGOAPI_EXPORT ~GeomAlgoAPI_Revolution();
+  GEOMALGOAPI_EXPORT std::shared_ptr<GeomAlgoAPI_MakeShape> makeShape() const;
 
 private:
   /** \brief Constructs infinite face from thePlane, and with axis located on the same side
@@ -94,21 +100,21 @@ private:
   TopoDS_Shape findClosest(const TopoDS_Shape& theShape, const gp_Pnt& thePoint);
 
   /// Builds resulting shape.
-  void build(const std::shared_ptr<GeomAPI_Shape>& theBasis);
+  void build(const std::shared_ptr<GeomAPI_Shape>& theBasis,
+             const std::shared_ptr<GeomAPI_Ax1>&   theAxis,
+             const std::shared_ptr<GeomAPI_Shape>& theFromShape,
+             double                                theFromAngle,
+             const std::shared_ptr<GeomAPI_Shape>& theToShape,
+             double                                theToAngle);
 
 private:
   /// Fields.
-  std::shared_ptr<GeomAPI_Ax1>   myAxis;
-  std::shared_ptr<GeomAPI_Shape> myFromShape;
-  double myFromAngle;
-  std::shared_ptr<GeomAPI_Shape> myToShape;
-  double myToAngle;
   bool myDone;
   std::shared_ptr<GeomAPI_Shape> myShape;
   std::shared_ptr<GeomAPI_Shape> myFirst;
   std::shared_ptr<GeomAPI_Shape> myLast;
-  GeomAPI_DataMapOfShapeShape myMap;
-  GeomAlgoAPI_MakeShape* myMkShape;
+  std::shared_ptr<GeomAPI_DataMapOfShapeShape> myMap;
+  std::shared_ptr<GeomAlgoAPI_MakeShape> myMkShape;
 };
 
 #endif
\ No newline at end of file