QGIS API Documentation  2.10.1-Pisa
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
qgsgeometryengine.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsgeometryengine.h
3  -------------------------------------------------------------------
4 Date : 22 Sept 2014
5 Copyright : (C) 2014 by Marco Hugentobler
6 email : marco.hugentobler at sourcepole dot com
7  ***************************************************************************
8  * *
9  * This program is free software; you can redistribute it and/or modify *
10  * it under the terms of the GNU General Public License as published by *
11  * the Free Software Foundation; either version 2 of the License, or *
12  * (at your option) any later version. *
13  * *
14  ***************************************************************************/
15 
16 #ifndef QGSVECTORTOPOLOGY_H
17 #define QGSVECTORTOPOLOGY_H
18 
19 #include "qgspointv2.h"
20 #include "qgslinestringv2.h"
21 
22 #include <QList>
23 
25 
26 
33 class CORE_EXPORT QgsGeometryEngine
34 {
35  public:
36  QgsGeometryEngine( const QgsAbstractGeometryV2* geometry ): mGeometry( geometry ) {}
37  virtual ~QgsGeometryEngine() {}
38 
39  virtual void geometryChanged() = 0;
40  virtual void prepareGeometry() = 0;
41 
42  virtual QgsAbstractGeometryV2* intersection( const QgsAbstractGeometryV2& geom ) const = 0;
43  virtual QgsAbstractGeometryV2* difference( const QgsAbstractGeometryV2& geom ) const = 0;
44  virtual QgsAbstractGeometryV2* combine( const QgsAbstractGeometryV2& geom ) const = 0;
45  virtual QgsAbstractGeometryV2* combine( const QList< const QgsAbstractGeometryV2* > ) const = 0;
46  virtual QgsAbstractGeometryV2* symDifference( const QgsAbstractGeometryV2& geom ) const = 0;
47  virtual QgsAbstractGeometryV2* buffer( double distance, int segments ) const = 0;
48  virtual QgsAbstractGeometryV2* buffer( double distance, int segments, int endCapStyle, int joinStyle, double mitreLimit ) const = 0;
49  virtual QgsAbstractGeometryV2* simplify( double tolerance ) const = 0;
50  virtual QgsAbstractGeometryV2* interpolate( double distance ) const = 0;
51  virtual bool centroid( QgsPointV2& pt ) const = 0;
52  virtual bool pointOnSurface( QgsPointV2& pt ) const = 0;
53  virtual QgsAbstractGeometryV2* convexHull() const = 0;
54  virtual double distance( const QgsAbstractGeometryV2& geom ) const = 0;
55  virtual bool intersects( const QgsAbstractGeometryV2& geom ) const = 0;
56  virtual bool touches( const QgsAbstractGeometryV2& geom ) const = 0;
57  virtual bool crosses( const QgsAbstractGeometryV2& geom ) const = 0;
58  virtual bool within( const QgsAbstractGeometryV2& geom ) const = 0;
59  virtual bool overlaps( const QgsAbstractGeometryV2& geom ) const = 0;
60  virtual bool contains( const QgsAbstractGeometryV2& geom ) const = 0;
61  virtual bool disjoint( const QgsAbstractGeometryV2& geom ) const = 0;
62  virtual double area() const = 0;
63  virtual double length() const = 0;
64  virtual bool isValid() const = 0;
65  virtual bool isEqual( const QgsAbstractGeometryV2& geom ) const = 0;
66  virtual bool isEmpty() const = 0;
67 
68  virtual int splitGeometry( const QgsLineStringV2& splitLine,
69  QList<QgsAbstractGeometryV2*>& newGeometries,
70  bool topological,
71  QList<QgsPointV2> &topologyTestPoints ) const
72  {
73  Q_UNUSED( splitLine );
74  Q_UNUSED( newGeometries );
75  Q_UNUSED( topological );
76  Q_UNUSED( topologyTestPoints );
77  return 2;
78  } //= 0;
79 
80  virtual QgsAbstractGeometryV2* offsetCurve( double distance, int segments, int joinStyle, double mitreLimit ) const = 0;
81 
82  protected:
84 
86 };
87 
88 #endif // QGSVECTORTOPOLOGY_H
QgsGeometryEngine(const QgsAbstractGeometryV2 *geometry)
Abstract base class for all geometries.
virtual ~QgsGeometryEngine()
virtual int splitGeometry(const QgsLineStringV2 &splitLine, QList< QgsAbstractGeometryV2 * > &newGeometries, bool topological, QList< QgsPointV2 > &topologyTestPoints) const
Line string geometry type.
Point geometry type.
Definition: qgspointv2.h:29
const QgsAbstractGeometryV2 * mGeometry
Contains geometry relation and modification algorithms.
int convexHull(int *id, const double *const x, const double *const y, int n)