]> SALOME platform Git repositories - modules/shaper.git/blob - src/GeomAPI/GeomAPI_Circ.h
Salome HOME
Revert "Merge branch 'Pre_2.8.0_development'"
[modules/shaper.git] / src / GeomAPI / GeomAPI_Circ.h
1 // Copyright (C) 2014-2017  CEA/DEN, EDF R&D
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or
18 // email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
19 //
20
21 #ifndef GeomAPI_Circ_H_
22 #define GeomAPI_Circ_H_
23
24 #include <GeomAPI_Interface.h>
25 #include <memory>
26
27 class GeomAPI_Ax2;
28 class GeomAPI_Pnt;
29 class GeomAPI_Dir;
30
31 /**\class GeomAPI_Circ
32  * \ingroup DataModel
33  * \brief Circle in 3D
34  */
35
36 class GeomAPI_Circ : public GeomAPI_Interface
37 {
38  public:
39
40   /** \brief Constructs a circle of radius Radius, where theAx2 locates the circle and defines its orientation in 3D space such that:\n
41    *  - the center of the circle is the origin of theAx2;\n
42    *  - the origin, "X Direction" and "Y Direction" of theAx2 define the plane of the circle;\n
43    *  - theAx2 is the local coordinate system of the circle.\n
44    *    Note: It is possible to create a circle where Radius is equal to 0.0. raised if Radius < 0.
45    */
46   GEOMAPI_EXPORT GeomAPI_Circ(const std::shared_ptr<GeomAPI_Ax2> theAx2,
47                               const double theRadius);
48
49   /// Creation of circle defined by center point, direction and circle radius
50   GEOMAPI_EXPORT GeomAPI_Circ(const std::shared_ptr<GeomAPI_Pnt>& theCenter,
51                const std::shared_ptr<GeomAPI_Dir>& theDir, double theRadius);
52
53   /// Return center of the circle
54   GEOMAPI_EXPORT const std::shared_ptr<GeomAPI_Pnt> center() const;
55
56   /// Return radius of the circle
57   GEOMAPI_EXPORT double radius() const;
58
59   /// Return orthogonal direction to the circle's plane
60   GEOMAPI_EXPORT std::shared_ptr<GeomAPI_Dir> normal() const;
61
62   /// Project point on circle
63   GEOMAPI_EXPORT const std::shared_ptr<GeomAPI_Pnt> project(
64       const std::shared_ptr<GeomAPI_Pnt>& thePoint) const;
65
66   /** \brief Computes the parameter of a given point on a circle. The point must be
67    *         located either on the circle itself or relatively to the latter
68    *         at a distance less than the tolerance value. Return FALSE if the point
69    *         is beyond the tolerance limit or if computation fails.
70    *         Max Tolerance value is currently limited to 1.e-4
71    *  \param[in] thePoint point of origin.
72    *  \param[in] theTolerance tolerance of computation.
73    *  \param[out] theParameter resulting parameter.
74    */
75   GEOMAPI_EXPORT const bool parameter(const std::shared_ptr<GeomAPI_Pnt> thePoint,
76                                       const double theTolerance,
77                                       double& theParameter) const;
78 };
79
80 #endif
81