QGIS API Documentation
4.3.0-Master (16eddb2670e)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
analysis
vector
geometry_checker
qgsgeometrychecker.h
Go to the documentation of this file.
1
/***************************************************************************
2
* qgsgeometrychecker.h *
3
* ------------------- *
4
* copyright : (C) 2014 by Sandro Mani / Sourcepole AG *
5
* email : smani@sourcepole.ch *
6
***************************************************************************/
7
8
/***************************************************************************
9
* *
10
* This program is free software; you can redistribute it and/or modify *
11
* it under the terms of the GNU General Public License as published by *
12
* the Free Software Foundation; either version 2 of the License, or *
13
* (at your option) any later version. *
14
* *
15
***************************************************************************/
16
17
18
#ifndef QGS_GEOMETRY_CHECKER_H
19
#define QGS_GEOMETRY_CHECKER_H
20
21
#include "qgis_analysis.h"
22
#include "
qgsfeatureid.h
"
23
#include "
qgsfeedback.h
"
24
25
#include <QFuture>
26
#include <QList>
27
#include <QMutex>
28
#include <QStringList>
29
30
#define SIP_NO_FILE
31
32
typedef
qint64
QgsFeatureId
;
33
class
QgsGeometryCheckContext
;
34
class
QgsGeometryCheck
;
35
class
QgsGeometryCheckError
;
36
class
QgsMapLayer
;
37
class
QgsVectorLayer
;
38
class
QgsFeaturePool
;
39
class
QMutex;
40
48
class
ANALYSIS_EXPORT
QgsGeometryChecker
:
public
QObject
49
{
50
Q_OBJECT
51
public
:
58
QgsGeometryChecker
(
const
QList<QgsGeometryCheck *> &checks, std::unique_ptr<QgsGeometryCheckContext> context,
const
QMap<QString, QgsFeaturePool *> &
featurePools
);
59
~QgsGeometryChecker
()
override
;
60
QFuture<void>
execute
(
int
*totalSteps =
nullptr
);
61
bool
fixError
(
QgsGeometryCheckError
*error,
int
method,
bool
triggerRepaint =
false
);
62
const
QList<QgsGeometryCheck *>
getChecks
()
const
{
return
mChecks; }
63
QStringList
getMessages
()
const
{
return
mMessages; }
64
void
setMergeAttributeIndices
(
const
QMap<QString, int> &mergeAttributeIndices ) { mMergeAttributeIndices = mergeAttributeIndices; }
65
QgsGeometryCheckContext
*
getContext
()
const
{
return
mContext.get(); }
66
const
QMap<QString, QgsFeaturePool *> &
featurePools
()
const
{
return
mFeaturePools; }
67
68
signals:
69
void
errorAdded
(
QgsGeometryCheckError
*error );
70
void
errorUpdated
(
QgsGeometryCheckError
*error,
bool
statusChanged );
71
void
progressValue
(
int
value );
72
73
private
:
74
class
RunCheckWrapper
75
{
76
public
:
77
explicit
RunCheckWrapper(
QgsGeometryChecker
*instance );
78
void
operator()(
const
QgsGeometryCheck
*check );
79
80
private
:
81
QgsGeometryChecker
*mInstance =
nullptr
;
82
};
83
84
QList<QgsGeometryCheck *> mChecks;
85
std::unique_ptr<QgsGeometryCheckContext> mContext;
86
QList<QgsGeometryCheckError *> mCheckErrors;
87
QStringList mMessages;
88
QMutex mErrorListMutex;
89
QMap<QString, int> mMergeAttributeIndices;
90
QgsFeedback
mFeedback;
91
QMap<QString, QgsFeaturePool *> mFeaturePools;
92
93
void
runCheck(
const
QMap<QString, QgsFeaturePool *> &featurePools,
const
QgsGeometryCheck
*check );
94
95
private
slots:
96
void
emitProgressValue();
97
};
98
99
#endif
// QGS_GEOMETRY_CHECKER_H
QgsFeaturePool
A feature pool is based on a vector layer and caches features.
Definition
qgsfeaturepool.h:38
QgsFeedback
Base class for feedback objects to be used for cancellation of something running in a worker thread.
Definition
qgsfeedback.h:44
QgsGeometryCheckContext
Base configuration for geometry checks.
Definition
qgsgeometrycheckcontext.h:32
QgsGeometryCheckError
This represents an error reported by a geometry check.
Definition
qgsgeometrycheckerror.h:35
QgsGeometryCheck
Base class for geometry checks.
Definition
qgsgeometrycheck.h:93
QgsGeometryChecker::execute
QFuture< void > execute(int *totalSteps=nullptr)
Definition
qgsgeometrychecker.cpp:65
QgsGeometryChecker::QgsGeometryChecker
QgsGeometryChecker(const QList< QgsGeometryCheck * > &checks, std::unique_ptr< QgsGeometryCheckContext > context, const QMap< QString, QgsFeaturePool * > &featurePools)
Constructor.
Definition
qgsgeometrychecker.cpp:34
QgsGeometryChecker::getMessages
QStringList getMessages() const
Definition
qgsgeometrychecker.h:63
QgsGeometryChecker::progressValue
void progressValue(int value)
QgsGeometryChecker::fixError
bool fixError(QgsGeometryCheckError *error, int method, bool triggerRepaint=false)
Definition
qgsgeometrychecker.cpp:103
QgsGeometryChecker::errorAdded
void errorAdded(QgsGeometryCheckError *error)
QgsGeometryChecker::errorUpdated
void errorUpdated(QgsGeometryCheckError *error, bool statusChanged)
QgsGeometryChecker::setMergeAttributeIndices
void setMergeAttributeIndices(const QMap< QString, int > &mergeAttributeIndices)
Definition
qgsgeometrychecker.h:64
QgsGeometryChecker::featurePools
const QMap< QString, QgsFeaturePool * > & featurePools() const
Definition
qgsgeometrychecker.h:66
QgsGeometryChecker::getChecks
const QList< QgsGeometryCheck * > getChecks() const
Definition
qgsgeometrychecker.h:62
QgsGeometryChecker::getContext
QgsGeometryCheckContext * getContext() const
Definition
qgsgeometrychecker.h:65
QgsMapLayer
Base class for all map layer types.
Definition
qgsmaplayer.h:83
QgsVectorLayer
Represents a vector layer which manages a vector based dataset.
Definition
qgsvectorlayer.h:414
qgsfeatureid.h
QgsFeatureId
qint64 QgsFeatureId
64 bit feature ids negative numbers are used for uncommitted/newly added features
Definition
qgsfeatureid.h:32
qgsfeedback.h
Generated on
for QGIS API Documentation by
1.17.0