X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FGeomAPI%2FGeomAPI_Ellipse.h;h=5f89643bbe76b60fafaeaece2976564551ff9b47;hb=refs%2Fheads%2FV9_11_BR;hp=02536b240499447ce4b2598815eef0965af482ee;hpb=7074394f8f08413d885f63be01df6bd5007b868c;p=modules%2Fshaper.git diff --git a/src/GeomAPI/GeomAPI_Ellipse.h b/src/GeomAPI/GeomAPI_Ellipse.h index 02536b240..5f89643bb 100644 --- a/src/GeomAPI/GeomAPI_Ellipse.h +++ b/src/GeomAPI/GeomAPI_Ellipse.h @@ -1,4 +1,4 @@ -// Copyright (C) 2017 CEA/DEN, EDF R&D +// Copyright (C) 2017-2023 CEA, EDF // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -12,10 +12,9 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ or -// email : webmaster.salome@opencascade.com +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // File: GeomAPI_Ellipse.h @@ -28,8 +27,10 @@ #include #include -class GeomAPI_Pnt; class GeomAPI_Ax2; +class GeomAPI_Curve; +class GeomAPI_Dir; +class GeomAPI_Pnt; /**\class GeomAPI_Ellipse @@ -53,6 +54,8 @@ public: GEOMAPI_EXPORT GeomAPI_Ellipse(const std::shared_ptr& theAx2, double theMajorRadius, double theMinorRadius); + GEOMAPI_EXPORT GeomAPI_Ellipse(std::shared_ptr theCurve); + /// Returns center of the ellipse GEOMAPI_EXPORT std::shared_ptr center() const; @@ -62,12 +65,31 @@ public: /// Returns second focus of the ellipse GEOMAPI_EXPORT std::shared_ptr secondFocus() const; + /// Return orthogonal direction to the ellipse's plane + GEOMAPI_EXPORT std::shared_ptr normal() const; + /// Returns minor radius of the ellipse GEOMAPI_EXPORT double minorRadius() const; /// Returns major radius of the ellipse GEOMAPI_EXPORT double majorRadius() const; + /// Project point on ellipse + GEOMAPI_EXPORT const std::shared_ptr project( + const std::shared_ptr& thePoint) const; + + /** \brief Computes the parameter of a given point on an ellipse. The point must be + * located either on the circle itself or relatively to the latter + * at a distance less than the tolerance value. Return FALSE if the point + * is beyond the tolerance limit or if computation fails. + * Max Tolerance value is currently limited to 1.e-4 + * \param[in] thePoint point of origin. + * \param[in] theTolerance tolerance of computation. + * \param[out] theParameter resulting parameter. + */ + GEOMAPI_EXPORT const bool parameter(const std::shared_ptr thePoint, + const double theTolerance, + double& theParameter) const; }; //! Pointer on the object