Salome HOME
Debugging Symmetry feature.
[modules/shaper.git] / src / GeomAlgoAPI / GeomAlgoAPI_Symmetry.h
1 // Copyright (C) 2014-2016 CEA/DEN, EDF R&D
2
3 // File:        GeomAlgoAPI_Symmetry.h
4 // Created:     30 Nov 2016
5 // Author:      Clarisse Genrault (CEA)
6
7 #ifndef GEOMALGOAPI_SYMMETRY_H_
8 #define GEOMALGOAPI_SYMMETRY_H_
9
10 #include <GeomAlgoAPI.h>
11 #include <GeomAlgoAPI_MakeShape.h>
12
13 #include <GeomAPI_Pnt.h>
14 #include <GeomAPI_Ax1.h>
15 #include <GeomAPI_Ax2.h>
16
17 /// \class GeomAlgoAPI_Symmetry
18 /// \ingroup DataAlgo
19 /// \brief Creates a copy of the object by performing a symmetry operation by a point,
20 ///        by an axis or by a plane.
21 class GeomAlgoAPI_Symmetry : public GeomAlgoAPI_MakeShape
22 {
23 public:
24   /// Type of symmetry operation
25   enum MethodType {
26     BY_POINT, ///< Symmetry by point.
27     BY_AXIS,  ///< Symmetry by axis.
28     BY_PLANE  ///< Symmetry by plane.
29   };
30
31   /// \brief Creates an object which is obtained from current object by performing
32   ///        a symmetry operation by a point.
33   /// \param[in] theSourceShape  the shape to be moved.
34   /// \param[in] thePoint        the symmetry point.
35   GEOMALGOAPI_EXPORT GeomAlgoAPI_Symmetry(std::shared_ptr<GeomAPI_Shape> theSourceShape,
36                                           std::shared_ptr<GeomAPI_Pnt>   thePoint);
37
38   /// \brief Creates an object which is obtained from current object by performing
39   ///        a symmetry operation by a point.
40   /// \param[in] theSourceShape  the shape to be moved.
41   /// \param[in] theAxis         the symmetry axis.
42   GEOMALGOAPI_EXPORT GeomAlgoAPI_Symmetry(std::shared_ptr<GeomAPI_Shape> theSourceShape,
43                                           std::shared_ptr<GeomAPI_Ax1>   theAxis);
44
45   /// \brief Creates an object which is obtained from current object by performing
46   ///        a symmetry operation by a point.
47   /// \param[in] theSourceShape  the shape to be moved.
48   /// \param[in] thePlane        the symmetry plane.
49   GEOMALGOAPI_EXPORT GeomAlgoAPI_Symmetry(std::shared_ptr<GeomAPI_Shape> theSourceShape,
50                                           std::shared_ptr<GeomAPI_Ax2>   thePlane);
51
52   /// Checks if data for the symmetry execution is OK.
53   GEOMALGOAPI_EXPORT bool check();
54
55   /// Execute the symmetry.
56   GEOMALGOAPI_EXPORT void build();
57
58 private:
59   MethodType myMethodType; /// Type of method used.
60   std::shared_ptr<GeomAPI_Shape> mySourceShape; /// Shape to be moved.
61   std::shared_ptr<GeomAPI_Pnt> myPoint; /// Reflection point.
62   std::shared_ptr<GeomAPI_Ax1> myAxis; /// Reflection axis.
63   std::shared_ptr<GeomAPI_Ax2> myPlane; /// Reflection plane.
64 };
65
66 #endif // GEOMALGOAPI_SYMMETRY_H_