1 // Copyright (C) 2014-2016 CEA/DEN, EDF R&D
3 // File: GeomAlgoAPI_Translation.h
4 // Created: 8 June 2015
5 // Author: Dmitry Bobylev
7 // Modified by Clarisse Genrault (CEA) : 17 Nov 2016
9 #ifndef GeomAlgoAPI_Translation_H_
10 #define GeomAlgoAPI_Translation_H_
12 #include <GeomAlgoAPI.h>
13 #include <GeomAlgoAPI_MakeShape.h>
15 #include <GeomAPI_Ax1.h>
16 #include <GeomAPI_Shape.h>
18 /// \class GeomAlgoAPI_Translation
20 /// \brief Creates a copy of the object by moving it along the axis.
21 class GeomAlgoAPI_Translation : public GeomAlgoAPI_MakeShape
24 /// Type of translation operation
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
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,
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,
50 /// \brief Creates an object which is obtained from current object by moving it along a vector
51 /// defined by two points.
52 /// \param[in] theSourceShape the shape to be moved.
53 /// \param[in] theStartPoint the movement start point.
54 /// \param[in] theEndPoint the movement end point.
55 GEOMALGOAPI_EXPORT GeomAlgoAPI_Translation(std::shared_ptr<GeomAPI_Shape> theSourceShape,
56 std::shared_ptr<GeomAPI_Pnt> theStartPoint,
57 std::shared_ptr<GeomAPI_Pnt> theEndPoint);
59 /// Checks if data for the translation execution is OK.
60 GEOMALGOAPI_EXPORT bool check();
62 /// Execute the translation.
63 GEOMALGOAPI_EXPORT void build();
66 MethodType myMethodType; /// Type of method used.
67 std::shared_ptr<GeomAPI_Shape> mySourceShape; /// Shape to be moved.
68 std::shared_ptr<GeomAPI_Ax1> myAxis; /// Movement axis.
69 double myDistance; /// Movement distance.
70 double myDx; /// Movement dimension on X.
71 double myDy; /// Movement dimension on Y.
72 double myDz; /// Movement dimension on Z.
73 std::shared_ptr<GeomAPI_Pnt> myStartPoint; /// Movement start point.
74 std::shared_ptr<GeomAPI_Pnt> myEndPoint; /// Movement end point.