]> SALOME platform Git repositories - modules/shaper.git/blob - src/GeomAlgoAPI/GeomAlgoAPI_Prism.h
Salome HOME
7d2d2dbddb6eb6710c7ccee7c1da79d7e1936565
[modules/shaper.git] / src / GeomAlgoAPI / GeomAlgoAPI_Prism.h
1 // Copyright (C) 2014-2019  CEA/DEN, EDF R&D
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19
20 #ifndef GeomAlgoAPI_Prism_H_
21 #define GeomAlgoAPI_Prism_H_
22
23 #include "GeomAlgoAPI.h"
24
25 #include "GeomAlgoAPI_MakeSweep.h"
26
27 #include <GeomAPI_Dir.h>
28 #include <GeomAPI_Shape.h>
29
30 #include <memory>
31
32 /// \class GeomAlgoAPI_Prism
33 /// \ingroup DataAlgo
34 /// \brief Allows to create the prism based on a given face and bounding planes.
35 /// \n Note that only planar faces are allowed as bounding faces and resulting
36 /// extrusion will be bounded by the infinite planes taken from the faces.
37 class GeomAlgoAPI_Prism : public GeomAlgoAPI_MakeSweep
38 {
39 public:
40   /// \brief Creates extrusion for the given shape along the normal for this shape.
41   /// \param[in] theBaseShape planar face or wire to be extruded.
42   /// \param[in] theDirection direction of extrusion.
43   ///                         Can be empty if theBaseShape is planar wire or face.
44   /// \param[in] theToShape top bounding shape. Can be empty.
45   ///                       In this case offset will be applied to the basis.
46   /// \param[in] theToSize offset for "to" plane.
47   /// \param[in] theFromShape bottom bounding shape. Can be empty.
48   ///                         In this case offset will be applied to the basis.
49   /// \param[in] theFromSize offset for "from" plane.
50   GEOMALGOAPI_EXPORT GeomAlgoAPI_Prism(const GeomShapePtr                 theBaseShape,
51                                        const std::shared_ptr<GeomAPI_Dir> theDirection,
52                                        const GeomShapePtr                 theToShape,
53                                        const double                       theToSize,
54                                        const GeomShapePtr                 theFromShape,
55                                        const double                       theFromSize);
56
57 private:
58   /// Builds resulting shape.
59   void build(const GeomShapePtr&                theBaseShape,
60              const std::shared_ptr<GeomAPI_Dir> theDirection,
61              const GeomShapePtr&                theToShape,
62              const double                       theToSize,
63              const GeomShapePtr&                theFromShape,
64              const double                       theFromSize);
65 };
66
67 #endif