Salome HOME
Debug (Google style).
[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_Ax2.h>
12 #include <GeomAPI_Edge.h>
13 #include <GeomAPI_Pnt.h>
14 #include <GeomAPI_Shape.h>
15
16 #include <GeomAlgoAPI_Exception.h>
17
18 namespace GeomAlgoAPI_ShapeAPI
19 {
20 /**\class GeomAlgoAPI_ShapeAPI
21  * \ingroup DataAlgo
22  * \brief Allows to access the direct API
23  */
24 class GEOMALGOAPI_EXPORT GeomAlgoAPI_ShapeAPI
25 {
26 public:
27   /// Creates a box using the dimensions.
28   /// \param theDx The dimension on X
29   /// \param theDy The dimension on Y
30   /// \param theDz The dimension on Z
31   /// \return a shape
32   static std::shared_ptr<GeomAPI_Shape> makeBox(const double theDx, const double theDy,
33                                                 const double theDz) throw (GeomAlgoAPI_Exception);
34
35   /// Creates a box using the two points that defined a diagonal.
36   /// \param theFirstPoint One extermity of the diagonal
37   /// \param theSecondPoint The other extremity of the diagonal
38   /// \return a shape
39   static std::shared_ptr<GeomAPI_Shape> makeBox(std::shared_ptr<GeomAPI_Pnt> theFirstPoint,
40                      std::shared_ptr<GeomAPI_Pnt> theSecondPoint) throw (GeomAlgoAPI_Exception);
41
42   /// Performs a translation from an axis and a distance.
43   /// \param theSourceShape Shape to be moved.
44   /// \param theAxis Movement axis.
45   /// \param theDistance Movement distance.
46   /// \return a shape
47   static std::shared_ptr<GeomAPI_Shape> makeTranslation(
48                      std::shared_ptr<GeomAPI_Shape> theSourceShape,
49                      std::shared_ptr<GeomAPI_Ax1>   theAxis,
50                      const double theDistance) throw (GeomAlgoAPI_Exception);
51
52   /// Performs a translation from dimensions.
53   /// \param theSourceShape Shape to be moved.
54   /// \param theDx Movement dimension on X.
55   /// \param theDy Movement dimension on Y.
56   /// \param theDz Movement dimension on Z.
57   /// \return a shape
58   static std::shared_ptr<GeomAPI_Shape> makeTranslation(
59                      std::shared_ptr<GeomAPI_Shape> theSourceShape,
60                      const double theDx,
61                      const double theDy,
62                      const double theDz) throw (GeomAlgoAPI_Exception);
63
64   /// Performs a translation from two points.
65   /// \param theSourceShape Shape to be moved.
66   /// \param theStartPoint Movement start point.
67   /// \param theEndPoint Movement end point.
68   /// \return a shape
69   static std::shared_ptr<GeomAPI_Shape> makeTranslation(
70                      std::shared_ptr<GeomAPI_Shape> theSourceShape,
71                      std::shared_ptr<GeomAPI_Pnt>   theStartPoint,
72                      std::shared_ptr<GeomAPI_Pnt>   theEndPoint) throw (GeomAlgoAPI_Exception);
73
74   /// Performs a symmetry by a point
75   static std::shared_ptr<GeomAPI_Shape> makeSymmetry(
76                      std::shared_ptr<GeomAPI_Shape> theSourceShape,
77                      std::shared_ptr<GeomAPI_Pnt>   thePoint) throw (GeomAlgoAPI_Exception);
78
79   /// Performs a symmetry by an axis
80   static std::shared_ptr<GeomAPI_Shape> makeSymmetry(
81                      std::shared_ptr<GeomAPI_Shape> theSourceShape,
82                      std::shared_ptr<GeomAPI_Ax1>   theAxis) throw (GeomAlgoAPI_Exception);
83
84   /// Performs a symmetry by a plane
85   static std::shared_ptr<GeomAPI_Shape> makeSymmetry(
86                      std::shared_ptr<GeomAPI_Shape> theSourceShape,
87                      std::shared_ptr<GeomAPI_Ax2>   thePlane) throw (GeomAlgoAPI_Exception);
88
89   /// Creates a cone segment using standard GDML parameters
90   /// \param theRMin1 Inner radius at base of cone
91   /// \param theRMax1 Outer radius at base of cone
92   /// \param theRMin2 Inner radius at top of cone
93   /// \param theRMax2 Outer radius at top of cone
94   /// \param theZ Height of cone segment
95   /// \param theStartPhi Start angle of the segment
96   /// \param theDeltaPhi Angle of the segment
97   static std::shared_ptr<GeomAPI_Shape> makeConeSegment(
98                      const double theRMin1,
99                      const double theRMax1,
100                      const double theRMin2,
101                      const double theRMax2,
102                      const double theZ,
103                      const double theStartPhi,
104                      const double theDeltaPhi) throw (GeomAlgoAPI_Exception);
105 };
106 }
107 #endif