X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FGeomAPI%2FGeomAPI_Curve.h;h=3922217f1deb3c0ac52eccabdd75048c6eb35b3b;hb=ea593bc59e7e9461f6c4e2afd3f24d621edb1011;hp=20e0f0a46ee46b6044b3a1a969cb9da165a2d167;hpb=301fde7eeae07fdae18ebd02f93e09d1a182e38d;p=modules%2Fshaper.git diff --git a/src/GeomAPI/GeomAPI_Curve.h b/src/GeomAPI/GeomAPI_Curve.h index 20e0f0a46..3922217f1 100644 --- a/src/GeomAPI/GeomAPI_Curve.h +++ b/src/GeomAPI/GeomAPI_Curve.h @@ -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-2019 CEA/DEN, EDF R&D +// +// 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_ @@ -17,37 +30,79 @@ class GeomAPI_Pnt; * \brief Interface to the generic curve object */ -class GEOMAPI_EXPORT GeomAPI_Curve : public GeomAPI_Interface +class GeomAPI_Curve : public GeomAPI_Interface { public: /// Creation of empty (null) shape + GEOMAPI_EXPORT GeomAPI_Curve(); /// Creates a curve from the shape (edge) + GEOMAPI_EXPORT GeomAPI_Curve(const std::shared_ptr& theShape); /// Returns true if curve is not initialized + GEOMAPI_EXPORT bool isNull() const; + /// Returns \c true if curves are equal + GEOMAPI_EXPORT + bool isEqual(const std::shared_ptr& theOther) const; + /// Returns whether the curve is linear + GEOMAPI_EXPORT virtual bool isLine() const; /// Returns whether the curve is circular + GEOMAPI_EXPORT virtual bool isCircle() const; + /// Returns whether the curve is elliptic + GEOMAPI_EXPORT + virtual bool isEllipse() const; + /// Returns start parameter of the curve - double startParam() const { return myStart; } + GEOMAPI_EXPORT + double startParam(); /// Returns end parameter of the curve - double endParam() const { return myEnd; } + GEOMAPI_EXPORT + 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 basisCurve() const; /// Returns point on the curve by parameter /// \param theParam parameter on the curve + GEOMAPI_EXPORT std::shared_ptr getPoint(double theParam); + /// Project point on curve + GEOMAPI_EXPORT const std::shared_ptr project( + const std::shared_ptr& 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& theCurve1, + const std::shared_ptr& theCurve2) const; + }; + private: double myStart; double myEnd; }; +//! Pointer on the object +typedef std::shared_ptr GeomCurvePtr; + #endif