Salome HOME
625ca3895b0a677dc6d652a611e6bb383d3f479b
[modules/shaper.git] / src / GeomAPI / GeomAPI_Circ.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        GeomAPI_Circ.h
4 // Created:     24 Jun 2014
5 // Author:      Artem ZHIDKOV
6
7 #ifndef GeomAPI_Circ_H_
8 #define GeomAPI_Circ_H_
9
10 #include <GeomAPI_Interface.h>
11 #include <memory>
12
13 class GeomAPI_Ax2;
14 class GeomAPI_Pnt;
15 class GeomAPI_Dir;
16
17 /**\class GeomAPI_Circ
18  * \ingroup DataModel
19  * \brief Circle in 3D
20  */
21
22 class GeomAPI_Circ : public GeomAPI_Interface
23 {
24  public:
25
26   /** \brief Constructs a circle of radius Radius, where theAx2 locates the circle and defines its orientation in 3D space such that:\n
27    *  - the center of the circle is the origin of theAx2;\n
28    *  - the origin, "X Direction" and "Y Direction" of theAx2 define the plane of the circle;\n
29    *  - theAx2 is the local coordinate system of the circle.\n
30    *    Note: It is possible to create a circle where Radius is equal to 0.0. raised if Radius < 0.
31    */
32   GEOMAPI_EXPORT GeomAPI_Circ(const std::shared_ptr<GeomAPI_Ax2> theAx2,
33                               const double theRadius);
34
35   /// Creation of circle defined by center point, direction and circle radius
36   GEOMAPI_EXPORT GeomAPI_Circ(const std::shared_ptr<GeomAPI_Pnt>& theCenter,
37                const std::shared_ptr<GeomAPI_Dir>& theDir, double theRadius);
38
39   /// Return center of the circle
40   GEOMAPI_EXPORT const std::shared_ptr<GeomAPI_Pnt> center() const;
41
42   /// Return radius of the circle
43   GEOMAPI_EXPORT double radius() const;
44
45   /// Return orthogonal direction to the circle's plane
46   GEOMAPI_EXPORT std::shared_ptr<GeomAPI_Dir> normal() const;
47
48   /// Project point on circle
49   GEOMAPI_EXPORT const std::shared_ptr<GeomAPI_Pnt> project(
50       const std::shared_ptr<GeomAPI_Pnt>& thePoint) const;
51
52   /** \brief Computes the parameter of a given point on a circle. The point must be
53    *         located either on the circle itself or relatively to the latter
54    *         at a distance less than the tolerance value. Return FALSE if the point
55    *         is beyond the tolerance limit or if computation fails.
56    *         Max Tolerance value is currently limited to 1.e-4
57    *  \param[in] thePoint point of origin.
58    *  \param[in] theTolerance tolerance of computation.
59    *  \param[out] theParameter resulting parameter.
60    */
61   GEOMAPI_EXPORT const bool parameter(const std::shared_ptr<GeomAPI_Pnt> thePoint,
62                                       const double theTolerance,
63                                       double& theParameter) const;
64 };
65
66 #endif
67