QGIS API Documentation 3.41.0-Master (45a0abf3bec)
Loading...
Searching...
No Matches
Classes | Public Member Functions | List of all members
QgsGeometryOverlapCheckError Class Reference

An error of a QgsGeometryOverlapCheck. More...

#include <qgsgeometryoverlapcheck.h>

Inheritance diagram for QgsGeometryOverlapCheckError:
Inheritance graph
[legend]

Classes

struct  OverlappedFeature
 

Public Member Functions

 QgsGeometryOverlapCheckError (const QgsGeometryCheck *check, const QgsGeometryCheckerUtils::LayerFeature &layerFeature, const QgsGeometry &geometry, const QgsPointXY &errorLocation, const QVariant &value, const QgsGeometryCheckerUtils::LayerFeature &overlappedFeature)
 Creates a new overlap check error for check and the layerFeature combination.
 
bool closeMatch (QgsGeometryCheckError *other) const override
 Check if this error is almost equal to other.
 
QString description () const override
 The error description.
 
bool handleChanges (const QgsGeometryCheck::Changes &changes) override
 Apply a list of changes.
 
QIcon icon () const override
 Returns an icon that should be shown for this kind of error.
 
QMap< QString, QgsFeatureIdsinvolvedFeatures () const override
 Returns a list of involved features.
 
bool isEqual (QgsGeometryCheckError *other) const override
 Check if this error is equal to other.
 
const OverlappedFeatureoverlappedFeature () const
 Returns the overlapped feature.
 
- Public Member Functions inherited from QgsGeometryCheckError
 QgsGeometryCheckError (const QgsGeometryCheck *check, const QgsGeometryCheckerUtils::LayerFeature &layerFeature, const QgsPointXY &errorLocation, QgsVertexId vidx=QgsVertexId(), const QVariant &value=QVariant(), ValueType valueType=ValueOther)
 Create a new geometry check error with the parent check and for the layerFeature pair at the errorLocation.
 
virtual ~QgsGeometryCheckError ()=default
 
virtual QgsRectangle affectedAreaBBox () const
 The bounding box of the affected area of the error.
 
const QgsGeometryCheckcheck () const
 The geometry check that created this error.
 
virtual QgsRectangle contextBoundingBox () const
 The context of the error.
 
QgsFeatureId featureId () const
 The id of the feature on which this error has been detected.
 
QgsGeometry geometry () const
 The geometry of the error in map units.
 
const QString & layerId () const
 The id of the layer on which this error has been detected.
 
const QgsPointXYlocation () const
 The location of the error in map units.
 
const QgsGeometryCheckErroroperator= (const QgsGeometryCheckError &)=delete
 
QString resolutionMessage () const
 A message with details, how the error has been resolved.
 
void setFixed (int method)
 Set the status to fixed and specify the method that has been used to fix the error.
 
void setFixFailed (const QString &reason)
 Set the error status to failed and specify the reason for failure.
 
void setObsolete ()
 Set the error status to obsolete.
 
Status status () const
 The status of the error.
 
virtual void update (const QgsGeometryCheckError *other)
 Update this error with the information from other.
 
QVariant value () const
 An additional value for the error.
 
ValueType valueType () const
 The type of the value.
 
const QgsVertexIdvidx () const
 The id of the affected vertex.
 

Additional Inherited Members

- Public Types inherited from QgsGeometryCheckError
enum  Status { StatusPending , StatusFixFailed , StatusFixed , StatusObsolete }
 The status of an error. More...
 
enum  ValueType { ValueLength , ValueArea , ValueOther }
 Describes the type of an error value. More...
 
- Protected Member Functions inherited from QgsGeometryCheckError
 QgsGeometryCheckError (const QgsGeometryCheck *check, const QString &layerId, QgsFeatureId featureId, const QgsGeometry &geometry, const QgsPointXY &errorLocation, QgsVertexId vidx=QgsVertexId(), const QVariant &value=QVariant(), ValueType valueType=ValueOther)
 Create a new geometry check error with the parent check and for the layer with layerId and featureId.
 
- Protected Attributes inherited from QgsGeometryCheckError
const QgsGeometryCheckmCheck = nullptr
 
QgsPointXY mErrorLocation
 
QgsFeatureId mFeatureId
 
QgsGeometry mGeometry
 
QString mLayerId
 
QString mResolutionMessage
 
Status mStatus
 
QVariant mValue
 
ValueType mValueType
 
QgsVertexId mVidx
 

Detailed Description

An error of a QgsGeometryOverlapCheck.

Since
QGIS 3.4

Definition at line 30 of file qgsgeometryoverlapcheck.h.

Constructor & Destructor Documentation

◆ QgsGeometryOverlapCheckError()

QgsGeometryOverlapCheckError::QgsGeometryOverlapCheckError ( const QgsGeometryCheck check,
const QgsGeometryCheckerUtils::LayerFeature layerFeature,
const QgsGeometry geometry,
const QgsPointXY errorLocation,
const QVariant &  value,
const QgsGeometryCheckerUtils::LayerFeature overlappedFeature 
)

Creates a new overlap check error for check and the layerFeature combination.

The geometry and errorLocation need to be in map coordinates. The value is the area of the overlapping area in map units. The overlappedFeature provides more details about the overlap.

Definition at line 267 of file qgsgeometryoverlapcheck.cpp.

Member Function Documentation

◆ closeMatch()

bool QgsGeometryOverlapCheckError::closeMatch ( QgsGeometryCheckError ) const
overridevirtual

Check if this error is almost equal to other.

If this returns true, it can be used to update existing errors after re-checking.

Reimplemented from QgsGeometryCheckError.

Definition at line 285 of file qgsgeometryoverlapcheck.cpp.

◆ description()

QString QgsGeometryOverlapCheckError::description ( ) const
overridevirtual

The error description.

By default the description of the parent check will be returned.

Reimplemented from QgsGeometryCheckError.

Definition at line 304 of file qgsgeometryoverlapcheck.cpp.

◆ handleChanges()

bool QgsGeometryOverlapCheckError::handleChanges ( const QgsGeometryCheck::Changes changes)
overridevirtual

Apply a list of changes.

Reimplemented from QgsGeometryCheckError.

Definition at line 291 of file qgsgeometryoverlapcheck.cpp.

◆ icon()

QIcon QgsGeometryOverlapCheckError::icon ( ) const
overridevirtual

Returns an icon that should be shown for this kind of error.

Since
QGIS 3.8

Reimplemented from QgsGeometryCheckError.

Definition at line 317 of file qgsgeometryoverlapcheck.cpp.

◆ involvedFeatures()

QMap< QString, QgsFeatureIds > QgsGeometryOverlapCheckError::involvedFeatures ( ) const
overridevirtual

Returns a list of involved features.

By default returns an empty map. The map keys are layer ids, the map value is a set of feature ids.

Since
QGIS 3.8

Reimplemented from QgsGeometryCheckError.

Definition at line 309 of file qgsgeometryoverlapcheck.cpp.

◆ isEqual()

bool QgsGeometryOverlapCheckError::isEqual ( QgsGeometryCheckError other) const
overridevirtual

Check if this error is equal to other.

Is reimplemented by subclasses with additional information, comparison of base information is done in parent class.

Reimplemented from QgsGeometryCheckError.

Definition at line 274 of file qgsgeometryoverlapcheck.cpp.

◆ overlappedFeature()

const OverlappedFeature & QgsGeometryOverlapCheckError::overlappedFeature ( ) const
inline

Returns the overlapped feature.

Definition at line 70 of file qgsgeometryoverlapcheck.h.


The documentation for this class was generated from the following files: