Salome HOME
Issue #532 - 4.13. Partition with splitting-arguments making solids with shared faces
[modules/shaper.git] / src / GeomAlgoAPI / GeomAlgoAPI_Rotation.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        GeomAlgoAPI_Rotation.h
4 // Created:     12 May 2015
5 // Author:      Dmitry Bobylev
6
7 #ifndef GeomAlgoAPI_Rotation_H_
8 #define GeomAlgoAPI_Rotation_H_
9
10 #include <GeomAlgoAPI.h>
11 #include <GeomAlgoAPI_MakeShape.h>
12 #include <GeomAPI_Ax1.h>
13 #include <GeomAPI_DataMapOfShapeShape.h>
14 #include <GeomAPI_Shape.h>
15 #include <GeomAPI_Trsf.h>
16
17 /** \class GeomAlgoAPI_Rotation
18  *  \ingroup DataAlgo
19  *  \brief Creates a copy of the object by rotating it around the axis.
20  */
21 class GeomAlgoAPI_Rotation : public GeomAPI_Interface
22 {
23 public:
24   /** \brief Creates an object which is obtained from current object by rotating it around the axis.
25    *  \param[in] theSourceShape  a shape to be rotated.
26    *  \param[in] theAxis         rotation axis.
27    *  \param[in] theAngle        rotation angle(in degree).
28    *  \param[in] theSimpleTransform makes just transformation of shape without changing of topology or geometry
29    */
30   GEOMALGOAPI_EXPORT GeomAlgoAPI_Rotation(std::shared_ptr<GeomAPI_Shape> theSourceShape,
31                                           std::shared_ptr<GeomAPI_Ax1>   theAxis,
32                                           double                         theAngle,
33                                           bool theSimpleTransform = false);
34
35   /// \return true if algorithm succeed.
36   GEOMALGOAPI_EXPORT const bool isDone() const
37   { return myDone; }
38
39   /// \return true if resulting shape is valid.
40   GEOMALGOAPI_EXPORT const bool isValid() const;
41
42   /// \return true if resulting shape has volume.
43   GEOMALGOAPI_EXPORT const bool hasVolume() const;
44
45   /// \return result of the rotation algorithm.
46   GEOMALGOAPI_EXPORT const std::shared_ptr<GeomAPI_Shape>& shape() const;
47
48   /// \return map of sub-shapes of the result. To be used for History keeping.
49   GEOMALGOAPI_EXPORT std::shared_ptr<GeomAPI_DataMapOfShapeShape> mapOfShapes() const;
50
51   /// \return interface for for History processing.
52   GEOMALGOAPI_EXPORT std::shared_ptr<GeomAlgoAPI_MakeShape> makeShape() const;
53
54   /// Returns the simple transformation
55   GEOMALGOAPI_EXPORT std::shared_ptr<GeomAPI_Trsf> transformation() const;
56
57 private:
58   /// Builds resulting shape.
59   void build(std::shared_ptr<GeomAPI_Shape> theSourceShape,
60              std::shared_ptr<GeomAPI_Ax1>   theAxis,
61              double                         theAngle,
62              bool theSimpleTransform);
63
64 private:
65   /// Fields.
66   bool myDone;
67   std::shared_ptr<GeomAPI_Shape> myShape;
68   std::shared_ptr<GeomAPI_DataMapOfShapeShape> myMap;
69   std::shared_ptr<GeomAlgoAPI_MakeShape> myMkShape;
70   std::shared_ptr<GeomAPI_Trsf> myTrsf; ///< transformation of the shape in case theSimpleTransform
71 };
72
73 #endif