Salome HOME
GeomAlgoAPI_Prism now derived from GeomAlgoAPI_MakeSweep
[modules/shaper.git] / src / GeomAlgoAPI / GeomAlgoAPI_Prism.h
index 2631e4bc276b385d614ac6c94fe3dce8474d4a3c..f286e6970ebcedbfc9f66d9af11289748a1db3ea 100644 (file)
@@ -9,72 +9,45 @@
 
 #include <GeomAlgoAPI.h>
 #include <GeomAPI_Shape.h>
-#include <GeomAlgoAPI_MakeShape.h>
-#include <GeomAPI_DataMapOfShapeShape.h>
+#include <GeomAlgoAPI_MakeSweep.h>
+
 #include <memory>
 
-/** \class GeomAlgoAPI_Prism
- *  \ingroup DataAlgo
- *  \brief Allows to create the prism based on a given face and bounding planes.
- *  \n Note that only planar faces are allowed as bounding faces and resulting
- *  extrusion will be bounded by the infinite planes taken from the faces.
- */
-class GeomAlgoAPI_Prism : public GeomAPI_Interface
+/// \class GeomAlgoAPI_Prism
+/// \ingroup DataAlgo
+/// \brief Allows to create the prism based on a given face and bounding planes.
+/// \n Note that only planar faces are allowed as bounding faces and resulting
+/// extrusion will be bounded by the infinite planes taken from the faces.
+class GeomAlgoAPI_Prism : public GeomAlgoAPI_MakeSweep
 {
 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] theFromDistance offset for "from" plane.
-   *  \param[in] theToShape top bounding shape.
-   *  \param[in] theToDistance offset for "to" plane.
-   */
-  GEOMALGOAPI_EXPORT GeomAlgoAPI_Prism(const std::shared_ptr<GeomAPI_Shape>& theBasis,
-                                       const std::shared_ptr<GeomAPI_Shape>& theFromShape,
-                                       double               theFromDistance,
-                                       const std::shared_ptr<GeomAPI_Shape>& theToShape,
-                                       double               theToDistance);
-
-  /// \return true if algorithm succeed.
-  GEOMALGOAPI_EXPORT bool isDone() const;
-
-  /// \return true if resulting shape is valid.
-  GEOMALGOAPI_EXPORT bool isValid() const;
-
-  /// \return true if resulting shape has volume.
-  GEOMALGOAPI_EXPORT bool hasVolume() const;
-
-  /// \return result of the Prism algorithm.
-  GEOMALGOAPI_EXPORT std::shared_ptr<GeomAPI_Shape> shape() const;
-
-  /// \returns the first shape.
-  GEOMALGOAPI_EXPORT std::shared_ptr<GeomAPI_Shape> firstShape() const;
-
-  /// \return the last shape.
-  GEOMALGOAPI_EXPORT std::shared_ptr<GeomAPI_Shape> lastShape() const;
-
-  /// \return map of sub-shapes of the result. To be used for History keeping.
-  GEOMALGOAPI_EXPORT std::shared_ptr<GeomAPI_DataMapOfShapeShape> mapOfShapes() const;
-
-  /// \return interface for History processing.
-  GEOMALGOAPI_EXPORT std::shared_ptr<GeomAlgoAPI_MakeShape> makeShape() const;
+  /// \brief Creates extrusion for the given shape along the normal for this shape.
+  /// \param[in] theBaseShape face or wire to be extruded.
+  /// \param[in] theToSize offset for "to" plane.
+  /// \param[in] theFromSize offset for "from" plane.
+  GEOMALGOAPI_EXPORT GeomAlgoAPI_Prism(std::shared_ptr<GeomAPI_Shape> theBaseShape,
+                                       double                         theToSize,
+                                       double                         theFromSize);
+
+  /// \brief Creates extrusion for the given shape along the normal for this shape.
+  /// \param[in] theBaseShape face or wire to be extruded.
+  /// \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.
+  /// \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.
+  GEOMALGOAPI_EXPORT GeomAlgoAPI_Prism(std::shared_ptr<GeomAPI_Shape> theBaseShape,
+                                       std::shared_ptr<GeomAPI_Shape> theToShape,
+                                       double                         theToSize,
+                                       std::shared_ptr<GeomAPI_Shape> theFromShape,
+                                       double                         theFromSize);
 
 private:
   /// Builds resulting shape.
-  void build(const std::shared_ptr<GeomAPI_Shape>& theBasis,
-             const std::shared_ptr<GeomAPI_Shape>& theFromShape,
-             double               theFromDistance,
+  void build(const std::shared_ptr<GeomAPI_Shape>& theBaseShape,
              const std::shared_ptr<GeomAPI_Shape>& theToShape,
-             double               theToDistance);
-
-private:
-  /// Fields.
-  bool myDone;
-  std::shared_ptr<GeomAPI_Shape> myShape;
-  std::shared_ptr<GeomAPI_Shape> myFirst;
-  std::shared_ptr<GeomAPI_Shape> myLast;
-  std::shared_ptr<GeomAPI_DataMapOfShapeShape> myMap;
-  std::shared_ptr<GeomAlgoAPI_MakeShape> myMkShape;
+             double                                theToSize,
+             const std::shared_ptr<GeomAPI_Shape>& theFromShape,
+             double                                theFromSize);
 };
 
 #endif