]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/GeomAlgoAPI/GeomAlgoAPI_Translation.h
Salome HOME
Revert "Revert "Add a new method for translation : translation by two points.""
[modules/shaper.git] / src / GeomAlgoAPI / GeomAlgoAPI_Translation.h
index fe6f0a7d67ed482e16b347854083dd5c5448af37..62252139b79ec75ab762dac9b371050737c57372 100644 (file)
@@ -27,7 +27,7 @@ public:
     BY_DIM,      ///< Translation by dimensions in X, Y and Z
     BY_POINTS    ///< Translation by two points
   };
-  
+
   /// \brief Creates an object which is obtained from current object by moving it along the axis.
   /// \param[in] theSourceShape  a shape to be moved.
   /// \param[in] theAxis         movement axis.
@@ -35,8 +35,8 @@ public:
   GEOMALGOAPI_EXPORT GeomAlgoAPI_Translation(std::shared_ptr<GeomAPI_Shape> theSourceShape,
                                              std::shared_ptr<GeomAPI_Ax1>   theAxis,
                                              double                         theDistance);
-  
-  /// \brief Creates an object which is obtained from current object by moving it along a vector 
+
+  /// \brief Creates an object which is obtained from current object by moving it along a vector
   ///        defined by its dimensions in X, Y and Z.
   /// \param[in] theSourceShape  the shape to be moved.
   /// \param[in] theDX           the movement dimension in X.
@@ -46,10 +46,19 @@ public:
                                              double                         theDx,
                                              double                         theDy,
                                              double                         theDz);
-  
+
+  /// \brief Creates an object which is obtained from current object by moving it along a vector
+  ///        defined by two points.
+  /// \param[in] theSourceShape  the shape to be moved.
+  /// \param[in] theStartPoint   the movement start point.
+  /// \param[in] theEndPoint     the movement end point.
+  GEOMALGOAPI_EXPORT GeomAlgoAPI_Translation(std::shared_ptr<GeomAPI_Shape> theSourceShape,
+                                             std::shared_ptr<GeomAPI_Pnt>   theStartPoint,
+                                             std::shared_ptr<GeomAPI_Pnt>   theEndPoint);
+
   /// Checks if data for the translation execution is OK.
   GEOMALGOAPI_EXPORT bool check();
-  
+
   /// Execute the translation.
   GEOMALGOAPI_EXPORT void build();
 
@@ -61,6 +70,8 @@ private:
   double myDx; /// Movement dimension on X.
   double myDy; /// Movement dimension on Y.
   double myDz; /// Movement dimension on Z.
+  std::shared_ptr<GeomAPI_Pnt> myStartPoint; /// Movement start point.
+  std::shared_ptr<GeomAPI_Pnt> myEndPoint; /// Movement end point.
 };
 
 #endif