]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/GeomAPI/GeomAPI_Ellipse2d.h
Salome HOME
updated copyright message
[modules/shaper.git] / src / GeomAPI / GeomAPI_Ellipse2d.h
index ef8840d4a59bf894d4302cb346a1382814bce9cd..a54b7db671466547dd4ebae7add6e65e69f23764 100644 (file)
@@ -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
 //
 // 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<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 // File:        GeomAPI_Ellipse2d.h
 
 #include <GeomAPI_Interface.h>
 
-class GeomAPI_Pnt2d;
+class GeomAPI_Circ2d;
 class GeomAPI_Dir2d;
+class GeomAPI_Lin2d;
+class GeomAPI_Pnt2d;
 
 /**\class GeomAPI_Ellipse2d
  * \ingroup DataModel
@@ -64,6 +65,41 @@ public:
 
   /// Returns major radius of the ellipse
   GEOMAPI_EXPORT double majorRadius() const;
+
+  /// Project point on ellipse
+  GEOMAPI_EXPORT const std::shared_ptr<GeomAPI_Pnt2d> project(
+      const std::shared_ptr<GeomAPI_Pnt2d>& 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<GeomAPI_Pnt2d> thePoint,
+                                      const double theTolerance,
+                                      double& theParameter) const;
+
+  /// Calculate minimal distance between the ellipse and a line.
+  /// Return corresponding points on the ellipse and on the line.
+  GEOMAPI_EXPORT double distance(const std::shared_ptr<GeomAPI_Lin2d>& theLine,
+                                 std::shared_ptr<GeomAPI_Pnt2d>& thePointOnMe,
+                                 std::shared_ptr<GeomAPI_Pnt2d>& thePointOnLine);
+
+  /// Calculate minimal distance between the ellipse and a circle.
+  /// Return corresponding points on the ellipse and on the circle.
+  GEOMAPI_EXPORT double distance(const std::shared_ptr<GeomAPI_Circ2d>& theCircle,
+                                 std::shared_ptr<GeomAPI_Pnt2d>& thePointOnMe,
+                                 std::shared_ptr<GeomAPI_Pnt2d>& thePointOnCircle);
+
+  /// Calculate minimal distance between two ellipses.
+  /// Return corresponding points on the ellipses.
+  GEOMAPI_EXPORT double distance(const std::shared_ptr<GeomAPI_Ellipse2d>& theEllipse,
+                                 std::shared_ptr<GeomAPI_Pnt2d>& thePointOnMe,
+                                 std::shared_ptr<GeomAPI_Pnt2d>& thePointOnEllipse);
 };
 
 #endif