X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FGeomAPI%2FGeomAPI_Vertex.h;h=ad8b9f5036b6bd80ff993f737653d5a1826de39e;hb=06e7f5859095193fc7f498bd89a7d28009794f53;hp=cee8fd66b36bc45a441ed254c957750c0a48d9fa;hpb=b3695c3af5289903f1c0fa01bbb7c40203c5e544;p=modules%2Fshaper.git diff --git a/src/GeomAPI/GeomAPI_Vertex.h b/src/GeomAPI/GeomAPI_Vertex.h index cee8fd66b..ad8b9f503 100644 --- a/src/GeomAPI/GeomAPI_Vertex.h +++ b/src/GeomAPI/GeomAPI_Vertex.h @@ -1,4 +1,4 @@ -// Copyright (C) 2014-2017 CEA/DEN, EDF R&D +// 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 @@ -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 // #ifndef GeomAPI_Vertex_H_ @@ -39,6 +38,10 @@ public: GEOMAPI_EXPORT GeomAPI_Vertex(const std::shared_ptr& theShape); + /// Creation of vertex by the given point. + GEOMAPI_EXPORT + GeomAPI_Vertex(const std::shared_ptr& thePoint); + /// Creation of vertex by 3d coordinates. GEOMAPI_EXPORT GeomAPI_Vertex(double theX, double theY, double theZ); @@ -49,7 +52,25 @@ public: /// Returns true if the current edge is geometrically equal to the given edge. GEOMAPI_EXPORT - bool isEqual(const std::shared_ptr theVert) const; + virtual bool isEqual(const std::shared_ptr theVert) const; + +public: + /// \brief Compare vertices geometrically + class GeometricComparator + { + public: + GEOMAPI_EXPORT + GeometricComparator(const double theTolerance = 1.e-7) : myTolerance(theTolerance) + {} + + /// Return \c true if the first vertex is less than the second + GEOMAPI_EXPORT + bool operator ()(const std::shared_ptr& theVertex1, + const std::shared_ptr& theVertex2) const; + private: + double myTolerance; + }; + }; //! Pointer on the object