1 // Copyright (C) 2014-2019 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 email : webmaster.salome@opencascade.com
20 #ifndef GeomAPI_Curve_H_
21 #define GeomAPI_Curve_H_
23 #include <GeomAPI_Shape.h>
28 /**\class GeomAPI_Curve
30 * \brief Interface to the generic curve object
33 class GeomAPI_Curve : public GeomAPI_Interface
36 /// Creation of empty (null) shape
40 /// Creates a curve from the shape (edge)
42 GeomAPI_Curve(const std::shared_ptr<GeomAPI_Shape>& theShape);
44 /// Returns true if curve is not initialized
48 /// Returns \c true if curves are equal
50 bool isEqual(const std::shared_ptr<GeomAPI_Curve>& theOther) const;
52 /// Returns whether the curve is linear
54 virtual bool isLine() const;
56 /// Returns whether the curve is circular
58 virtual bool isCircle() const;
60 /// Returns whether the curve is elliptic
62 virtual bool isEllipse() const;
64 /// Returns start parameter of the curve
68 /// Returns end parameter of the curve
72 /// Returns \c true if the curve is trimmed
74 virtual bool isTrimmed() const;
76 /// Returns basis for the trimmed curve
78 virtual std::shared_ptr<GeomAPI_Curve> basisCurve() const;
80 /// Returns point on the curve by parameter
81 /// \param theParam parameter on the curve
83 std::shared_ptr<GeomAPI_Pnt> getPoint(double theParam);
85 /// Project point on curve
86 GEOMAPI_EXPORT const std::shared_ptr<GeomAPI_Pnt> project(
87 const std::shared_ptr<GeomAPI_Pnt>& thePoint) const;
90 /// \brief Compare addresses of curves
94 /// Return \c true if the address of the first curve is less than the address of the second
96 bool operator ()(const std::shared_ptr<GeomAPI_Curve>& theCurve1,
97 const std::shared_ptr<GeomAPI_Curve>& theCurve2) const;
105 //! Pointer on the object
106 typedef std::shared_ptr<GeomAPI_Curve> GeomCurvePtr;