Salome HOME
Make import XAO with groups
[modules/shaper.git] / src / GeomAlgoAPI / GeomAlgoAPI_Prism.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        GeomAlgoAPI_Prism.h
4 // Created:     5 May 2015
5 // Author:      Dmitry Bobylev
6
7 #ifndef GeomAlgoAPI_Prism_H_
8 #define GeomAlgoAPI_Prism_H_
9
10 #include "GeomAlgoAPI.h"
11
12 #include "GeomAlgoAPI_MakeSweep.h"
13
14 #include <GeomAPI_Dir.h>
15 #include <GeomAPI_Shape.h>
16
17 #include <memory>
18
19 /// \class GeomAlgoAPI_Prism
20 /// \ingroup DataAlgo
21 /// \brief Allows to create the prism based on a given face and bounding planes.
22 /// \n Note that only planar faces are allowed as bounding faces and resulting
23 /// extrusion will be bounded by the infinite planes taken from the faces.
24 class GeomAlgoAPI_Prism : public GeomAlgoAPI_MakeSweep
25 {
26 public:
27   /// \brief Creates extrusion for the given shape along the normal for this shape.
28   /// \param[in] theBaseShape planar face or wire to be extruded.
29   /// \param[in] theToSize offset for "to" plane.
30   /// \param[in] theFromSize offset for "from" plane.
31   GEOMALGOAPI_EXPORT GeomAlgoAPI_Prism(const GeomShapePtr theBaseShape,
32                                        const double       theToSize,
33                                        const double       theFromSize);
34
35   /// \brief Creates extrusion for the given shape along the normal for this shape.
36   /// \param[in] theBaseShape vertex, edge, wire, face or shell.
37   /// \param[in] theDirection direction of extrusion. Can be empty if theBaseShape is planar wire or face.
38   /// \param[in] theToSize offset for "to" plane.
39   /// \param[in] theFromSize offset for "from" plane.
40   GEOMALGOAPI_EXPORT GeomAlgoAPI_Prism(const GeomShapePtr                 theBaseShape,
41                                        const std::shared_ptr<GeomAPI_Dir> theDirection,
42                                        const double                       theToSize,
43                                        const double                       theFromSize);
44
45   /// \brief Creates extrusion for the given shape along the normal for this shape.
46   /// \param[in] theBaseShape planar face or wire to be extruded.
47   /// \param[in] theToShape top bounding shape. Can be empty. In this case offset will be applied to the basis.
48   /// \param[in] theToSize offset for "to" plane.
49   /// \param[in] theFromShape bottom bounding shape. Can be empty. In this case offset will be applied to the basis.
50   /// \param[in] theFromSize offset for "from" plane.
51   GEOMALGOAPI_EXPORT GeomAlgoAPI_Prism(const GeomShapePtr theBaseShape,
52                                        const GeomShapePtr theToShape,
53                                        const double       theToSize,
54                                        const GeomShapePtr theFromShape,
55                                        const double       theFromSize);
56
57   /// \brief Creates extrusion for the given shape along the normal for this shape.
58   /// \param[in] theBaseShape planar face or wire to be extruded.
59   /// \param[in] theDirection direction of extrusion. Can be empty if theBaseShape is planar wire or face.
60   /// \param[in] theToShape top bounding shape. Can be empty. In this case offset will be applied to the basis.
61   /// \param[in] theToSize offset for "to" plane.
62   /// \param[in] theFromShape bottom bounding shape. Can be empty. In this case offset will be applied to the basis.
63   /// \param[in] theFromSize offset for "from" plane.
64   GEOMALGOAPI_EXPORT GeomAlgoAPI_Prism(const GeomShapePtr                 theBaseShape,
65                                        const std::shared_ptr<GeomAPI_Dir> theDirection,
66                                        const GeomShapePtr                 theToShape,
67                                        const double                       theToSize,
68                                        const GeomShapePtr                 theFromShape,
69                                        const double                       theFromSize);
70
71 private:
72   /// Builds resulting shape.
73   void build(const GeomShapePtr&                theBaseShape,
74              const std::shared_ptr<GeomAPI_Dir> theDirection,
75              const GeomShapePtr&                theToShape,
76              const double                       theToSize,
77              const GeomShapePtr&                theFromShape,
78              const double                       theFromSize);
79 };
80
81 #endif