Salome HOME
Merge branch 'master' into cgt/devCEA
[modules/shaper.git] / src / GeomAlgoAPI / GeomAlgoAPI_Revolution.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        GeomAlgoAPI_Revolution.h
4 // Created:     12 May 2015
5 // Author:      Dmitry Bobylev
6
7 #ifndef GeomAlgoAPI_Revolution_H_
8 #define GeomAlgoAPI_Revolution_H_
9
10 #include "GeomAlgoAPI.h"
11
12 #include "GeomAlgoAPI_MakeSweep.h"
13
14 #include <GeomAPI_Ax1.h>
15
16 /// \class GeomAlgoAPI_Revolution
17 /// \ingroup DataAlgo
18 /// \brief Allows to create the revolution based on a given face, angles and bounding planes.
19 /// \n Note that only the planar faces are allowed as bounding faces and resulting
20 /// revolution will be bounded by the infinite planes taken from the faces.
21 /// \n If the bounding plane was specified with the angle then this plane will be rotated around
22 /// the axis to the value of the angle.
23 /// \n Note that algorithm return only one solid object. So in case when after cutting with bounding
24 /// planes algorithm got more than one solid it will return the closest to the center of mass of
25 /// the base face.
26 class GeomAlgoAPI_Revolution : public GeomAlgoAPI_MakeSweep
27 {
28 public:
29   /// \brief Creates revolution for the given shape.
30   /// \param[in] theBaseShape face for revolution.
31   /// \param[in] theAxis axis for revolution.
32   /// \param[in] theToAngle to angle.
33   /// \param[in] theFromAngle from angle.
34   GEOMALGOAPI_EXPORT GeomAlgoAPI_Revolution(const GeomShapePtr                 theBaseShape,
35                                             const std::shared_ptr<GeomAPI_Ax1> theAxis,
36                                             const double                       theToAngle,
37                                             const double                       theFromAngle);
38
39   /// \brief Creates revolution for the given shape.
40   /// \param[in] theBaseShape face for revolution.
41   /// \param[in] theAxis axis for revolution.
42   /// \param[in] theToShape to bounding shape. Can be empty.
43   ///                       In this case offset will be applied to the basis.
44   /// \param[in] theToAngle to angle.
45   /// \param[in] theFromShape from bounding shape. Can be empty.
46   ///                       In this case offset will be applied to the basis.
47   /// \param[in] theFromAngle from angle.
48   GEOMALGOAPI_EXPORT GeomAlgoAPI_Revolution(const GeomShapePtr                 theBaseShape,
49                                             const std::shared_ptr<GeomAPI_Ax1> theAxis,
50                                             const GeomShapePtr                 theToShape,
51                                             const double                       theToAngle,
52                                             const GeomShapePtr                 theFromShape,
53                                             const double                       theFromAngle);
54
55 private:
56   /// Builds resulting shape.
57   void build(const GeomShapePtr&                 theBaseShape,
58              const std::shared_ptr<GeomAPI_Ax1>& theAxis,
59              const GeomShapePtr&                 theToShape,
60              const double                        theToAngle,
61              const GeomShapePtr&                 theFromShape,
62              const double                        theFromAngle);
63 };
64
65 #endif