63 Q_PROPERTY(
double x READ x WRITE setX )
64 Q_PROPERTY(
double y READ y WRITE setY )
167 return QPointF( mX, mY );
174 QString toString(
int precision = -1 )
const;
180 QString asWkt()
const;
275 if ( isEmpty() && other.
isEmpty() )
277 if ( isEmpty() && !other.
isEmpty() )
279 if ( ! isEmpty() && other.
isEmpty() )
287 if ( isEmpty() && other.
isEmpty() )
289 if ( isEmpty() && !other.
isEmpty() )
291 if ( ! isEmpty() && other.
isEmpty() )
306 if ( &other !=
this )
344 operator QVariant()
const
346 return QVariant::fromValue( *
this );
350 SIP_PYOBJECT __repr__();
352 QString
str = QStringLiteral(
"<QgsPointXY: %1>" ).arg( sipCpp->asWkt() );
353 sipRes = PyUnicode_FromString(
str.toUtf8().constData() );
362 SIP_PYOBJECT __getitem__(
int );
366 sipRes = Py_BuildValue(
"d", sipCpp->x() );
370 sipRes = Py_BuildValue(
"d", sipCpp->y() );
374 QString msg = QString(
"Bad index: %1" ).arg( a0 );
375 PyErr_SetString( PyExc_IndexError, msg.toLatin1().constData() );
379 long __hash__()
const;
381 sipRes =
qHash( *sipCpp );
394 bool mIsEmpty =
true;
405 os << p.toString().toLocal8Bit().data();
412 const uint h1 =
qHash(
static_cast< quint64
>( p.mX ) );
413 const uint h2 =
qHash(
static_cast< quint64
>( p.mY ) );
414 hash = h1 ^ ( h2 << 1 );
static double sqrDistance2D(double x1, double y1, double x2, double y2)
Returns the squared 2D distance between (x1, y1) and (x2, y2).
static double distance2D(double x1, double y1, double x2, double y2)
Returns the 2D distance between (x1, y1) and (x2, y2).
static bool fuzzyEqual(T epsilon, const Args &... args) noexcept
Performs fuzzy comparison between pairs of values within a specified epsilon.
static bool fuzzyDistanceEqual(T epsilon, const Args &... args) noexcept
Compare equality between multiple pairs of values with a specified epsilon.
A class to represent a 2D point.
double x() const
Gets the x value of the point.
QgsPointXY(QPoint point)
Create a point from a QPoint.
QgsPointXY operator*(double scalar) const
Multiplies the coordinates in this point by a scalar quantity.
QgsPointXY & operator-=(QgsVector v)
Subtracts a vector from this point in place.
QgsPointXY(QPointF point)
Create a point from a QPointF.
double sqrDist(double x, double y) const
Returns the squared distance between this point a specified x, y coordinate.
double distance(double x, double y) const
Returns the distance between this point and a specified x, y coordinate.
QgsPointXY operator-(QgsVector v) const
Subtracts a vector from this point.
void setY(double y)
Sets the y value of the point.
double distance(const QgsPointXY &other) const
Returns the distance between this point and another point.
void multiply(double scalar)
Multiply x and y by the given value.
QgsPointXY & operator*=(double scalar)
Multiplies the coordinates in this point by a scalar quantity in place.
QgsPointXY operator/(double scalar) const
Divides the coordinates in this point by a scalar quantity.
QgsPointXY & operator/=(double scalar)
Divides the coordinates in this point by a scalar quantity in place.
bool compare(const QgsPointXY &other, double epsilon=4 *std::numeric_limits< double >::epsilon()) const
Compares this point with another point with a fuzzy tolerance.
bool operator==(const QgsPointXY &other) const
bool operator!=(const QgsPointXY &other) const
void set(double x, double y)
Sets the x and y value of the point.
QgsPointXY & operator+=(QgsVector v)
Adds a vector to this point in place.
QgsPointXY & operator=(const QgsPointXY &other)
QgsVector operator-(const QgsPointXY &p) const
Calculates the vector obtained by subtracting a point from this point.
double y() const
Gets the y value of the point.
double sqrDist(const QgsPointXY &other) const
Returns the squared distance between this point another point.
void setX(double x)
Sets the x value of the point.
bool distanceCompare(const QgsPointXY &other, double epsilon=4 *std::numeric_limits< double >::epsilon()) const
Compares this point with another point with a fuzzy tolerance using distance comparison.
bool isEmpty() const
Returns true if the geometry is empty.
QPointF toQPointF() const
Converts a point to a QPointF.
QgsPointXY operator+(QgsVector v) const
Adds a vector to this point.
Point geometry type, with support for z-dimension and m-values.
A class to represent a vector.
double y() const
Returns the vector's y-component.
double x() const
Returns the vector's x-component.
uint qHash(const QVariant &variant)
Hash for QVariant.
const double DEFAULT_SEGMENT_EPSILON
Default snapping tolerance for segments.
Q_DECLARE_METATYPE(QgsDatabaseQueryLogEntry)
uint qHash(const QgsPointXY &p)