Salome HOME
updated copyright message
[modules/shaper.git] / src / GeomAPI / GeomAPI_Curve.h
index c258f1fc6d919ed39e7611ac4f5000f6bc9dd292..11775704dd98d5f0a9b87c3cc053a0c2823dbb83 100644 (file)
@@ -1,8 +1,21 @@
-// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
-
-// File:        GeomAPI_Curve.hxx
-// Created:     04 Sep 2014
-// Author:      Mikhail PONIKAROV
+// Copyright (C) 2014-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
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// 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
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
 
 #ifndef GeomAPI_Curve_H_
 #define GeomAPI_Curve_H_
@@ -32,6 +45,10 @@ class GeomAPI_Curve : public GeomAPI_Interface
   GEOMAPI_EXPORT
   bool isNull() const;
 
+  /// Returns \c true if curves are equal
+  GEOMAPI_EXPORT
+  bool isEqual(const std::shared_ptr<GeomAPI_Curve>& theOther) const;
+
   /// Returns whether the curve is linear
   GEOMAPI_EXPORT
   virtual bool isLine() const;
@@ -40,22 +57,52 @@ class GeomAPI_Curve : public GeomAPI_Interface
   GEOMAPI_EXPORT
   virtual bool isCircle() const;
 
+  /// Returns whether the curve is elliptic
+  GEOMAPI_EXPORT
+  virtual bool isEllipse() const;
+
   /// Returns start parameter of the curve
   GEOMAPI_EXPORT
-  double startParam() const { return myStart; }
+  double startParam();
 
   /// Returns end parameter of the curve
   GEOMAPI_EXPORT
-  double endParam() const { return myEnd; }
+  double endParam();
+
+  /// Returns \c true if the curve is trimmed
+  GEOMAPI_EXPORT
+  virtual bool isTrimmed() const;
+
+  /// Returns basis for the trimmed curve
+  GEOMAPI_EXPORT
+  virtual std::shared_ptr<GeomAPI_Curve> basisCurve() const;
 
   /// Returns point on the curve by parameter
   /// \param theParam parameter on the curve
   GEOMAPI_EXPORT
   std::shared_ptr<GeomAPI_Pnt> getPoint(double theParam);
 
+  /// Project point on curve
+  GEOMAPI_EXPORT const std::shared_ptr<GeomAPI_Pnt> project(
+      const std::shared_ptr<GeomAPI_Pnt>& thePoint) const;
+
+public:
+  /// \brief Compare addresses of curves
+  class Comparator
+  {
+  public:
+    /// Return \c true if the address of the first curve is less than the address of the second
+    GEOMAPI_EXPORT
+    bool operator ()(const std::shared_ptr<GeomAPI_Curve>& theCurve1,
+                     const std::shared_ptr<GeomAPI_Curve>& theCurve2) const;
+  };
+
 private:
   double myStart;
   double myEnd;
 };
 
+//! Pointer on the object
+typedef std::shared_ptr<GeomAPI_Curve> GeomCurvePtr;
+
 #endif