1 // Copyright (C) 2014-2016 CEA/DEN, EDF R&D
3 // File: GeomAlgoAPI_ShapeAPI.h
4 // Created: 17 Mar 2016
5 // Author: Clarisse Genrault (CEA)
7 #ifndef GEOMALGOAPI_SHAPEAPI_H
8 #define GEOMALGOAPI_SHAPEAPI_H
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>
16 #include <GeomAlgoAPI_Exception.h>
18 namespace GeomAlgoAPI_ShapeAPI
20 /**\class GeomAlgoAPI_ShapeAPI
22 * \brief Allows to access the direct API
24 class GEOMALGOAPI_EXPORT GeomAlgoAPI_ShapeAPI
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
32 static std::shared_ptr<GeomAPI_Shape> makeBox(const double theDx, const double theDy,
33 const double theDz) throw (GeomAlgoAPI_Exception);
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
39 static std::shared_ptr<GeomAPI_Shape> makeBox(std::shared_ptr<GeomAPI_Pnt> theFirstPoint,
40 std::shared_ptr<GeomAPI_Pnt> theSecondPoint) throw (GeomAlgoAPI_Exception);
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.
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);
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.
58 static std::shared_ptr<GeomAPI_Shape> makeTranslation(
59 std::shared_ptr<GeomAPI_Shape> theSourceShape,
62 const double theDz) throw (GeomAlgoAPI_Exception);
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.
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);
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);
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);
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);
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,
103 const double theStartPhi,
104 const double theDeltaPhi) throw (GeomAlgoAPI_Exception);