mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-06 00:07:29 -04:00
QgsPointXY: add a method distanceCompare using fuzzyDistancEqual
This commit is contained in:
parent
6b1c38a482
commit
41ff06f813
@ -221,7 +221,23 @@ Compares this point with another point with a fuzzy tolerance
|
||||
|
||||
:return: ``True`` if points are equal within specified tolerance
|
||||
|
||||
.. seealso:: :py:func:`distanceCompare`
|
||||
|
||||
.. versionadded:: 2.9
|
||||
%End
|
||||
|
||||
bool distanceCompare( const QgsPointXY &other, double epsilon = 4 * DBL_EPSILON ) const /HoldGIL/;
|
||||
%Docstring
|
||||
Compares this point with another point with a fuzzy tolerance using distance comparison
|
||||
|
||||
:param other: point to compare with
|
||||
:param epsilon: maximum difference for coordinates between the points
|
||||
|
||||
:return: ``True`` if points are equal within specified tolerance
|
||||
|
||||
.. seealso:: :py:func:`compare`
|
||||
|
||||
.. versionadded:: 3.36
|
||||
%End
|
||||
|
||||
bool operator==( const QgsPointXY &other ) /HoldGIL/;
|
||||
|
@ -221,7 +221,23 @@ Compares this point with another point with a fuzzy tolerance
|
||||
|
||||
:return: ``True`` if points are equal within specified tolerance
|
||||
|
||||
.. seealso:: :py:func:`distanceCompare`
|
||||
|
||||
.. versionadded:: 2.9
|
||||
%End
|
||||
|
||||
bool distanceCompare( const QgsPointXY &other, double epsilon = 4 * DBL_EPSILON ) const /HoldGIL/;
|
||||
%Docstring
|
||||
Compares this point with another point with a fuzzy tolerance using distance comparison
|
||||
|
||||
:param other: point to compare with
|
||||
:param epsilon: maximum difference for coordinates between the points
|
||||
|
||||
:return: ``True`` if points are equal within specified tolerance
|
||||
|
||||
.. seealso:: :py:func:`compare`
|
||||
|
||||
.. versionadded:: 3.36
|
||||
%End
|
||||
|
||||
bool operator==( const QgsPointXY &other ) /HoldGIL/;
|
||||
|
@ -255,6 +255,9 @@ class CORE_EXPORT QgsPointXY
|
||||
* \param other point to compare with
|
||||
* \param epsilon maximum difference for coordinates between the points
|
||||
* \returns TRUE if points are equal within specified tolerance
|
||||
*
|
||||
* \see distanceCompare
|
||||
*
|
||||
* \since QGIS 2.9
|
||||
*/
|
||||
bool compare( const QgsPointXY &other, double epsilon = 4 * std::numeric_limits<double>::epsilon() ) const SIP_HOLDGIL
|
||||
@ -262,6 +265,21 @@ class CORE_EXPORT QgsPointXY
|
||||
return QgsGeometryUtilsBase::fuzzyEqual( epsilon, mX, mY, other.x(), other.y() );
|
||||
}
|
||||
|
||||
/**
|
||||
* Compares this point with another point with a fuzzy tolerance using distance comparison
|
||||
* \param other point to compare with
|
||||
* \param epsilon maximum difference for coordinates between the points
|
||||
* \returns TRUE if points are equal within specified tolerance
|
||||
*
|
||||
* \see compare
|
||||
*
|
||||
* \since QGIS 3.36
|
||||
*/
|
||||
bool distanceCompare( const QgsPointXY &other, double epsilon = 4 * std::numeric_limits<double>::epsilon() ) const SIP_HOLDGIL
|
||||
{
|
||||
return QgsGeometryUtilsBase::fuzzyDistanceEqual( epsilon, mX, mY, other.x(), other.y() );
|
||||
}
|
||||
|
||||
//! equality operator
|
||||
bool operator==( const QgsPointXY &other ) SIP_HOLDGIL
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user