QGIS API Documentation 3.39.0-Master (e8f1b343c48)
Loading...
Searching...
No Matches
Public Member Functions | List of all members
QgsGeometryGapCheckError Class Reference

An error produced by a QgsGeometryGapCheck. More...

#include <qgsgeometrygapcheck.h>

Inheritance diagram for QgsGeometryGapCheckError:
Inheritance graph
[legend]

Public Member Functions

 QgsGeometryGapCheckError (const QgsGeometryCheck *check, const QString &layerId, const QgsGeometry &geometry, const QMap< QString, QgsFeatureIds > &neighbors, double area, const QgsRectangle &gapAreaBBox, const QgsRectangle &contextArea)
 Create a new gap check error produced by check on the layer layerId.
 
QgsRectangle affectedAreaBBox () const override
 The bounding box of the affected area of the error.
 
bool closeMatch (QgsGeometryCheckError *other) const override
 Check if this error is almost equal to other.
 
QgsRectangle contextBoundingBox () const override
 The context of the error.
 
bool handleChanges (const QgsGeometryCheck::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 QMap< QString, QgsFeatureIds > & neighbors () const
 A map of layers and feature ids of the neighbors of the gap.
 
void update (const QgsGeometryCheckError *other) override
 Update this error with the information from other.
 
- 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
 
const QgsGeometryCheckcheck () const
 The geometry check that created this error.
 
virtual QString description () const
 The error description.
 
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.
 
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 produced by a QgsGeometryGapCheck.

Since
QGIS 3.4

Definition at line 31 of file qgsgeometrygapcheck.h.

Constructor & Destructor Documentation

◆ QgsGeometryGapCheckError()

QgsGeometryGapCheckError::QgsGeometryGapCheckError ( const QgsGeometryCheck check,
const QString &  layerId,
const QgsGeometry geometry,
const QMap< QString, QgsFeatureIds > &  neighbors,
double  area,
const QgsRectangle gapAreaBBox,
const QgsRectangle contextArea 
)
inline

Create a new gap check error produced by check on the layer layerId.

The geometry of the gap needs to be in map coordinates. The neighbors are a map of layer ids and feature ids. The area of the gap in map units and the bounding box of the gap in map units too.

Definition at line 41 of file qgsgeometrygapcheck.h.

Member Function Documentation

◆ affectedAreaBBox()

QgsRectangle QgsGeometryGapCheckError::affectedAreaBBox ( ) const
overridevirtual

The bounding box of the affected area of the error.

Reimplemented from QgsGeometryCheckError.

Definition at line 530 of file qgsgeometrygapcheck.cpp.

◆ closeMatch()

bool QgsGeometryGapCheckError::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 510 of file qgsgeometrygapcheck.cpp.

◆ contextBoundingBox()

QgsRectangle QgsGeometryGapCheckError::contextBoundingBox ( ) const
overridevirtual

The context of the error.

For topology checks like gap checks this returns the context of an error and the involved features. May be a NULL rectangle.

Since
QGIS 3.10

Reimplemented from QgsGeometryCheckError.

Definition at line 499 of file qgsgeometrygapcheck.cpp.

◆ handleChanges()

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

Apply a list of changes.

Reimplemented from QgsGeometryCheckError.

Definition at line 525 of file qgsgeometrygapcheck.cpp.

◆ icon()

QIcon QgsGeometryGapCheckError::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 540 of file qgsgeometrygapcheck.cpp.

◆ involvedFeatures()

QMap< QString, QgsFeatureIds > QgsGeometryGapCheckError::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 535 of file qgsgeometrygapcheck.cpp.

◆ isEqual()

bool QgsGeometryGapCheckError::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 504 of file qgsgeometrygapcheck.cpp.

◆ neighbors()

const QMap< QString, QgsFeatureIds > & QgsGeometryGapCheckError::neighbors ( ) const
inline

A map of layers and feature ids of the neighbors of the gap.

Definition at line 60 of file qgsgeometrygapcheck.h.

◆ update()

void QgsGeometryGapCheckError::update ( const QgsGeometryCheckError other)
overridevirtual

Update this error with the information from other.

Will be used to update existing errors whenever they are re-checked.

Reimplemented from QgsGeometryCheckError.

Definition at line 516 of file qgsgeometrygapcheck.cpp.


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