]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/GeomAlgoAPI/GeomAlgoAPI_Revolution.h
Salome HOME
Add tools
[modules/shaper.git] / src / GeomAlgoAPI / GeomAlgoAPI_Revolution.h
index a6df8b5aaccc023c3b7b4042505079676e539909..2484fcee19a99412529d2892760c7a1be107f506 100644 (file)
@@ -32,20 +32,31 @@ 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] theAxis axis for revolution.
+   *  \param[in] theToAngle to angle.
+   *  \param[in] theFromAngle from angle.
+   */
+  GEOMALGOAPI_EXPORT GeomAlgoAPI_Revolution(std::shared_ptr<GeomAPI_Shape> theBasis,
+                                            std::shared_ptr<GeomAPI_Ax1>   theAxis,
+                                            double                         theToAngle,
+                                            double                         theFromAngle);
+
+  /** \brief Creates revolution for the given shape.
+   *  \param[in] theBasis face for revolution.
+   *  \param[in] theAxis axis for revolution.
+   *  \param[in] theToShape to bounding shape. Can be empty. In this case offset will be applied to the basis.
+   *  \param[in] theToAngle to angle.
+   *  \param[in] theFromShape from bounding shape. Can be empty. In this case offset will be applied to the basis.
+   *  \param[in] theFromAngle from angle.
    */
   GEOMALGOAPI_EXPORT GeomAlgoAPI_Revolution(std::shared_ptr<GeomAPI_Shape> theBasis,
                                             std::shared_ptr<GeomAPI_Ax1>   theAxis,
-                                            std::shared_ptr<GeomAPI_Shape> theFromShape,
-                                            double                         theFromAngle,
                                             std::shared_ptr<GeomAPI_Shape> theToShape,
-                                            double                         theToAngle);
+                                            double                         theToAngle,
+                                            std::shared_ptr<GeomAPI_Shape> theFromShape,
+                                            double                         theFromAngle);
 
   /// \return true if algorithm succeed.
   GEOMALGOAPI_EXPORT const bool isDone() const;
@@ -59,20 +70,17 @@ public:
   /// \return result of the Revolution algorithm.
   GEOMALGOAPI_EXPORT const std::shared_ptr<GeomAPI_Shape>& shape() const;
 
-  /// \return the first shape.
-  GEOMALGOAPI_EXPORT const std::shared_ptr<GeomAPI_Shape>& firstShape();
+  /// \returns the list of from faces.
+  GEOMALGOAPI_EXPORT const ListOfShape& fromFaces() const;
 
-  /// \return the last shape.
-  GEOMALGOAPI_EXPORT const std::shared_ptr<GeomAPI_Shape>& lastShape();
+  /// \return the list of to faces.
+  GEOMALGOAPI_EXPORT const ListOfShape& toFaces() const;
  
   /// \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
@@ -83,8 +91,8 @@ private:
    */
   TopoDS_Face makeFaceFromPlane(gp_Pln& thePlane, const gp_Pnt& thePoint);
 
-  /// \return solid created from face.
-  TopoDS_Solid makeSolidFromFace(const TopoDS_Face& theFace);
+  /// \return solid created from face or shell.
+  TopoDS_Solid makeSolidFromShape(const TopoDS_Shape& theShape);
 
   /** \brief Selects solid from theShape with closest center of mass to thePoint
    *  \param[in] theShape compound with solids.
@@ -94,21 +102,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>& theToShape,
+             double                                theToAngle,
+             const std::shared_ptr<GeomAPI_Shape>& theFromShape,
+             double                                theFromAngle);
 
 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;
+  ListOfShape myFromFaces;
+  ListOfShape myToFaces;
+  std::shared_ptr<GeomAPI_DataMapOfShapeShape> myMap;
+  std::shared_ptr<GeomAlgoAPI_MakeShape> myMkShape;
 };
 
 #endif
\ No newline at end of file