X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FGeomAlgoAPI%2FGeomAlgoAPI_Prism.h;h=0309004ed20f3d981e019354900f2f419cba7d26;hb=a55586483e5dccc5466d6ec241e2147e210d839f;hp=cb0747181f34d74fad2cb08c539d55c8ba4efe5b;hpb=65bd7c71b6eda2cad73adcc3be6c6ad725c26b94;p=modules%2Fshaper.git diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_Prism.h b/src/GeomAlgoAPI/GeomAlgoAPI_Prism.h index cb0747181..0309004ed 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_Prism.h +++ b/src/GeomAlgoAPI/GeomAlgoAPI_Prism.h @@ -1,89 +1,101 @@ -// Copyright (C) 2014-20xx CEA/DEN, EDF R&D - -// File: GeomAlgoAPI_Prism.h -// Created: 5 May 2015 -// Author: Dmitry Bobylev +// Copyright (C) 2014-2017 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or +// email : webmaster.salome@opencascade.com +// #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] theToSize offset for "to" plane. - * \param[in] theFromSize offset for "from" plane. - */ - GEOMALGOAPI_EXPORT GeomAlgoAPI_Prism(std::shared_ptr theBasis, - double theToSize, - double theFromSize); - - /** \brief Creates extrusion for the given shape along the normal for this shape. - * \param[in] theBasis 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 theBasis, - std::shared_ptr theToShape, - double theToSize, - std::shared_ptr theFromShape, - double theFromSize); - - /// \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 shape() const; - - /// \returns the list of from faces. - GEOMALGOAPI_EXPORT const ListOfShape& fromFaces() const; - - /// \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 std::shared_ptr mapOfShapes() const; - - /// \return interface for History processing. - GEOMALGOAPI_EXPORT std::shared_ptr makeShape() const; + /// \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, - const std::shared_ptr& theToShape, - double theToSize, - const std::shared_ptr& theFromShape, - double theFromSize); - -private: - /// Fields. - bool myDone; - std::shared_ptr myShape; - ListOfShape myFromFaces; - ListOfShape myToFaces; - std::shared_ptr myMap; - std::shared_ptr myMkShape; + void build(const GeomShapePtr& theBaseShape, + const std::shared_ptr theDirection, + const GeomShapePtr& theToShape, + const double theToSize, + const GeomShapePtr& theFromShape, + const double theFromSize); }; #endif