QGIS API Documentation  3.26.3-Buenos Aires (65e4edfdad)
qgsgeometryoptions.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsgeometryoptions.h
3  -------------------
4  begin : Aug 23, 2018
5  copyright : (C) 2018 by Matthias Kuhn
6  email : [email protected]
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #ifndef QGSGEOMETRYOPTIONS_H
19 #define QGSGEOMETRYOPTIONS_H
20 
21 #include "qgis_core.h"
22 #include "qgis_sip.h"
23 #include "qgsgeometry.h"
24 #include "qgssettingsentryimpl.h"
25 
26 #include <QObject>
27 
36 class CORE_EXPORT QgsGeometryOptions : public QObject
37 {
38  Q_OBJECT
39 
40  public:
41 
46 
52  bool removeDuplicateNodes() const;
53 
59  void setRemoveDuplicateNodes( bool value );
60 
68  double geometryPrecision() const;
69 
77  void setGeometryPrecision( double value );
78 
84  bool isActive() const;
85 
91  void apply( QgsGeometry &geometry ) const;
92 
98  QStringList geometryChecks() const;
99 
105  void setGeometryChecks( const QStringList &geometryChecks );
106 
112  QVariantMap checkConfiguration( const QString &checkId ) const;
113 
119  void setCheckConfiguration( const QString &checkId, const QVariantMap &checkConfiguration );
120 
126  void writeXml( QDomNode &node ) const;
127 
133  void readXml( const QDomNode &node );
134 
135 #ifndef SIP_RUN
136  static const inline QgsSettingsEntryString settingsGeometryValidationDefaultChecks = QgsSettingsEntryString( QStringLiteral( "default_checks" ), QgsSettings::Prefix::GEOMETRYVALIDATION, QString() );
138 #endif
139 
140  signals:
141 
147  void checkConfigurationChanged();
148 
154  void geometryChecksChanged();
155 
161  void removeDuplicateNodesChanged();
162 
170  void geometryPrecisionChanged();
171 
172  private:
173 
179  bool mRemoveDuplicateNodes = false;
180 
188  double mGeometryPrecision = 0.0;
189 
190  QStringList mGeometryChecks;
191  QVariantMap mCheckConfiguration;
192 };
193 
194 #endif // QGSGEOMETRYOPTIONS_H
QgsSettingsEntryString
A string settings entry.
Definition: qgssettingsentryimpl.h:87
QgsGeometryOptions
The QgsGeometryOptions class contains options to automatically adjust geometries to constraints on a ...
Definition: qgsgeometryoptions.h:36
QgsSettings::Prefix::GEOMETRYVALIDATION
static const char * GEOMETRYVALIDATION
Definition: qgssettings.h:93
qgis_sip.h
qgssettingsentryimpl.h
qgsgeometry.h
QgsGeometry
A geometry is the spatial representation of a feature.
Definition: qgsgeometry.h:124