32 return mRemoveDuplicateNodes;
37 mRemoveDuplicateNodes = value;
43 return mGeometryPrecision;
48 mGeometryPrecision = value;
54 return mGeometryPrecision != 0.0 || mRemoveDuplicateNodes;
59 if ( mGeometryPrecision != 0.0 )
60 geometry = geometry.
snappedToGrid( mGeometryPrecision, mGeometryPrecision );
62 if ( mRemoveDuplicateNodes )
68 return mGeometryChecks;
79 return mCheckConfiguration.value( checkId ).toMap();
90 QDomDocument doc = node.ownerDocument();
91 QDomElement geometryOptionsElement = doc.createElement( QStringLiteral(
"geometryOptions" ) );
92 node.appendChild( geometryOptionsElement );
94 geometryOptionsElement.setAttribute( QStringLiteral(
"removeDuplicateNodes" ), mRemoveDuplicateNodes ? 1 : 0 );
95 geometryOptionsElement.setAttribute( QStringLiteral(
"geometryPrecision" ), mGeometryPrecision );
98 activeCheckListElement.setTagName( QStringLiteral(
"activeChecks" ) );
99 geometryOptionsElement.appendChild( activeCheckListElement );
101 checkConfigurationElement.setTagName( QStringLiteral(
"checkConfiguration" ) );
102 geometryOptionsElement.appendChild( checkConfigurationElement );
107 const QDomElement geometryOptionsElement = node.toElement();
108 setGeometryPrecision( geometryOptionsElement.attribute( QStringLiteral(
"geometryPrecision" ), QStringLiteral(
"0.0" ) ).toDouble() );
109 setRemoveDuplicateNodes( geometryOptionsElement.attribute( QStringLiteral(
"removeDuplicateNodes" ), QStringLiteral(
"0" ) ).toInt() == 1 );
111 const QDomElement activeChecksElem = node.namedItem( QStringLiteral(
"activeChecks" ) ).toElement();
115 const QDomElement checkConfigurationElem = node.namedItem( QStringLiteral(
"checkConfiguration" ) ).toElement();
bool isActive() const
Determines if at least one fix is enabled.
void removeDuplicateNodesChanged()
Automatically remove duplicate nodes on all geometries which are edited on this layer.
void geometryChecksChanged()
A list of activated geometry checks.
double geometryPrecision() const
The precision in which geometries on this layer should be saved.
bool removeDuplicateNodes() const
Automatically remove duplicate nodes on all geometries which are edited on this layer.
void setGeometryPrecision(double value)
The precision in which geometries on this layer should be saved.
void setRemoveDuplicateNodes(bool value)
Automatically remove duplicate nodes on all geometries which are edited on this layer.
void readXml(const QDomNode &node)
Read the geometry options from node.
QgsGeometryOptions()
Create a new QgsGeometryOptions object.
void setCheckConfiguration(const QString &checkId, const QVariantMap &checkConfiguration)
Set the configuration for the check checkId.
static const QgsSettingsEntryString * settingsGeometryValidationDefaultChecks
Settings entry search path for templates.
QStringList geometryChecks() const
A list of activated geometry checks.
void checkConfigurationChanged()
Access the configuration for the check checkId.
void apply(QgsGeometry &geometry) const
Apply any fixes configured on this class to geometry.
void geometryPrecisionChanged()
The precision in which geometries on this layer should be saved.
void writeXml(QDomNode &node) const
Write the geometry options to the node.
void setGeometryChecks(const QStringList &geometryChecks)
A list of activated geometry checks.
QVariantMap checkConfiguration(const QString &checkId) const
Access the configuration for the check checkId.
A geometry is the spatial representation of a feature.
QgsGeometry snappedToGrid(double hSpacing, double vSpacing, double dSpacing=0, double mSpacing=0) const
Returns a new geometry with all points or vertices snapped to the closest point of the grid.
bool removeDuplicateNodes(double epsilon=4 *std::numeric_limits< double >::epsilon(), bool useZValues=false)
Removes duplicate nodes from the geometry, wherever removing the nodes does not result in a degenerat...
T value(const QString &dynamicKeyPart=QString()) const
Returns settings value.
static QgsSettingsTreeNode * sTreeGeometryValidation
static QDomElement writeVariant(const QVariant &value, QDomDocument &doc)
Write a QVariant to a QDomElement.
static QVariant readVariant(const QDomElement &element)
Read a QVariant from a QDomElement.