X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FGeomAlgoAPI%2FGeomAlgoAPI_Prism.h;h=be17e8b7ad7d843195b2b9bddce00f42fb6fe069;hb=f0cec241aae9ca16d86e166f45cb5c4987d2c792;hp=fde00d55d965ad3c0a5cbfacb611d7becb08cfba;hpb=64e9d01b48f8c4e6e22919ebceeed715d613485e;p=modules%2Fshaper.git diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_Prism.h b/src/GeomAlgoAPI/GeomAlgoAPI_Prism.h index fde00d55d..be17e8b7a 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_Prism.h +++ b/src/GeomAlgoAPI/GeomAlgoAPI_Prism.h @@ -7,71 +7,75 @@ #ifndef GeomAlgoAPI_Prism_H_ #define GeomAlgoAPI_Prism_H_ -#include +#include "GeomAlgoAPI.h" + +#include "GeomAlgoAPI_MakeSweep.h" + +#include #include -#include -#include + #include -/** \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] theToShape top bounding shape; - */ - GEOMALGOAPI_EXPORT GeomAlgoAPI_Prism(std::shared_ptr theBasis, - std::shared_ptr theFromShape, - std::shared_ptr theToShape); - - /// \return true if algorithm succeed. - GEOMALGOAPI_EXPORT const bool isDone() const; - - /// \return true if resulting shape is valid. - GEOMALGOAPI_EXPORT const bool isValid() const; - - /// \return true if resulting shape has volume. - GEOMALGOAPI_EXPORT const bool hasVolume() const; - - /// \return result of the Prism algorithm. - GEOMALGOAPI_EXPORT const std::shared_ptr& shape() const; - - /// \returns the first shape. - GEOMALGOAPI_EXPORT const std::shared_ptr& firstShape(); - - /// \return the last shape. - GEOMALGOAPI_EXPORT const std::shared_ptr& lastShape(); - - /// \return map of sub-shapes of the result. To be used for History keeping. - GEOMALGOAPI_EXPORT void mapOfShapes(GeomAPI_DataMapOfShapeShape& theMap) const; - - /// \return interface for History processing. - GEOMALGOAPI_EXPORT GeomAlgoAPI_MakeShape* makeShape() const; - - /// Destructor. - GEOMALGOAPI_EXPORT ~GeomAlgoAPI_Prism(); + /// \brief Creates extrusion for the given shape along the normal for this shape. + /// \param[in] theBaseShape planar face or wire to be extruded. + /// \param[in] theToSize offset for "to" plane. + /// \param[in] theFromSize offset for "from" plane. + GEOMALGOAPI_EXPORT GeomAlgoAPI_Prism(const GeomShapePtr theBaseShape, + const double theToSize, + const double theFromSize); + + /// \brief Creates extrusion for the given shape along the normal for this shape. + /// \param[in] theBaseShape vertex, edge, wire, face or shell. + /// \param[in] theDirection direction of extrusion. Can be empty if theBaseShape is planar wire or face. + /// \param[in] theToSize offset for "to" plane. + /// \param[in] theFromSize offset for "from" plane. + GEOMALGOAPI_EXPORT GeomAlgoAPI_Prism(const GeomShapePtr theBaseShape, + const std::shared_ptr theDirection, + const double theToSize, + const double theFromSize); + + /// \brief Creates extrusion for the given shape along the normal for this shape. + /// \param[in] theBaseShape planar 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(const GeomShapePtr theBaseShape, + const GeomShapePtr theToShape, + const double theToSize, + const GeomShapePtr theFromShape, + const double theFromSize); + + /// \brief Creates extrusion for the given shape along the normal for this shape. + /// \param[in] theBaseShape planar face or wire to be extruded. + /// \param[in] theDirection direction of extrusion. Can be empty if theBaseShape is planar wire or face. + /// \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(const GeomShapePtr theBaseShape, + const std::shared_ptr theDirection, + const GeomShapePtr theToShape, + const double theToSize, + const GeomShapePtr theFromShape, + const double theFromSize); private: /// Builds resulting shape. - void build(const std::shared_ptr& theBasis); - -private: - /// Fields. - std::shared_ptr myFromShape; - std::shared_ptr myToShape; - bool myDone; - std::shared_ptr myShape; - std::shared_ptr myFirst; - std::shared_ptr myLast; - GeomAPI_DataMapOfShapeShape myMap; - GeomAlgoAPI_MakeShape* myMkShape; + void build(const GeomShapePtr& theBaseShape, + const std::shared_ptr theDirection, + const GeomShapePtr& theToShape, + const double theToSize, + const GeomShapePtr& theFromShape, + const double theFromSize); }; #endif