Salome HOME
Add a new method for translation feature : translation by DX, DY, DZ vector.
[modules/shaper.git] / src / GeomAlgoAPI / GeomAlgoAPI_ShapeAPI.h
1 // Copyright (C) 2014-2016 CEA/DEN, EDF R&D
2
3 // File:        GeomAlgoAPI_ShapeAPI.h
4 // Created:     17 Mar 2016
5 // Author:      Clarisse Genrault (CEA)
6
7 #ifndef GEOMALGOAPI_SHAPEAPI_H
8 #define GEOMALGOAPI_SHAPEAPI_H
9
10 #include <GeomAPI_Ax1.h>
11 #include <GeomAPI_Edge.h>
12 #include <GeomAPI_Pnt.h>
13 #include <GeomAPI_Shape.h>
14
15 #include <GeomAlgoAPI_Exception.h>
16
17 namespace GeomAlgoAPI_ShapeAPI
18 {
19 /**\class GeomAlgoAPI_ShapeAPI
20  * \ingroup DataAlgo
21  * \brief Allows to access the direct API
22  */
23 class GEOMALGOAPI_EXPORT GeomAlgoAPI_ShapeAPI
24 {
25 public:
26   /// Creates a box using the dimensions.
27   /// \param theDx The dimension on X
28   /// \param theDy The dimension on Y
29   /// \param theDz The dimension on Z
30   /// \return a shape
31   static std::shared_ptr<GeomAPI_Shape> makeBox(const double theDx, const double theDy,
32                                                 const double theDz) throw (GeomAlgoAPI_Exception);
33
34   /// Creates a box using the two points that defined a diagonal.
35   /// \param theFirstPoint One extermity of the diagonal
36   /// \param theSecondPoint The other extremity of the diagonal
37   /// \return a shape
38   static std::shared_ptr<GeomAPI_Shape> makeBox(std::shared_ptr<GeomAPI_Pnt> theFirstPoint,
39                      std::shared_ptr<GeomAPI_Pnt> theSecondPoint) throw (GeomAlgoAPI_Exception);
40                                                    
41   /// Performs a translation from an axis and a distance.
42   /// \param theSourceShape Shape to be moved.
43   /// \param theAxis Movement axis.
44   /// \param theDistance Movement distance.
45   /// \return a shape
46   static std::shared_ptr<GeomAPI_Shape> makeTranslation(
47                      std::shared_ptr<GeomAPI_Shape> theSourceShape,
48                      std::shared_ptr<GeomAPI_Ax1>   theAxis,
49                      const double theDistance) throw (GeomAlgoAPI_Exception);
50                                                    
51   /// Performs a translation from dimensions.
52   /// \param theSourceShape Shape to be moved.
53   /// \param theDx Movement dimension on X.
54   /// \param theDy Movement dimension on Y.
55   /// \param theDz Movement dimension on Z.
56   /// \return a shape
57   static std::shared_ptr<GeomAPI_Shape> makeTranslation(
58                      std::shared_ptr<GeomAPI_Shape> theSourceShape,
59                      const double theDx,
60                      const double theDy,
61                      const double theDz) throw (GeomAlgoAPI_Exception);
62 };
63 }
64 #endif