QGIS API Documentation
4.3.0-Master (52aa6503bed)
Toggle main menu visibility
Loading...
Searching...
No Matches
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 : matthias@opengis.ch
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 "qgis_analysis.h"
20
#include "
qgis_sip.h
"
21
#include "
qgsgeometrycheck.h
"
22
#include "
qgsgeometryselfintersectioncheck.h
"
23
#include "
qgssinglegeometrycheck.h
"
24
25
#include <QMap>
26
#include <QString>
27
#include <QVariantMap>
28
29
class
QgsGeometryCheck
;
30
class
QgsSingleGeometryCheck
;
31
32
class
QgsGeometryCheckContext
;
33
42
class
ANALYSIS_EXPORT
QgsGeometryCheckFactory
SIP_ABSTRACT
43
{
44
public
:
50
virtual
~QgsGeometryCheckFactory
() =
default
;
51
55
virtual
QgsGeometryCheck
*
createGeometryCheck
(
const
QgsGeometryCheckContext
*context,
const
QVariantMap &configuration )
const
= 0
SIP_FACTORY
;
56
60
virtual
QString
id
()
const
= 0;
61
65
virtual
QString
description
()
const
= 0;
66
70
virtual
bool
isCompatible
(
QgsVectorLayer
*layer )
const
= 0;
71
75
virtual
QgsGeometryCheck::Flags
flags
()
const
= 0;
76
80
virtual
QgsGeometryCheck::CheckType
checkType
()
const
= 0;
81
};
82
89
template
<
class
T>
class
QgsGeometryCheckFactoryT
:
public
QgsGeometryCheckFactory
90
{
91
public
:
92
QgsGeometryCheck
*
createGeometryCheck
(
const
QgsGeometryCheckContext
*context,
const
QVariantMap &configuration )
const override
{
return
new
T( context, configuration ); }
93
94
QString
description
()
const override
{
return
T::factoryDescription(); }
95
96
QString
id
()
const override
{
return
T::factoryId(); }
97
98
bool
isCompatible
(
QgsVectorLayer
*layer )
const override
{
return
T::factoryIsCompatible( layer ); }
99
100
QgsGeometryCheck::Flags
flags
()
const override
{
return
T::factoryFlags(); }
101
102
QgsGeometryCheck::CheckType
checkType
()
const override
{
return
T::factoryCheckType(); }
103
};
104
105
106
#endif
// QGSGEOMETRYCHECKFACTORY_H
QgsGeometryCheckContext
Base configuration for geometry checks.
Definition
qgsgeometrycheckcontext.h:32
QgsGeometryCheckFactoryT
Template to create a factory for a geometry check.
Definition
qgsgeometrycheckfactory.h:90
QgsGeometryCheckFactoryT::id
QString id() const override
The unique id for this geometry check.
Definition
qgsgeometrycheckfactory.h:96
QgsGeometryCheckFactoryT::createGeometryCheck
QgsGeometryCheck * createGeometryCheck(const QgsGeometryCheckContext *context, const QVariantMap &configuration) const override
Creates a new geometry check with context and configuration.
Definition
qgsgeometrycheckfactory.h:92
QgsGeometryCheckFactoryT::description
QString description() const override
A human readable description for this check.
Definition
qgsgeometrycheckfactory.h:94
QgsGeometryCheckFactoryT::checkType
QgsGeometryCheck::CheckType checkType() const override
The type of this check.
Definition
qgsgeometrycheckfactory.h:102
QgsGeometryCheckFactoryT::flags
QgsGeometryCheck::Flags flags() const override
Flags for this check.
Definition
qgsgeometrycheckfactory.h:100
QgsGeometryCheckFactoryT::isCompatible
bool isCompatible(QgsVectorLayer *layer) const override
Checks if this check should be made available for layer.
Definition
qgsgeometrycheckfactory.h:98
QgsGeometryCheckFactory
A factory for geometry checks.
Definition
qgsgeometrycheckfactory.h:43
QgsGeometryCheckFactory::isCompatible
virtual bool isCompatible(QgsVectorLayer *layer) const =0
Checks if this check should be made available for layer.
QgsGeometryCheckFactory::checkType
virtual QgsGeometryCheck::CheckType checkType() const =0
The type of this check.
QgsGeometryCheckFactory::id
virtual QString id() const =0
The unique id for this geometry check.
QgsGeometryCheckFactory::createGeometryCheck
virtual QgsGeometryCheck * createGeometryCheck(const QgsGeometryCheckContext *context, const QVariantMap &configuration) const =0
Creates a new geometry check with context and configuration.
QgsGeometryCheckFactory::flags
virtual QgsGeometryCheck::Flags flags() const =0
Flags for this check.
QgsGeometryCheckFactory::~QgsGeometryCheckFactory
virtual ~QgsGeometryCheckFactory()=default
Destructor.
QgsGeometryCheckFactory::description
virtual QString description() const =0
A human readable description for this check.
QgsGeometryCheck
Base class for geometry checks.
Definition
qgsgeometrycheck.h:93
QgsGeometryCheck::Flags
QFlags< Flag > Flags
Definition
qgsgeometrycheck.h:172
QgsGeometryCheck::CheckType
CheckType
The type of a check.
Definition
qgsgeometrycheck.h:149
QgsSingleGeometryCheck
Base class for geometry checks for a single geometry without any context of the layer or other layers...
Definition
qgssinglegeometrycheck.h:148
QgsVectorLayer
Represents a vector layer which manages a vector based dataset.
Definition
qgsvectorlayer.h:414
qgis_sip.h
SIP_ABSTRACT
#define SIP_ABSTRACT
Definition
qgis_sip.h:225
SIP_FACTORY
#define SIP_FACTORY
Definition
qgis_sip.h:83
qgsgeometrycheck.h
qgsgeometryselfintersectioncheck.h
qgssinglegeometrycheck.h
Generated on
for QGIS API Documentation by
1.17.0