X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FGeomAlgoAPI%2FGeomAlgoAPI_Prism.h;h=f286e6970ebcedbfc9f66d9af11289748a1db3ea;hb=4d6bb9de0e54f09a9bbacc94a058cb7cd437d535;hp=a795e90e7b7f51553a67dcc32029d8e172be72ed;hpb=8a502374084b1bd206a86ef4c42797fb994d8b55;p=modules%2Fshaper.git diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_Prism.h b/src/GeomAlgoAPI/GeomAlgoAPI_Prism.h index a795e90e7..f286e6970 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_Prism.h +++ b/src/GeomAlgoAPI/GeomAlgoAPI_Prism.h @@ -9,67 +9,45 @@ #include #include -#include -#include -#include +#include -/**\class GeomAlgoAPI_Prism - * \ingroup DataAlgo - * \brief Allows to create the prism based on a given face and bounding planes - */ +#include -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 - * \return a solid or a face/shell which is obtained from specified one - */ - /// Constructor - GEOMALGOAPI_EXPORT GeomAlgoAPI_Prism(std::shared_ptr theBasis, + /// \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 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 theBaseShape, + std::shared_ptr theToShape, + double theToSize, std::shared_ptr theFromShape, - std::shared_ptr theToShape); - - /// Returns True if algorithm succeed - GEOMALGOAPI_EXPORT const bool isDone() const; - - /// Returns True if resulting shape is valid - GEOMALGOAPI_EXPORT const bool isValid() const; - - /// Returns True if resulting shape has volume - GEOMALGOAPI_EXPORT const bool hasVolume() const; - - /// Returns result of the Prism algorithm which may be a Solid or a Face - GEOMALGOAPI_EXPORT const std::shared_ptr& shape() const; - - /// Returns the first shape - GEOMALGOAPI_EXPORT const std::shared_ptr& firstShape(); - - /// returns last shape - GEOMALGOAPI_EXPORT const std::shared_ptr& lastShape(); - - /// Returns map of sub-shapes of the result. To be used for History keeping - GEOMALGOAPI_EXPORT void mapOfShapes(GeomAPI_DataMapOfShapeShape& theMap) const; - - /// Return interface for for History processing - GEOMALGOAPI_EXPORT GeomAlgoAPI_MakeShape* makeShape() const; + double theFromSize); - /// Destructor - GEOMALGOAPI_EXPORT ~GeomAlgoAPI_Prism(); private: - /// builds resulting shape - void build(const std::shared_ptr& theBasis); - /// 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; + /// Builds resulting shape. + void build(const std::shared_ptr& theBaseShape, + const std::shared_ptr& theToShape, + double theToSize, + const std::shared_ptr& theFromShape, + double theFromSize); }; #endif