Skip to content
Permalink
Browse files

[Geometry checker] Introduce QgsGeometryCheckerContext

  • Loading branch information
manisandro committed Mar 30, 2017
1 parent 31cc65d commit 2a92bfb2c93177d44affb907a829b26f53d680b3
Showing with 353 additions and 338 deletions.
  1. +8 −6 src/plugins/geometry_checker/checks/qgsgeometryanglecheck.cpp
  2. +2 −2 src/plugins/geometry_checker/checks/qgsgeometryanglecheck.h
  3. +18 −14 src/plugins/geometry_checker/checks/qgsgeometryareacheck.cpp
  4. +3 −3 src/plugins/geometry_checker/checks/qgsgeometryareacheck.h
  5. +16 −43 src/plugins/geometry_checker/checks/qgsgeometrycheck.cpp
  6. +12 −19 src/plugins/geometry_checker/checks/qgsgeometrycheck.h
  7. +12 −10 src/plugins/geometry_checker/checks/qgsgeometrycontainedcheck.cpp
  8. +2 −2 src/plugins/geometry_checker/checks/qgsgeometrycontainedcheck.h
  9. +5 −3 src/plugins/geometry_checker/checks/qgsgeometrydegeneratepolygoncheck.cpp
  10. +2 −2 src/plugins/geometry_checker/checks/qgsgeometrydegeneratepolygoncheck.h
  11. +14 −12 src/plugins/geometry_checker/checks/qgsgeometryduplicatecheck.cpp
  12. +2 −2 src/plugins/geometry_checker/checks/qgsgeometryduplicatecheck.h
  13. +8 −11 src/plugins/geometry_checker/checks/qgsgeometryduplicatenodescheck.cpp
  14. +2 −2 src/plugins/geometry_checker/checks/qgsgeometryduplicatenodescheck.h
  15. +17 −15 src/plugins/geometry_checker/checks/qgsgeometrygapcheck.cpp
  16. +3 −3 src/plugins/geometry_checker/checks/qgsgeometrygapcheck.h
  17. +5 −3 src/plugins/geometry_checker/checks/qgsgeometryholecheck.cpp
  18. +2 −2 src/plugins/geometry_checker/checks/qgsgeometryholecheck.h
  19. +7 −5 src/plugins/geometry_checker/checks/qgsgeometrymultipartcheck.cpp
  20. +2 −2 src/plugins/geometry_checker/checks/qgsgeometrymultipartcheck.h
  21. +22 −20 src/plugins/geometry_checker/checks/qgsgeometryoverlapcheck.cpp
  22. +4 −4 src/plugins/geometry_checker/checks/qgsgeometryoverlapcheck.h
  23. +7 −5 src/plugins/geometry_checker/checks/qgsgeometrysegmentlengthcheck.cpp
  24. +2 −2 src/plugins/geometry_checker/checks/qgsgeometrysegmentlengthcheck.h
  25. +10 −5 src/plugins/geometry_checker/checks/qgsgeometryselfcontactcheck.cpp
  26. +2 −2 src/plugins/geometry_checker/checks/qgsgeometryselfcontactcheck.h
  27. +19 −17 src/plugins/geometry_checker/checks/qgsgeometryselfintersectioncheck.cpp
  28. +2 −2 src/plugins/geometry_checker/checks/qgsgeometryselfintersectioncheck.h
  29. +1 −2 src/plugins/geometry_checker/checks/qgsgeometrysliverpolygoncheck.cpp
  30. +3 −3 src/plugins/geometry_checker/checks/qgsgeometrysliverpolygoncheck.h
  31. +10 −8 src/plugins/geometry_checker/checks/qgsgeometrytypecheck.cpp
  32. +2 −2 src/plugins/geometry_checker/checks/qgsgeometrytypecheck.h
  33. +18 −10 src/plugins/geometry_checker/qgsgeometrychecker.cpp
  34. +4 −3 src/plugins/geometry_checker/qgsgeometrychecker.h
  35. +30 −30 src/plugins/geometry_checker/qgsgeometrycheckfactory.cpp
  36. +3 −3 src/plugins/geometry_checker/qgsgeometrycheckfactory.h
  37. +2 −2 src/plugins/geometry_checker/ui/qgsgeometrycheckerdialog.cpp
  38. +1 −1 src/plugins/geometry_checker/ui/qgsgeometrycheckerdialog.h
  39. +6 −5 src/plugins/geometry_checker/ui/qgsgeometrycheckerfixsummarydialog.cpp
  40. +3 −3 src/plugins/geometry_checker/ui/qgsgeometrycheckerfixsummarydialog.h
  41. +17 −23 src/plugins/geometry_checker/ui/qgsgeometrycheckerresulttab.cpp
  42. +1 −2 src/plugins/geometry_checker/ui/qgsgeometrycheckerresulttab.h
  43. +19 −7 src/plugins/geometry_checker/ui/qgsgeometrycheckersetuptab.cpp
  44. +2 −2 src/plugins/geometry_checker/ui/qgsgeometrycheckersetuptab.h
  45. +21 −14 src/plugins/geometry_checker/ui/qgsgeometrycheckersetuptab.ui
@@ -22,15 +22,16 @@ void QgsGeometryAngleCheck::collectErrors( QList<QgsGeometryCheckError *> &error
QMap<QString, QgsFeatureIds> featureIds = ids.isEmpty() ? allLayerFeatureIds() : ids;
for ( const QString &layerId : featureIds.keys() )
{
if ( !getCompatibility( getFeaturePool( layerId )->getLayer()->geometryType() ) )
QgsFeaturePool *featurePool = mContext->featurePools[ layerId ];
if ( !getCompatibility( featurePool->getLayer()->geometryType() ) )
{
continue;
}
for ( QgsFeatureId featureid : featureIds[layerId] )
{
if ( progressCounter ) progressCounter->fetchAndAddRelaxed( 1 );
QgsFeature feature;
if ( !getFeaturePool( layerId )->get( featureid, feature ) )
if ( !featurePool->get( featureid, feature ) )
{
continue;
}
@@ -77,8 +78,9 @@ void QgsGeometryAngleCheck::collectErrors( QList<QgsGeometryCheckError *> &error

void QgsGeometryAngleCheck::fixError( QgsGeometryCheckError *error, int method, const QMap<QString, int> & /*mergeAttributeIndices*/, Changes &changes ) const
{
QgsFeaturePool *featurePool = mContext->featurePools[ error->layerId() ];
QgsFeature feature;
if ( !getFeaturePool( error->layerId() )->get( error->featureId(), feature ) )
if ( !featurePool->get( error->featureId(), feature ) )
{
error->setObsolete();
return;
@@ -140,14 +142,14 @@ void QgsGeometryAngleCheck::fixError( QgsGeometryCheckError *error, int method,
else
{
changes[error->layerId()][error->featureId()].append( Change( ChangeNode, ChangeRemoved, vidx ) );
if ( QgsGeometryUtils::sqrDistance2D( p1, p3 ) < QgsGeometryCheckPrecision::tolerance() * QgsGeometryCheckPrecision::tolerance()
&& QgsGeometryCheckerUtils::canDeleteVertex( geometry, vidx.part, vidx.ring ) &&
if ( QgsGeometryUtils::sqrDistance2D( p1, p3 ) < mContext->tolerance &&
QgsGeometryCheckerUtils::canDeleteVertex( geometry, vidx.part, vidx.ring ) &&
geometry->deleteVertex( error->vidx() ) ) // error->vidx points to p3 after removing p2
{
changes[error->layerId()][error->featureId()].append( Change( ChangeNode, ChangeRemoved, QgsVertexId( vidx.part, vidx.ring, ( vidx.vertex + 1 ) % n ) ) );
}
feature.setGeometry( g );
getFeaturePool( error->layerId() )->updateFeature( feature );
featurePool->updateFeature( feature );
error->setFixed( method );
}
}
@@ -23,8 +23,8 @@ class QgsGeometryAngleCheck : public QgsGeometryCheck
Q_OBJECT

public:
QgsGeometryAngleCheck( const QMap<QString, QgsFeaturePool *> &featurePools, double minAngle )
: QgsGeometryCheck( FeatureNodeCheck, {QgsWkbTypes::LineGeometry, QgsWkbTypes::PolygonGeometry}, featurePools )
QgsGeometryAngleCheck( QgsGeometryCheckerContext *context, double minAngle )
: QgsGeometryCheck( FeatureNodeCheck, {QgsWkbTypes::LineGeometry, QgsWkbTypes::PolygonGeometry}, context )
, mMinAngle( minAngle )
{}
void collectErrors( QList<QgsGeometryCheckError *> &errors, QStringList &messages, QAtomicInt *progressCounter = nullptr, const QMap<QString, QgsFeatureIds> &ids = QMap<QString, QgsFeatureIds>() ) const override;
@@ -23,15 +23,16 @@ void QgsGeometryAreaCheck::collectErrors( QList<QgsGeometryCheckError *> &errors
QMap<QString, QgsFeatureIds> featureIds = ids.isEmpty() ? allLayerFeatureIds() : ids;
for ( const QString &layerId : featureIds.keys() )
{
if ( !getCompatibility( getFeaturePool( layerId )->getLayer()->geometryType() ) )
QgsFeaturePool *featurePool = mContext->featurePools[ layerId ];
if ( !getCompatibility( featurePool->getLayer()->geometryType() ) )
{
continue;
}
for ( QgsFeatureId featureid : featureIds[layerId] )
{
if ( progressCounter ) progressCounter->fetchAndAddRelaxed( 1 );
QgsFeature feature;
if ( !getFeaturePool( layerId )->get( featureid, feature ) )
if ( !featurePool->get( featureid, feature ) )
{
continue;
}
@@ -44,7 +45,7 @@ void QgsGeometryAreaCheck::collectErrors( QList<QgsGeometryCheckError *> &errors
for ( int i = 0, n = multiGeom->numGeometries(); i < n; ++i )
{
double value;
if ( checkThreshold( layerId, multiGeom->geometryN( i ), value ) )
if ( checkThreshold( featurePool->getMapToLayerUnits(), multiGeom->geometryN( i ), value ) )
{
errors.append( new QgsGeometryCheckError( this, layerId, featureid, multiGeom->geometryN( i )->centroid(), QgsVertexId( i ), value, QgsGeometryCheckError::ValueArea ) );
}
@@ -53,7 +54,7 @@ void QgsGeometryAreaCheck::collectErrors( QList<QgsGeometryCheckError *> &errors
else
{
double value;
if ( checkThreshold( layerId, geom, value ) )
if ( checkThreshold( featurePool->getMapToLayerUnits(), geom, value ) )
{
errors.append( new QgsGeometryCheckError( this, layerId, featureid, geom->centroid(), QgsVertexId( 0 ), value, QgsGeometryCheckError::ValueArea ) );
}
@@ -64,12 +65,14 @@ void QgsGeometryAreaCheck::collectErrors( QList<QgsGeometryCheckError *> &errors

void QgsGeometryAreaCheck::fixError( QgsGeometryCheckError *error, int method, const QMap<QString, int> &mergeAttributeIndices, Changes &changes ) const
{
QgsFeaturePool *featurePool = mContext->featurePools[ error->layerId() ];
QgsFeature feature;
if ( !getFeaturePool( error->layerId() )->get( error->featureId(), feature ) )
if ( !featurePool->get( error->featureId(), feature ) )
{
error->setObsolete();
return;
}
double mapToLayerUnits = featurePool->getMapToLayerUnits();
QgsGeometry g = feature.geometry();
QgsAbstractGeometry *geom = g.geometry();
QgsVertexId vidx = error->vidx();
@@ -85,7 +88,7 @@ void QgsGeometryAreaCheck::fixError( QgsGeometryCheckError *error, int method, c
if ( dynamic_cast<QgsGeometryCollection *>( geom ) )
{
double value;
if ( !checkThreshold( error->layerId(), static_cast<QgsGeometryCollection *>( geom )->geometryN( vidx.part ), value ) )
if ( !checkThreshold( mapToLayerUnits, static_cast<QgsGeometryCollection *>( geom )->geometryN( vidx.part ), value ) )
{
error->setObsolete();
return;
@@ -94,7 +97,7 @@ void QgsGeometryAreaCheck::fixError( QgsGeometryCheckError *error, int method, c
else
{
double value;
if ( !checkThreshold( error->layerId(), geom, value ) )
if ( !checkThreshold( mapToLayerUnits, geom, value ) )
{
error->setObsolete();
return;
@@ -129,16 +132,17 @@ void QgsGeometryAreaCheck::fixError( QgsGeometryCheckError *error, int method, c
}
}

bool QgsGeometryAreaCheck::checkThreshold( const QString &layerId, const QgsAbstractGeometry *geom, double &value ) const
bool QgsGeometryAreaCheck::checkThreshold( double mapToLayerUnits, const QgsAbstractGeometry *geom, double &value ) const
{
value = geom->area();
double mapToLayerUnits = getFeaturePool( layerId )->getMapToLayerUnits();
double threshold = mThresholdMapUnits * mapToLayerUnits * mapToLayerUnits;
return value < threshold;
}

bool QgsGeometryAreaCheck::mergeWithNeighbor( const QString &layerId, QgsFeature &feature, int partIdx, int method, int mergeAttributeIndex, Changes &changes, QString &errMsg ) const
{
QgsFeaturePool *featurePool = mContext->featurePools[ layerId ];

double maxVal = 0.;
QgsFeature mergeFeature;
int mergePartIdx = -1;
@@ -147,10 +151,10 @@ bool QgsGeometryAreaCheck::mergeWithNeighbor( const QString &layerId, QgsFeature
QgsAbstractGeometry *geom = g.geometry();

// Search for touching neighboring geometries
for ( QgsFeatureId testId : getFeaturePool( layerId )->getIntersects( g.boundingBox() ) )
for ( QgsFeatureId testId : featurePool->getIntersects( g.boundingBox() ) )
{
QgsFeature testFeature;
if ( !getFeaturePool( layerId )->get( testId, testFeature ) )
if ( !featurePool->get( testId, testFeature ) )
{
continue;
}
@@ -162,7 +166,7 @@ bool QgsGeometryAreaCheck::mergeWithNeighbor( const QString &layerId, QgsFeature
{
continue;
}
double len = QgsGeometryCheckerUtils::sharedEdgeLength( QgsGeometryCheckerUtils::getGeomPart( geom, partIdx ), QgsGeometryCheckerUtils::getGeomPart( testGeom, testPartIdx ), QgsGeometryCheckPrecision::reducedTolerance() );
double len = QgsGeometryCheckerUtils::sharedEdgeLength( QgsGeometryCheckerUtils::getGeomPart( geom, partIdx ), QgsGeometryCheckerUtils::getGeomPart( testGeom, testPartIdx ), mContext->reducedTolerance );
if ( len > 0. )
{
if ( method == MergeLongestEdge || method == MergeLargestArea )
@@ -212,8 +216,8 @@ bool QgsGeometryAreaCheck::mergeWithNeighbor( const QString &layerId, QgsFeature
// Merge geometries
QgsGeometry mergeFeatureGeom = mergeFeature.geometry();
QgsAbstractGeometry *mergeGeom = mergeFeatureGeom.geometry();
QgsGeometryEngine *geomEngine = QgsGeometryCheckerUtils::createGeomEngine( QgsGeometryCheckerUtils::getGeomPart( mergeGeom, mergePartIdx ), QgsGeometryCheckPrecision::tolerance() );
QgsAbstractGeometry *combinedGeom = geomEngine->combine( QgsGeometryCheckerUtils::getGeomPart( geom, partIdx ), &errMsg );
QgsGeometryEngine *geomEngine = QgsGeometryCheckerUtils::createGeomEngine( QgsGeometryCheckerUtils::getGeomPart( mergeGeom, mergePartIdx ), mContext->tolerance );
QgsAbstractGeometry *combinedGeom = geomEngine->combine( *QgsGeometryCheckerUtils::getGeomPart( geom, partIdx ), &errMsg );
delete geomEngine;
if ( !combinedGeom || combinedGeom->isEmpty() )
{
@@ -25,8 +25,8 @@ class QgsGeometryAreaCheck : public QgsGeometryCheck
Q_OBJECT

public:
QgsGeometryAreaCheck( const QMap<QString, QgsFeaturePool *> &featurePools, double thresholdMapUnits )
: QgsGeometryCheck( FeatureCheck, {QgsWkbTypes::PolygonGeometry}, featurePools )
QgsGeometryAreaCheck( QgsGeometryCheckerContext *context, double thresholdMapUnits )
: QgsGeometryCheck( FeatureCheck, {QgsWkbTypes::PolygonGeometry}, context )
, mThresholdMapUnits( thresholdMapUnits )
{}
void collectErrors( QList<QgsGeometryCheckError *> &errors, QStringList &messages, QAtomicInt *progressCounter = nullptr, const QMap<QString, QgsFeatureIds> &ids = QMap<QString, QgsFeatureIds>() ) const override;
@@ -37,7 +37,7 @@ class QgsGeometryAreaCheck : public QgsGeometryCheck
private:
enum ResolutionMethod { MergeLongestEdge, MergeLargestArea, MergeIdenticalAttribute, Delete, NoChange };

virtual bool checkThreshold( const QString &layerId, const QgsAbstractGeometry *geom, double &value ) const;
virtual bool checkThreshold( double mapToLayerUnits, const QgsAbstractGeometry *geom, double &value ) const;
bool mergeWithNeighbor( const QString &layerId, QgsFeature &feature, int partIdx, int method, int mergeAttributeIndex, Changes &changes, QString &errMsg ) const;

protected:
@@ -18,43 +18,13 @@
#include "qgsgeometrycheck.h"
#include "../utils/qgsfeaturepool.h"

QgsGeometryCheckPrecision::QgsGeometryCheckPrecision()
{
mPrecision = 10;
mReducedPrecision = 6;
}

QgsGeometryCheckPrecision *QgsGeometryCheckPrecision::get()
{
static QgsGeometryCheckPrecision sInstance;
return &sInstance;
}

void QgsGeometryCheckPrecision::setPrecision( int tolerance )
{
get()->mPrecision = tolerance;
get()->mReducedPrecision = tolerance / 2;
}

int QgsGeometryCheckPrecision::precision()
{
return get()->mPrecision;
}

int QgsGeometryCheckPrecision::reducedPrecision()
{
return get()->mReducedPrecision;
}

double QgsGeometryCheckPrecision::tolerance()
{
return std::pow( 10, -get()->mPrecision );
}

double QgsGeometryCheckPrecision::reducedTolerance()
{
return std::pow( 10, -get()->mReducedPrecision );
}
QgsGeometryCheckerContext::QgsGeometryCheckerContext( int _precision, const QString &_crs, const QMap<QString, QgsFeaturePool *> &_featurePools )
: tolerance( qPow( 10, -_precision ) )
, reducedTolerance( qPow( 10, -_precision / 2 ) )
, crs( _crs )
, featurePools( _featurePools )
{}

QgsGeometryCheckError::QgsGeometryCheckError( const QgsGeometryCheck *check, const QString &layerId,
QgsFeatureId featureId,
@@ -74,7 +44,7 @@ QgsGeometryCheckError::QgsGeometryCheckError( const QgsGeometryCheck *check, con
QgsAbstractGeometry *QgsGeometryCheckError::geometry()
{
QgsFeature f;
if ( mCheck->getFeaturePool( layerId() )->get( featureId(), f ) && f.hasGeometry() )
if ( mCheck->getContext()->featurePools[ layerId() ]->get( featureId(), f ) && f.hasGeometry() )
{
QgsGeometry featureGeom = f.geometry();
QgsAbstractGeometry *geom = featureGeom.geometry();
@@ -152,7 +122,7 @@ bool QgsGeometryCheckError::handleChanges( const QgsGeometryCheck::Changes &chan
QMap<QString, QgsFeatureIds> QgsGeometryCheck::allLayerFeatureIds() const
{
QMap<QString, QgsFeatureIds> featureIds;
for ( QgsFeaturePool *pool : mFeaturePools )
for ( QgsFeaturePool *pool : mContext->featurePools )
{
featureIds.insert( pool->getLayer()->id(), pool->getFeatureIds() );
}
@@ -161,6 +131,7 @@ QMap<QString, QgsFeatureIds> QgsGeometryCheck::allLayerFeatureIds() const

void QgsGeometryCheck::replaceFeatureGeometryPart( const QString &layerId, QgsFeature &feature, int partIdx, QgsAbstractGeometry *newPartGeom, Changes &changes ) const
{
QgsFeaturePool *featurePool = mContext->featurePools[layerId];
QgsGeometry featureGeom = feature.geometry();
QgsAbstractGeometry *geom = featureGeom.geometry();
if ( dynamic_cast<QgsGeometryCollection *>( geom ) )
@@ -177,37 +148,39 @@ void QgsGeometryCheck::replaceFeatureGeometryPart( const QString &layerId, QgsFe
feature.setGeometry( QgsGeometry( newPartGeom ) );
changes[layerId][feature.id()].append( Change( ChangeFeature, ChangeChanged ) );
}
mFeaturePools[layerId]->updateFeature( feature );
featurePool->updateFeature( feature );
}

void QgsGeometryCheck::deleteFeatureGeometryPart( const QString &layerId, QgsFeature &feature, int partIdx, Changes &changes ) const
{
QgsFeaturePool *featurePool = mContext->featurePools[layerId];
QgsGeometry featureGeom = feature.geometry();
QgsAbstractGeometry *geom = featureGeom.geometry();
if ( dynamic_cast<QgsGeometryCollection *>( geom ) )
{
static_cast<QgsGeometryCollection *>( geom )->removeGeometry( partIdx );
if ( static_cast<QgsGeometryCollection *>( geom )->numGeometries() == 0 )
{
mFeaturePools[layerId]->deleteFeature( feature );
featurePool->deleteFeature( feature );
changes[layerId][feature.id()].append( Change( ChangeFeature, ChangeRemoved ) );
}
else
{
feature.setGeometry( featureGeom );
mFeaturePools[layerId]->updateFeature( feature );
featurePool->updateFeature( feature );
changes[layerId][feature.id()].append( Change( ChangePart, ChangeRemoved, QgsVertexId( partIdx ) ) );
}
}
else
{
mFeaturePools[layerId]->deleteFeature( feature );
featurePool->deleteFeature( feature );
changes[layerId][feature.id()].append( Change( ChangeFeature, ChangeRemoved ) );
}
}

void QgsGeometryCheck::deleteFeatureGeometryRing( const QString &layerId, QgsFeature &feature, int partIdx, int ringIdx, Changes &changes ) const
{
QgsFeaturePool *featurePool = mContext->featurePools[layerId];
QgsGeometry featureGeom = feature.geometry();
QgsAbstractGeometry *partGeom = QgsGeometryCheckerUtils::getGeomPart( featureGeom.geometry(), partIdx );
if ( dynamic_cast<QgsCurvePolygon *>( partGeom ) )
@@ -221,7 +194,7 @@ void QgsGeometryCheck::deleteFeatureGeometryRing( const QString &layerId, QgsFea
{
static_cast<QgsCurvePolygon *>( partGeom )->removeInteriorRing( ringIdx - 1 );
feature.setGeometry( featureGeom );
mFeaturePools[layerId]->updateFeature( feature );
featurePool->updateFeature( feature );
changes[layerId][feature.id()].append( Change( ChangeRing, ChangeRemoved, QgsVertexId( partIdx, ringIdx ) ) );
}
}
@@ -30,21 +30,13 @@ class QgsFeaturePool;

#define FEATUREID_NULL std::numeric_limits<QgsFeatureId>::min()

class QgsGeometryCheckPrecision
struct QgsGeometryCheckerContext
{
public:
static void setPrecision( int precision );
static int precision();
static int reducedPrecision();
static double tolerance();
static double reducedTolerance();

private:
QgsGeometryCheckPrecision();
static QgsGeometryCheckPrecision *get();

int mPrecision;
int mReducedPrecision;
QgsGeometryCheckerContext( int _precision, const QString &_crs, const QMap<QString, QgsFeaturePool *> &_featurePools );
const double tolerance;
const double reducedTolerance;
const QString crs;
const QMap<QString, QgsFeaturePool *> featurePools;
};

class QgsGeometryCheck : public QObject
@@ -71,10 +63,10 @@ class QgsGeometryCheck : public QObject

typedef QMap<QString, QMap<QgsFeatureId, QList<Change>>> Changes;

QgsGeometryCheck( CheckType checkType, const QList<QgsWkbTypes::GeometryType> &compatibleGeometryTypes, const QMap<QString, QgsFeaturePool *> &featurePools )
QgsGeometryCheck( CheckType checkType, const QList<QgsWkbTypes::GeometryType> &compatibleGeometryTypes, QgsGeometryCheckerContext *context )
: mCheckType( checkType )
, mCompatibleGeometryTypes( compatibleGeometryTypes )
, mFeaturePools( featurePools )
, mContext( context )
{}
virtual void collectErrors( QList<QgsGeometryCheckError *> &errors, QStringList &messages, QAtomicInt *progressCounter = nullptr, const QMap<QString, QgsFeatureIds> &ids = QMap<QString, QgsFeatureIds>() ) const = 0;
virtual void fixError( QgsGeometryCheckError *error, int method, const QMap<QString, int> &mergeAttributeIndices, Changes &changes ) const = 0;
@@ -83,8 +75,7 @@ class QgsGeometryCheck : public QObject
virtual QString errorName() const = 0;
CheckType getCheckType() const { return mCheckType; }
bool getCompatibility( QgsWkbTypes::GeometryType type ) const { return mCompatibleGeometryTypes.contains( type ); }
const QMap<QString, QgsFeaturePool *> &getFeaturePools() const { return mFeaturePools; }
QgsFeaturePool *getFeaturePool( const QString &layerId ) const { return mFeaturePools.value( layerId, nullptr ); }
QgsGeometryCheckerContext *getContext() const { return mContext; }

protected:
QMap<QString, QgsFeatureIds> allLayerFeatureIds() const;
@@ -95,7 +86,9 @@ class QgsGeometryCheck : public QObject
private:
const CheckType mCheckType;
QList<QgsWkbTypes::GeometryType> mCompatibleGeometryTypes;
QMap<QString, QgsFeaturePool *> mFeaturePools;

protected:
QgsGeometryCheckerContext *mContext;
};


0 comments on commit 2a92bfb

Please sign in to comment.
You can’t perform that action at this time.