QGIS API Documentation
3.14.0-Pi (9f7028fd23)
src
analysis
vector
geometry_checker
qgsgeometrycheckfactory.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgsgeometrycheckfactory.h
3
--------------------------------------
4
Date : September 2018
5
Copyright : (C) 2018 Matthias Kuhn
6
Email :
[email protected]
7
***************************************************************************
8
* *
9
* This program is free software; you can redistribute it and/or modify *
10
* it under the terms of the GNU General Public License as published by *
11
* the Free Software Foundation; either version 2 of the License, or *
12
* (at your option) any later version. *
13
* *
14
***************************************************************************/
15
16
#ifndef QGSGEOMETRYCHECKFACTORY_H
17
#define QGSGEOMETRYCHECKFACTORY_H
18
19
#include <QString>
20
#include <QMap>
21
#include <QVariantMap>
22
23
#include "
qgsgeometrycheck.h
"
24
#include "
qgis_sip.h
"
25
#include "qgis_analysis.h"
26
27
#include "
qgsgeometryselfintersectioncheck.h
"
28
#include "
qgssinglegeometrycheck.h
"
29
30
class
QgsGeometryCheck
;
31
class
QgsSingleGeometryCheck
;
32
33
class
QgsGeometryCheckContext
;
34
43
class
ANALYSIS_EXPORT
QgsGeometryCheckFactory
SIP_ABSTRACT
44
{
45
public
:
46
52
virtual
~
QgsGeometryCheckFactory
() =
default
;
53
57
virtual
QgsGeometryCheck
*createGeometryCheck(
const
QgsGeometryCheckContext
*context,
const
QVariantMap &configuration )
const
= 0
SIP_FACTORY
;
58
62
virtual
QString id()
const
= 0;
63
67
virtual
QString description()
const
= 0;
68
72
virtual
bool
isCompatible(
QgsVectorLayer
*layer )
const
= 0;
73
77
virtual
QgsGeometryCheck::Flags flags()
const
= 0;
78
82
virtual
QgsGeometryCheck::CheckType
checkType()
const
= 0;
83
};
84
91
template
<
class
T>
92
class
QgsGeometryCheckFactoryT
:
public
QgsGeometryCheckFactory
93
{
94
public
:
95
QgsGeometryCheck
*
createGeometryCheck
(
const
QgsGeometryCheckContext
*context,
const
QVariantMap &configuration )
const override
96
{
97
return
new
T( context, configuration );
98
}
99
100
QString
description
()
const override
101
{
102
return
T::factoryDescription();
103
}
104
105
QString
id
()
const override
106
{
107
return
T::factoryId();
108
}
109
110
bool
isCompatible
(
QgsVectorLayer
*layer )
const override
111
{
112
return
T::factoryIsCompatible( layer );
113
}
114
115
QgsGeometryCheck::Flags
flags
()
const override
116
{
117
return
T::factoryFlags();
118
}
119
120
QgsGeometryCheck::CheckType
checkType
()
const override
121
{
122
return
T::factoryCheckType();
123
}
124
};
125
126
127
#endif // QGSGEOMETRYCHECKFACTORY_H
QgsGeometryCheckFactoryT
Definition:
qgsgeometrycheckfactory.h:92
QgsGeometryCheckFactoryT::createGeometryCheck
QgsGeometryCheck * createGeometryCheck(const QgsGeometryCheckContext *context, const QVariantMap &configuration) const override
Creates a new geometry check with context and configuration.
Definition:
qgsgeometrycheckfactory.h:95
qgsgeometryselfintersectioncheck.h
QgsGeometryCheckFactoryT::checkType
QgsGeometryCheck::CheckType checkType() const override
The type of this check.
Definition:
qgsgeometrycheckfactory.h:120
SIP_FACTORY
#define SIP_FACTORY
Definition:
qgis_sip.h:76
QgsSingleGeometryCheck
Definition:
qgssinglegeometrycheck.h:149
QgsGeometryCheck
Definition:
qgsgeometrycheck.h:91
qgsgeometrycheck.h
QgsGeometryCheckFactoryT::description
QString description() const override
A human readable description for this check.
Definition:
qgsgeometrycheckfactory.h:100
qgis_sip.h
QgsGeometryCheckContext
Definition:
qgsgeometrycheckcontext.h:31
QgsGeometryCheckFactory
Definition:
qgsgeometrycheckfactory.h:43
QgsGeometryCheckFactoryT::flags
QgsGeometryCheck::Flags flags() const override
Flags for this check.
Definition:
qgsgeometrycheckfactory.h:115
QgsVectorLayer
Definition:
qgsvectorlayer.h:385
QgsGeometryCheck::CheckType
CheckType
The type of a check.
Definition:
qgsgeometrycheck.h:155
QgsGeometryCheckFactoryT::id
QString id() const override
The unique id for this geometry check.
Definition:
qgsgeometrycheckfactory.h:105
QgsGeometryCheckFactoryT::isCompatible
bool isCompatible(QgsVectorLayer *layer) const override
Checks if this check should be made available for layer.
Definition:
qgsgeometrycheckfactory.h:110
qgssinglegeometrycheck.h
SIP_ABSTRACT
#define SIP_ABSTRACT
Definition:
qgis_sip.h:194
Generated on Mon Jun 22 2020 05:14:09 for QGIS API Documentation by
1.8.17