17 #ifndef QGS_GEOMETRYCHECKERUTILS_H
18 #define QGS_GEOMETRYCHECKERUTILS_H
20 #include "qgis_analysis.h"
72 QPointer<QgsVectorLayer> layer()
const SIP_SKIP;
77 QString layerId()
const;
96 bool useMapCrs()
const;
120 LayerFeatures(
const QMap<QString, QgsFeaturePool *> &featurePools,
121 const QMap<QString, QgsFeatureIds> &featureIds,
122 const QList<QgsWkbTypes::GeometryType> &geometryTypes,
125 bool useMapCrs =
false );
130 LayerFeatures(
const QMap<QString, QgsFeaturePool *> &featurePools,
131 const QList<QString> &layerIds,
const QgsRectangle &extent,
132 const QList<QgsWkbTypes::GeometryType> &geometryTypes,
176 bool nextLayerFeature(
bool begin );
177 bool nextLayer(
bool begin );
178 bool nextFeature(
bool begin );
179 QList<QString>::const_iterator mLayerIt;
180 QgsFeatureIds::const_iterator mFeatureIt;
182 std::unique_ptr<QgsGeometryCheckerUtils::LayerFeature> mCurrentFeature;
203 QMap<QString, QgsFeaturePool *> mFeaturePools;
204 QMap<QString, QgsFeatureIds> mFeatureIds;
205 QList<QString> mLayerIds;
207 QList<QgsWkbTypes::GeometryType> mGeometryTypes;
210 bool mUseMapCrs =
true;
215 static std::unique_ptr<QgsGeometryEngine> createGeomEngine(
const QgsAbstractGeometry *geometry,
double tolerance );
220 static QList <const QgsLineString *> polygonRings(
const QgsPolygon *polygon );
235 bool closed = back == front;
238 return closed ? nVerts - 1 : nVerts;
248 static bool pointOnLine(
const QgsPoint &p,
const QgsLineString *line,
double tol,
bool excludeExtremities =
false );
263 double dx = p1.
x() - p2.
x(), dy = p1.
y() - p2.
y();
264 return ( dx * dx + dy * dy ) < tol * tol;
272 bool closed = back == front;
273 return closed ? nVerts > 4 : nVerts > 2;
280 #endif // QGS_GEOMETRYCHECKERUTILS_H