QGIS/python/core/geometry/qgsgeometryengine.sip.in

258 lines
8.1 KiB
Plaintext
Raw Normal View History

2017-04-27 07:55:22 +02:00
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/geometry/qgsgeometryengine.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
2015-05-15 15:41:56 +02:00
class QgsGeometryEngine
{
2017-04-27 07:55:22 +02:00
%Docstring
Contains geometry relation and modification algorithms.
2017-12-15 10:36:55 -04:00
2017-04-27 07:55:22 +02:00
.. versionadded:: 2.10
2015-05-15 15:41:56 +02:00
%End
2017-04-27 07:55:22 +02:00
%TypeHeaderCode
#include "qgsgeometryengine.h"
%End
2015-05-15 15:41:56 +02:00
public:
enum EngineOperationResult
{
Success,
NothingHappened,
MethodNotImplemented,
EngineError,
NodedGeometryError,
InvalidBaseGeometry,
InvalidInput,
SplitCannotSplitPoint,
};
2015-05-15 15:41:56 +02:00
virtual ~QgsGeometryEngine();
virtual void geometryChanged() = 0;
2017-10-13 10:22:29 +10:00
%Docstring
2017-12-15 10:36:55 -04:00
Should be called whenever the geometry associated with the engine
has been modified and the engine must be updated to suit.
2017-10-13 10:22:29 +10:00
%End
2015-05-15 15:41:56 +02:00
virtual void prepareGeometry() = 0;
2017-10-13 10:22:29 +10:00
%Docstring
2017-12-15 10:36:55 -04:00
Prepares the geometry, so that subsequent calls to spatial relation methods
are much faster.
2017-10-13 10:22:29 +10:00
2017-12-15 10:36:55 -04:00
This should be called for any geometry which is used for multiple relation
tests against other geometries.
2017-10-13 10:22:29 +10:00
.. seealso:: :py:func:`geometryChanged`
2017-10-13 10:22:29 +10:00
%End
2015-05-15 15:41:56 +02:00
virtual QgsAbstractGeometry *intersection( const QgsAbstractGeometry *geom, QString *errorMsg = 0 ) const = 0 /Factory/;
2017-04-27 07:55:22 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Calculate the intersection of this and ``geom``.
2017-08-13 18:29:13 +02:00
.. versionadded:: 3.0
2017-04-27 07:55:22 +02:00
%End
2017-08-13 18:29:13 +02:00
virtual QgsAbstractGeometry *difference( const QgsAbstractGeometry *geom, QString *errorMsg = 0 ) const = 0 /Factory/;
2017-04-27 07:55:22 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Calculate the difference of this and ``geom``.
2017-08-13 18:29:13 +02:00
.. versionadded:: 3.0
2017-04-27 07:55:22 +02:00
%End
2017-08-13 18:29:13 +02:00
virtual QgsAbstractGeometry *combine( const QgsAbstractGeometry *geom, QString *errorMsg = 0 ) const = 0 /Factory/;
2017-04-27 07:55:22 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Calculate the combination of this and ``geom``.
.. versionadded:: 3.0
%End
virtual QgsAbstractGeometry *combine( const QVector<QgsAbstractGeometry *> &geomList, QString *errorMsg ) const = 0 /Factory/;
%Docstring
2017-12-15 10:36:55 -04:00
Calculate the combination of this and ``geometries``.
2017-08-13 18:29:13 +02:00
.. versionadded:: 3.0
2017-04-27 07:55:22 +02:00
%End
2017-08-13 18:29:13 +02:00
virtual QgsAbstractGeometry *combine( const QVector< QgsGeometry > &geometries, QString *errorMsg = 0 ) const = 0 /Factory/;
2017-04-27 07:55:22 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Calculate the combination of this and ``geometries``.
2017-08-13 18:29:13 +02:00
.. versionadded:: 3.0
2017-04-27 07:55:22 +02:00
%End
2017-08-13 18:29:13 +02:00
virtual QgsAbstractGeometry *symDifference( const QgsAbstractGeometry *geom, QString *errorMsg = 0 ) const = 0 /Factory/;
2017-04-27 07:55:22 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Calculate the symmetric difference of this and ``geom``.
2017-08-13 18:29:13 +02:00
.. versionadded:: 3.0
2017-04-27 07:55:22 +02:00
%End
virtual QgsAbstractGeometry *buffer( double distance, int segments, QString *errorMsg = 0 ) const = 0 /Factory/;
virtual QgsAbstractGeometry *buffer( double distance, int segments, int endCapStyle, int joinStyle, double miterLimit, QString *errorMsg = 0 ) const = 0 /Factory/;
2017-04-27 07:55:22 +02:00
virtual QgsAbstractGeometry *simplify( double tolerance, QString *errorMsg = 0 ) const = 0 /Factory/;
virtual QgsAbstractGeometry *interpolate( double distance, QString *errorMsg = 0 ) const = 0 /Factory/;
virtual QgsAbstractGeometry *envelope( QString *errorMsg = 0 ) const = 0 /Factory/;
2017-08-13 18:46:12 +02:00
virtual QgsPoint *centroid( QString *errorMsg = 0 ) const = 0 /Factory/;
2017-04-27 07:55:22 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Calculates the centroid of this.
May return a `None`.
2017-08-13 18:46:12 +02:00
.. versionadded:: 3.0
2017-04-27 07:55:22 +02:00
%End
2017-08-13 18:46:12 +02:00
virtual QgsPoint *pointOnSurface( QString *errorMsg = 0 ) const = 0 /Factory/;
2017-04-27 07:55:22 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Calculate a point that is guaranteed to be on the surface of this.
May return a `None`.
2017-08-13 18:46:12 +02:00
.. versionadded:: 3.0
2017-04-27 07:55:22 +02:00
%End
2017-08-13 18:46:12 +02:00
2017-04-27 07:55:22 +02:00
virtual QgsAbstractGeometry *convexHull( QString *errorMsg = 0 ) const = 0 /Factory/;
%Docstring
2017-12-15 10:36:55 -04:00
Calculate the convex hull of this.
2017-04-27 07:55:22 +02:00
%End
2017-08-13 18:29:13 +02:00
virtual double distance( const QgsAbstractGeometry *geom, QString *errorMsg = 0 ) const = 0;
2017-04-27 07:55:22 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Calculates the distance between this and ``geom``.
2017-08-13 18:29:13 +02:00
.. versionadded:: 3.0
2017-04-27 07:55:22 +02:00
%End
2017-08-13 18:29:13 +02:00
virtual bool intersects( const QgsAbstractGeometry *geom, QString *errorMsg = 0 ) const = 0;
2017-04-27 07:55:22 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Checks if ``geom`` intersects this.
2017-08-13 18:29:13 +02:00
.. versionadded:: 3.0
2017-04-27 07:55:22 +02:00
%End
2017-08-13 18:29:13 +02:00
virtual bool touches( const QgsAbstractGeometry *geom, QString *errorMsg = 0 ) const = 0;
2017-04-27 07:55:22 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Checks if ``geom`` touches this.
2017-08-13 18:29:13 +02:00
.. versionadded:: 3.0
2017-04-27 07:55:22 +02:00
%End
2017-08-13 18:29:13 +02:00
virtual bool crosses( const QgsAbstractGeometry *geom, QString *errorMsg = 0 ) const = 0;
2017-04-27 07:55:22 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Checks if ``geom`` crosses this.
2017-08-13 18:29:13 +02:00
.. versionadded:: 3.0
2017-04-27 07:55:22 +02:00
%End
2017-08-13 18:29:13 +02:00
virtual bool within( const QgsAbstractGeometry *geom, QString *errorMsg = 0 ) const = 0;
2017-04-27 07:55:22 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Checks if ``geom`` is within this.
2017-08-13 18:29:13 +02:00
.. versionadded:: 3.0
2017-04-27 07:55:22 +02:00
%End
2017-08-13 18:29:13 +02:00
virtual bool overlaps( const QgsAbstractGeometry *geom, QString *errorMsg = 0 ) const = 0;
2017-04-27 07:55:22 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Checks if ``geom`` overlaps this.
2017-08-13 18:29:13 +02:00
.. versionadded:: 3.0
2017-04-27 07:55:22 +02:00
%End
2017-08-13 18:29:13 +02:00
virtual bool contains( const QgsAbstractGeometry *geom, QString *errorMsg = 0 ) const = 0;
2017-04-27 07:55:22 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Checks if ``geom`` contains this.
2017-08-13 18:29:13 +02:00
.. versionadded:: 3.0
2017-04-27 07:55:22 +02:00
%End
2017-08-13 18:29:13 +02:00
virtual bool disjoint( const QgsAbstractGeometry *geom, QString *errorMsg = 0 ) const = 0;
2017-04-27 07:55:22 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Checks if ``geom`` is disjoint from this.
2017-08-13 18:29:13 +02:00
.. versionadded:: 3.0
2017-04-27 07:55:22 +02:00
%End
virtual QString relate( const QgsAbstractGeometry *geom, QString *errorMsg = 0 ) const = 0;
2017-04-27 07:55:22 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Returns the Dimensional Extended 9 Intersection Model (DE-9IM) representation of the
relationship between the geometries.
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param geom: geometry to relate to
:param errorMsg: destination storage for any error message
:return: DE-9IM string for relationship, or an empty string if an error occurred
2017-04-27 07:55:22 +02:00
.. versionadded:: 2.12
%End
virtual bool relatePattern( const QgsAbstractGeometry *geom, const QString &pattern, QString *errorMsg = 0 ) const = 0;
2017-04-27 07:55:22 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Tests whether two geometries are related by a specified Dimensional Extended 9 Intersection Model (DE-9IM)
pattern.
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param geom: geometry to relate to
:param pattern: DE-9IM pattern for match
:param errorMsg: destination storage for any error message
:return: true if geometry relationship matches with pattern
2017-04-27 07:55:22 +02:00
.. versionadded:: 2.14
%End
virtual double area( QString *errorMsg = 0 ) const = 0;
virtual double length( QString *errorMsg = 0 ) const = 0;
virtual bool isValid( QString *errorMsg = 0 ) const = 0;
2017-08-13 18:29:13 +02:00
virtual bool isEqual( const QgsAbstractGeometry *geom, QString *errorMsg = 0 ) const = 0;
2017-04-27 07:55:22 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Checks if this is equal to ``geom``.
If both are Null geometries, `false` is returned.
2017-08-13 18:29:13 +02:00
.. versionadded:: 3.0
2017-04-27 07:55:22 +02:00
%End
virtual bool isEmpty( QString *errorMsg ) const = 0;
virtual bool isSimple( QString *errorMsg = 0 ) const = 0;
%Docstring
2017-12-15 10:36:55 -04:00
Determines whether the geometry is simple (according to OGC definition).
.. versionadded:: 3.0
%End
virtual QgsGeometryEngine::EngineOperationResult splitGeometry( const QgsLineString &splitLine,
QVector<QgsGeometry > &newGeometries /Out/,
bool topological,
QgsPointSequence &topologyTestPoints, QString *errorMsg = 0 ) const;
2017-04-27 07:55:22 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Splits this geometry according to a given line.
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param splitLine: the line that splits the geometry
\param[out] newGeometries list of new geometries that have been created with the split
:param topological: true if topological editing is enabled
\param[out] topologyTestPoints points that need to be tested for topological completeness in the dataset
\param[out] errorMsg error messages emitted, if any
:return: 0 in case of success, 1 if geometry has not been split, error else
2017-04-27 07:55:22 +02:00
%End
virtual QgsAbstractGeometry *offsetCurve( double distance, int segments, int joinStyle, double miterLimit, QString *errorMsg = 0 ) const = 0 /Factory/;
2017-04-27 07:55:22 +02:00
protected:
QgsGeometryEngine( const QgsAbstractGeometry *geometry );
2015-05-15 15:41:56 +02:00
};
2017-04-27 07:55:22 +02:00
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/geometry/qgsgeometryengine.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/