1 // Copyright (C) 2014-2017 CEA/DEN, EDF R&D
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.
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.
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
17 // See http://www.salome-platform.org/ or
18 // email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
21 #ifndef GeomAlgoAPI_Prism_H_
22 #define GeomAlgoAPI_Prism_H_
24 #include "GeomAlgoAPI.h"
26 #include "GeomAlgoAPI_MakeSweep.h"
28 #include <GeomAPI_Dir.h>
29 #include <GeomAPI_Shape.h>
33 /// \class GeomAlgoAPI_Prism
35 /// \brief Allows to create the prism based on a given face and bounding planes.
36 /// \n Note that only planar faces are allowed as bounding faces and resulting
37 /// extrusion will be bounded by the infinite planes taken from the faces.
38 class GeomAlgoAPI_Prism : public GeomAlgoAPI_MakeSweep
41 /// \brief Creates extrusion for the given shape along the normal for this shape.
42 /// \param[in] theBaseShape planar face or wire to be extruded.
43 /// \param[in] theToSize offset for "to" plane.
44 /// \param[in] theFromSize offset for "from" plane.
45 GEOMALGOAPI_EXPORT GeomAlgoAPI_Prism(const GeomShapePtr theBaseShape,
46 const double theToSize,
47 const double theFromSize);
49 /// \brief Creates extrusion for the given shape along the normal for this shape.
50 /// \param[in] theBaseShape vertex, edge, wire, face or shell.
51 /// \param[in] theDirection direction of extrusion.
52 /// Can be empty if theBaseShape is planar wire or face.
53 /// \param[in] theToSize offset for "to" plane.
54 /// \param[in] theFromSize offset for "from" plane.
55 GEOMALGOAPI_EXPORT GeomAlgoAPI_Prism(const GeomShapePtr theBaseShape,
56 const std::shared_ptr<GeomAPI_Dir> theDirection,
57 const double theToSize,
58 const double theFromSize);
60 /// \brief Creates extrusion for the given shape along the normal for this shape.
61 /// \param[in] theBaseShape planar face or wire to be extruded.
62 /// \param[in] theToShape top bounding shape. Can be empty.
63 /// In this case offset will be applied to the basis.
64 /// \param[in] theToSize offset for "to" plane.
65 /// \param[in] theFromShape bottom bounding shape. Can be empty.
66 /// In this case offset will be applied to the basis.
67 /// \param[in] theFromSize offset for "from" plane.
68 GEOMALGOAPI_EXPORT GeomAlgoAPI_Prism(const GeomShapePtr theBaseShape,
69 const GeomShapePtr theToShape,
70 const double theToSize,
71 const GeomShapePtr theFromShape,
72 const double theFromSize);
74 /// \brief Creates extrusion for the given shape along the normal for this shape.
75 /// \param[in] theBaseShape planar face or wire to be extruded.
76 /// \param[in] theDirection direction of extrusion.
77 /// Can be empty if theBaseShape is planar wire or face.
78 /// \param[in] theToShape top bounding shape. Can be empty.
79 /// In this case offset will be applied to the basis.
80 /// \param[in] theToSize offset for "to" plane.
81 /// \param[in] theFromShape bottom bounding shape. Can be empty.
82 /// In this case offset will be applied to the basis.
83 /// \param[in] theFromSize offset for "from" plane.
84 GEOMALGOAPI_EXPORT GeomAlgoAPI_Prism(const GeomShapePtr theBaseShape,
85 const std::shared_ptr<GeomAPI_Dir> theDirection,
86 const GeomShapePtr theToShape,
87 const double theToSize,
88 const GeomShapePtr theFromShape,
89 const double theFromSize);
92 /// Builds resulting shape.
93 void build(const GeomShapePtr& theBaseShape,
94 const std::shared_ptr<GeomAPI_Dir> theDirection,
95 const GeomShapePtr& theToShape,
96 const double theToSize,
97 const GeomShapePtr& theFromShape,
98 const double theFromSize);