1 // Copyright (C) 2014-2017 CEA/DEN, EDF R&D
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.
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.
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
17 // See http://www.salome-platform.org/ or
18 // email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
21 #ifndef GeomAPI_Circ_H_
22 #define GeomAPI_Circ_H_
24 #include <GeomAPI_Interface.h>
31 /**\class GeomAPI_Circ
36 class GeomAPI_Circ : public GeomAPI_Interface
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.
46 GEOMAPI_EXPORT GeomAPI_Circ(const std::shared_ptr<GeomAPI_Ax2> theAx2,
47 const double theRadius);
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);
53 /// Return center of the circle
54 GEOMAPI_EXPORT const std::shared_ptr<GeomAPI_Pnt> center() const;
56 /// Return radius of the circle
57 GEOMAPI_EXPORT double radius() const;
59 /// Return orthogonal direction to the circle's plane
60 GEOMAPI_EXPORT std::shared_ptr<GeomAPI_Dir> normal() const;
62 /// Project point on circle
63 GEOMAPI_EXPORT const std::shared_ptr<GeomAPI_Pnt> project(
64 const std::shared_ptr<GeomAPI_Pnt>& thePoint) const;
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.
75 GEOMAPI_EXPORT const bool parameter(const std::shared_ptr<GeomAPI_Pnt> thePoint,
76 const double theTolerance,
77 double& theParameter) const;