diff --git a/python/core/geometry/qgsgeometryengine.sip b/python/core/geometry/qgsgeometryengine.sip index 9da991420ec..f6c15f2d99a 100644 --- a/python/core/geometry/qgsgeometryengine.sip +++ b/python/core/geometry/qgsgeometryengine.sip @@ -28,22 +28,41 @@ class QgsGeometryEngine virtual QgsAbstractGeometry *intersection( const QgsAbstractGeometry *geom, QString *errorMsg = 0 ) const = 0 /Factory/; %Docstring + Calculate the intersection of this and ``geom``. + +.. versionadded:: 3.0 :rtype: QgsAbstractGeometry %End + virtual QgsAbstractGeometry *difference( const QgsAbstractGeometry *geom, QString *errorMsg = 0 ) const = 0 /Factory/; %Docstring + Calculate the difference of this and ``geom``. + +.. versionadded:: 3.0 :rtype: QgsAbstractGeometry %End + virtual QgsAbstractGeometry *combine( const QgsAbstractGeometry *geom, QString *errorMsg = 0 ) const = 0 /Factory/; %Docstring + Calculate the combination of this and ``geom``. + +.. versionadded:: 3.0 :rtype: QgsAbstractGeometry %End - virtual QgsAbstractGeometry *combine( const QList< QgsAbstractGeometry * > &, QString *errorMsg = 0 ) const = 0 /Factory/; + + virtual QgsAbstractGeometry *combine( const QList< QgsAbstractGeometry * > &geometries, QString *errorMsg = 0 ) const = 0 /Factory/; %Docstring + Calculate the combination of this and ``geometries``. + +.. versionadded:: 3.0 :rtype: QgsAbstractGeometry %End + virtual QgsAbstractGeometry *symDifference( const QgsAbstractGeometry *geom, QString *errorMsg = 0 ) const = 0 /Factory/; %Docstring + Calculate the symmetric difference of this and ``geom``. + +.. versionadded:: 3.0 :rtype: QgsAbstractGeometry %End virtual QgsAbstractGeometry *buffer( double distance, int segments, QString *errorMsg = 0 ) const = 0 /Factory/; @@ -78,36 +97,68 @@ class QgsGeometryEngine %Docstring :rtype: QgsAbstractGeometry %End + virtual double distance( const QgsAbstractGeometry *geom, QString *errorMsg = 0 ) const = 0; %Docstring + Calculates the distance between this and ``geom``. + +.. versionadded:: 3.0 :rtype: float %End + virtual bool intersects( const QgsAbstractGeometry *geom, QString *errorMsg = 0 ) const = 0; %Docstring + Checks if ``geom`` intersects this. + +.. versionadded:: 3.0 :rtype: bool %End + virtual bool touches( const QgsAbstractGeometry *geom, QString *errorMsg = 0 ) const = 0; %Docstring + Checks if ``geom`` touches this. + +.. versionadded:: 3.0 :rtype: bool %End + virtual bool crosses( const QgsAbstractGeometry *geom, QString *errorMsg = 0 ) const = 0; %Docstring + Checks if ``geom`` crosses this. + +.. versionadded:: 3.0 :rtype: bool %End + virtual bool within( const QgsAbstractGeometry *geom, QString *errorMsg = 0 ) const = 0; %Docstring + Checks if ``geom`` is within this. + +.. versionadded:: 3.0 :rtype: bool %End + virtual bool overlaps( const QgsAbstractGeometry *geom, QString *errorMsg = 0 ) const = 0; %Docstring + Checks if ``geom`` overlaps this. + +.. versionadded:: 3.0 :rtype: bool %End + virtual bool contains( const QgsAbstractGeometry *geom, QString *errorMsg = 0 ) const = 0; %Docstring + Checks if ``geom`` contains this. + +.. versionadded:: 3.0 :rtype: bool %End + virtual bool disjoint( const QgsAbstractGeometry *geom, QString *errorMsg = 0 ) const = 0; %Docstring + Checks if ``geom`` is disjoint from this. + +.. versionadded:: 3.0 :rtype: bool %End @@ -146,8 +197,13 @@ class QgsGeometryEngine %Docstring :rtype: bool %End + virtual bool isEqual( const QgsAbstractGeometry *geom, QString *errorMsg = 0 ) const = 0; %Docstring + Checks if this is equal to ``geom``. + If both are Null geometries, `false` is returned. + +.. versionadded:: 3.0 :rtype: bool %End virtual bool isEmpty( QString *errorMsg ) const = 0; diff --git a/src/core/geometry/qgsgeometryengine.h b/src/core/geometry/qgsgeometryengine.h index bd6c4d665cb..069755f14f4 100644 --- a/src/core/geometry/qgsgeometryengine.h +++ b/src/core/geometry/qgsgeometryengine.h @@ -36,10 +36,39 @@ class CORE_EXPORT QgsGeometryEngine virtual void geometryChanged() = 0; virtual void prepareGeometry() = 0; + /** + * Calculate the intersection of this and \a geom. + * + * \since QGIS 3.0 \a geom is a pointer + */ virtual QgsAbstractGeometry *intersection( const QgsAbstractGeometry *geom, QString *errorMsg = nullptr ) const = 0 SIP_FACTORY; + + /** + * Calculate the difference of this and \a geom. + * + * \since QGIS 3.0 \a geom is a pointer + */ virtual QgsAbstractGeometry *difference( const QgsAbstractGeometry *geom, QString *errorMsg = nullptr ) const = 0 SIP_FACTORY; + + /** + * Calculate the combination of this and \a geom. + * + * \since QGIS 3.0 \a geom is a pointer + */ virtual QgsAbstractGeometry *combine( const QgsAbstractGeometry *geom, QString *errorMsg = nullptr ) const = 0 SIP_FACTORY; - virtual QgsAbstractGeometry *combine( const QList< QgsAbstractGeometry * > &, QString *errorMsg = nullptr ) const = 0 SIP_FACTORY; + + /** + * Calculate the combination of this and \a geometries. + * + * \since QGIS 3.0 \a geom is a pointer + */ + virtual QgsAbstractGeometry *combine( const QList< QgsAbstractGeometry * > &geometries, QString *errorMsg = nullptr ) const = 0 SIP_FACTORY; + + /** + * Calculate the symmetric difference of this and \a geom. + * + * \since QGIS 3.0 \a geom is a pointer + */ virtual QgsAbstractGeometry *symDifference( const QgsAbstractGeometry *geom, QString *errorMsg = nullptr ) const = 0 SIP_FACTORY; virtual QgsAbstractGeometry *buffer( double distance, int segments, QString *errorMsg = nullptr ) const = 0 SIP_FACTORY; virtual QgsAbstractGeometry *buffer( double distance, int segments, int endCapStyle, int joinStyle, double miterLimit, QString *errorMsg = nullptr ) const = 0 SIP_FACTORY; @@ -49,13 +78,61 @@ class CORE_EXPORT QgsGeometryEngine virtual bool centroid( QgsPoint &pt, QString *errorMsg = nullptr ) const = 0; virtual bool pointOnSurface( QgsPoint &pt, QString *errorMsg = nullptr ) const = 0; virtual QgsAbstractGeometry *convexHull( QString *errorMsg = nullptr ) const = 0 SIP_FACTORY; + + /** + * Calculates the distance between this and \a geom. + * + * \since QGIS 3.0 \a geom is a pointer + */ virtual double distance( const QgsAbstractGeometry *geom, QString *errorMsg = nullptr ) const = 0; + + /** + * Checks if \a geom intersects this. + * + * \since QGIS 3.0 \a geom is a pointer + */ virtual bool intersects( const QgsAbstractGeometry *geom, QString *errorMsg = nullptr ) const = 0; + + /** + * Checks if \a geom touches this. + * + * \since QGIS 3.0 \a geom is a pointer + */ virtual bool touches( const QgsAbstractGeometry *geom, QString *errorMsg = nullptr ) const = 0; + + /** + * Checks if \a geom crosses this. + * + * \since QGIS 3.0 \a geom is a pointer + */ virtual bool crosses( const QgsAbstractGeometry *geom, QString *errorMsg = nullptr ) const = 0; + + /** + * Checks if \a geom is within this. + * + * \since QGIS 3.0 \a geom is a pointer + */ virtual bool within( const QgsAbstractGeometry *geom, QString *errorMsg = nullptr ) const = 0; + + /** + * Checks if \a geom overlaps this. + * + * \since QGIS 3.0 \a geom is a pointer + */ virtual bool overlaps( const QgsAbstractGeometry *geom, QString *errorMsg = nullptr ) const = 0; + + /** + * Checks if \a geom contains this. + * + * \since QGIS 3.0 \a geom is a pointer + */ virtual bool contains( const QgsAbstractGeometry *geom, QString *errorMsg = nullptr ) const = 0; + + /** + * Checks if \a geom is disjoint from this. + * + * \since QGIS 3.0 \a geom is a pointer + */ virtual bool disjoint( const QgsAbstractGeometry *geom, QString *errorMsg = nullptr ) const = 0; /** Returns the Dimensional Extended 9 Intersection Model (DE-9IM) representation of the @@ -80,6 +157,13 @@ class CORE_EXPORT QgsGeometryEngine virtual double area( QString *errorMsg = nullptr ) const = 0; virtual double length( QString *errorMsg = nullptr ) const = 0; virtual bool isValid( QString *errorMsg = nullptr ) const = 0; + + /** + * Checks if this is equal to \a geom. + * If both are Null geometries, `false` is returned. + * + * \since QGIS 3.0 \a geom is a pointer + */ virtual bool isEqual( const QgsAbstractGeometry *geom, QString *errorMsg = nullptr ) const = 0; virtual bool isEmpty( QString *errorMsg ) const = 0;