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_Edge.h>
12 #include <GeomAPI_Pnt.h>
13 #include <GeomAPI_Shape.h>
15 #include <GeomAlgoAPI_Exception.h>
17 namespace GeomAlgoAPI_ShapeAPI
19 /**\class GeomAlgoAPI_ShapeAPI
21 * \brief Allows to access the direct API
23 class GEOMALGOAPI_EXPORT GeomAlgoAPI_ShapeAPI
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
31 static std::shared_ptr<GeomAPI_Shape> makeBox(const double theDx, const double theDy,
32 const double theDz) throw (GeomAlgoAPI_Exception);
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
38 static std::shared_ptr<GeomAPI_Shape> makeBox(std::shared_ptr<GeomAPI_Pnt> theFirstPoint,
39 std::shared_ptr<GeomAPI_Pnt> theSecondPoint) throw (GeomAlgoAPI_Exception);
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.
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);
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.
57 static std::shared_ptr<GeomAPI_Shape> makeTranslation(
58 std::shared_ptr<GeomAPI_Shape> theSourceShape,
61 const double theDz) throw (GeomAlgoAPI_Exception);
63 /// Performs a translation from two points.
64 /// \param theSourceShape Shape to be moved.
65 /// \param theStartPoint Movement start point.
66 /// \param theEndPoint Movement end point.
68 static std::shared_ptr<GeomAPI_Shape> makeTranslation(
69 std::shared_ptr<GeomAPI_Shape> theSourceShape,
70 std::shared_ptr<GeomAPI_Pnt> theStartPoint,
71 std::shared_ptr<GeomAPI_Pnt> theEndPoint) throw (GeomAlgoAPI_Exception);
73 /// Creates a cone segment using standard GDML parameters
74 /// \param theRMin1 Inner radius at base of cone
75 /// \param theRMax1 Outer radius at base of cone
76 /// \param theRMin2 Inner radius at top of cone
77 /// \param theRMax2 Outer radius at top of cone
78 /// \param theZ Height of cone segment
79 /// \param theStartPhi Start angle of the segment
80 /// \param theDeltaPhi Angle of the segment
81 static std::shared_ptr<GeomAPI_Shape> makeConeSegment(
82 const double theRMin1,
83 const double theRMax1,
84 const double theRMin2,
85 const double theRMax2,
87 const double theStartPhi,
88 const double theDeltaPhi) throw (GeomAlgoAPI_Exception);