Salome HOME
Documentation fixes.
[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   /// Project point on circle
46   GEOMAPI_EXPORT const std::shared_ptr<GeomAPI_Pnt> project(
47       const std::shared_ptr<GeomAPI_Pnt>& thePoint) const;
48
49   /** \brief Computes the parameter of a given point on a circle. The point must be
50    *         located either on the circle itself or relatively to the latter
51    *         at a distance less than the tolerance value. Return FALSE if the point
52    *         is beyond the tolerance limit or if computation fails.
53    *         Max Tolerance value is currently limited to 1.e-4
54    *  \param[in] thePoint point of origin.
55    *  \param[in] theTolerance tolerance of computation.
56    *  \param[out] theParameter resulting parameter.
57    */
58   GEOMAPI_EXPORT const bool parameter(const std::shared_ptr<GeomAPI_Pnt> thePoint,
59                                       const double theTolerance,
60                                       double& theParameter) const;
61 };
62
63 #endif
64