Salome HOME
Suppressing white space at the end line.
[modules/shaper.git] / src / GeomAlgoAPI / GeomAlgoAPI_Translation.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        GeomAlgoAPI_Translation.h
4 // Created:     8 June 2015
5 // Author:      Dmitry Bobylev
6 //
7 // Modified by Clarisse Genrault (CEA) : 17 Nov 2016
8
9 #ifndef GeomAlgoAPI_Translation_H_
10 #define GeomAlgoAPI_Translation_H_
11
12 #include <GeomAlgoAPI.h>
13 #include <GeomAlgoAPI_MakeShape.h>
14
15 #include <GeomAPI_Ax1.h>
16 #include <GeomAPI_Shape.h>
17
18 /// \class GeomAlgoAPI_Translation
19 /// \ingroup DataAlgo
20 /// \brief Creates a copy of the object by moving it along the axis.
21 class GeomAlgoAPI_Translation : public GeomAlgoAPI_MakeShape
22 {
23 public:
24   /// Type of translation operation
25   enum MethodType {
26     BY_DISTANCE, ///< Translation by axis and distance
27     BY_DIM,      ///< Translation by dimensions in X, Y and Z
28     BY_POINTS    ///< Translation by two points
29   };
30
31   /// \brief Creates an object which is obtained from current object by moving it along the axis.
32   /// \param[in] theSourceShape  a shape to be moved.
33   /// \param[in] theAxis         movement axis.
34   /// \param[in] theDistance     movement distance.
35   GEOMALGOAPI_EXPORT GeomAlgoAPI_Translation(std::shared_ptr<GeomAPI_Shape> theSourceShape,
36                                              std::shared_ptr<GeomAPI_Ax1>   theAxis,
37                                              double                         theDistance);
38
39   /// \brief Creates an object which is obtained from current object by moving it along a vector
40   ///        defined by its dimensions in X, Y and Z.
41   /// \param[in] theSourceShape  the shape to be moved.
42   /// \param[in] theDX           the movement dimension in X.
43   /// \param[in] theDY           the movement dimension in Y.
44   /// \param[in] theDZ           the movement dimension in Z.
45   GEOMALGOAPI_EXPORT GeomAlgoAPI_Translation(std::shared_ptr<GeomAPI_Shape> theSourceShape,
46                                              double                         theDx,
47                                              double                         theDy,
48                                              double                         theDz);
49
50   /// Checks if data for the translation execution is OK.
51   GEOMALGOAPI_EXPORT bool check();
52
53   /// Execute the translation.
54   GEOMALGOAPI_EXPORT void build();
55
56 private:
57   MethodType myMethodType; /// Type of method used.
58   std::shared_ptr<GeomAPI_Shape> mySourceShape; /// Shape to be moved.
59   std::shared_ptr<GeomAPI_Ax1> myAxis; /// Movement axis.
60   double myDistance; /// Movement distance.
61   double myDx; /// Movement dimension on X.
62   double myDy; /// Movement dimension on Y.
63   double myDz; /// Movement dimension on Z.
64 };
65
66 #endif