2015-05-15 15:41:56 +02:00
|
|
|
class QgsGeometryEngine
|
|
|
|
{
|
|
|
|
%TypeHeaderCode
|
|
|
|
#include <qgsgeometryengine.h>
|
|
|
|
%End
|
|
|
|
|
|
|
|
public:
|
2016-08-06 11:01:42 +02:00
|
|
|
QgsGeometryEngine( const QgsAbstractGeometry* geometry );
|
2015-05-15 15:41:56 +02:00
|
|
|
virtual ~QgsGeometryEngine();
|
|
|
|
|
|
|
|
virtual void geometryChanged() = 0;
|
|
|
|
virtual void prepareGeometry() = 0;
|
|
|
|
|
2016-08-06 11:01:42 +02:00
|
|
|
virtual QgsAbstractGeometry* intersection( const QgsAbstractGeometry& geom, QString* errorMsg = 0 ) const = 0;
|
|
|
|
virtual QgsAbstractGeometry* difference( const QgsAbstractGeometry& geom, QString* errorMsg = 0 ) const = 0;
|
|
|
|
virtual QgsAbstractGeometry* combine( const QgsAbstractGeometry& geom, QString* errorMsg = 0 ) const = 0;
|
|
|
|
virtual QgsAbstractGeometry* combine( const QList< QgsAbstractGeometry* >&, QString* errorMsg = 0 ) const = 0;
|
|
|
|
virtual QgsAbstractGeometry* symDifference( const QgsAbstractGeometry& geom, QString* errorMsg = 0 ) const = 0;
|
|
|
|
virtual QgsAbstractGeometry* buffer( double distance, int segments, QString* errorMsg = 0 ) const = 0;
|
|
|
|
virtual QgsAbstractGeometry* buffer( double distance, int segments, int endCapStyle, int joinStyle, double mitreLimit, QString* errorMsg = 0 ) const = 0;
|
|
|
|
virtual QgsAbstractGeometry* simplify( double tolerance, QString* errorMsg = 0 ) const = 0;
|
|
|
|
virtual QgsAbstractGeometry* interpolate( double distance, QString* errorMsg = 0 ) const = 0;
|
|
|
|
virtual QgsAbstractGeometry* envelope( QString* errorMsg = 0 ) const = 0;
|
2015-09-09 17:45:31 +02:00
|
|
|
virtual bool centroid( QgsPointV2& pt, QString* errorMsg = 0 ) const = 0;
|
|
|
|
virtual bool pointOnSurface( QgsPointV2& pt, QString* errorMsg = 0 ) const = 0;
|
2016-08-06 11:01:42 +02:00
|
|
|
virtual QgsAbstractGeometry* convexHull( QString* errorMsg = 0 ) const = 0;
|
|
|
|
virtual double distance( const QgsAbstractGeometry& geom, QString* errorMsg = 0 ) const = 0;
|
|
|
|
virtual bool intersects( const QgsAbstractGeometry& geom, QString* errorMsg = 0 ) const = 0;
|
|
|
|
virtual bool touches( const QgsAbstractGeometry& geom, QString* errorMsg = 0 ) const = 0;
|
|
|
|
virtual bool crosses( const QgsAbstractGeometry& geom, QString* errorMsg = 0 ) const = 0;
|
|
|
|
virtual bool within( const QgsAbstractGeometry& geom, QString* errorMsg = 0 ) const = 0;
|
|
|
|
virtual bool overlaps( const QgsAbstractGeometry& geom, QString* errorMsg = 0 ) const = 0;
|
|
|
|
virtual bool contains( const QgsAbstractGeometry& geom, QString* errorMsg = 0 ) const = 0;
|
|
|
|
virtual bool disjoint( const QgsAbstractGeometry& geom, QString* errorMsg = 0 ) const = 0;
|
2015-10-16 17:46:06 +11:00
|
|
|
|
|
|
|
/** Returns the Dimensional Extended 9 Intersection Model (DE-9IM) representation of the
|
|
|
|
* relationship between the geometries.
|
|
|
|
* @param geom geometry to relate to
|
|
|
|
* @param errorMsg destination storage for any error message
|
|
|
|
* @returns DE-9IM string for relationship, or an empty string if an error occurred
|
|
|
|
* @note added in QGIS 2.12
|
|
|
|
*/
|
2016-08-06 11:01:42 +02:00
|
|
|
virtual QString relate( const QgsAbstractGeometry& geom, QString* errorMsg = 0 ) const = 0;
|
2015-10-16 17:46:06 +11:00
|
|
|
|
2015-11-04 16:03:55 +11:00
|
|
|
/** Tests whether two geometries are related by a specified Dimensional Extended 9 Intersection Model (DE-9IM)
|
|
|
|
* pattern.
|
|
|
|
* @param geom geometry to relate to
|
|
|
|
* @param pattern DE-9IM pattern for match
|
|
|
|
* @param errorMsg destination storage for any error message
|
|
|
|
* @returns true if geometry relationship matches with pattern
|
|
|
|
* @note added in QGIS 2.14
|
|
|
|
*/
|
2016-08-06 11:01:42 +02:00
|
|
|
virtual bool relatePattern( const QgsAbstractGeometry& geom, const QString& pattern, QString* errorMsg = 0 ) const = 0;
|
2015-11-04 16:03:55 +11:00
|
|
|
|
2015-09-09 17:45:31 +02:00
|
|
|
virtual double area( QString* errorMsg = 0 ) const = 0;
|
|
|
|
virtual double length( QString* errorMsg = 0 ) const = 0;
|
|
|
|
virtual bool isValid( QString* errorMsg = 0 ) const = 0;
|
2016-08-06 11:01:42 +02:00
|
|
|
virtual bool isEqual( const QgsAbstractGeometry& geom, QString* errorMsg = 0 ) const = 0;
|
2015-09-09 17:45:31 +02:00
|
|
|
virtual bool isEmpty( QString* errorMsg = 0 ) const = 0;
|
2015-05-15 15:41:56 +02:00
|
|
|
|
2016-08-06 11:01:42 +02:00
|
|
|
virtual int splitGeometry( const QgsLineString& splitLine,
|
|
|
|
QList<QgsAbstractGeometry*>& newGeometries,
|
2016-01-04 22:51:18 +11:00
|
|
|
bool topological,
|
|
|
|
QList<QgsPointV2> &topologyTestPoints, QString* errorMsg = nullptr ) const;
|
|
|
|
|
2016-08-06 11:01:42 +02:00
|
|
|
virtual QgsAbstractGeometry* offsetCurve( double distance, int segments, int joinStyle, double mitreLimit, QString* errorMsg = 0 ) const = 0;
|
2015-05-15 15:41:56 +02:00
|
|
|
};
|