24 return mRemoveDuplicateNodes;
29 mRemoveDuplicateNodes = value;
35 return mGeometryPrecision;
40 mGeometryPrecision = value;
46 return mGeometryPrecision != 0.0 || mRemoveDuplicateNodes;
51 if ( mGeometryPrecision != 0.0 )
52 geometry = geometry.
snappedToGrid( mGeometryPrecision, mGeometryPrecision );
54 if ( mRemoveDuplicateNodes )
60 return mGeometryChecks;
71 return mCheckConfiguration.value( checkId ).toMap();
82 QDomDocument doc = node.ownerDocument();
83 QDomElement geometryOptionsElement = doc.createElement( QStringLiteral(
"geometryOptions" ) );
84 node.appendChild( geometryOptionsElement );
86 geometryOptionsElement.setAttribute( QStringLiteral(
"removeDuplicateNodes" ), mRemoveDuplicateNodes ? 1 : 0 );
87 geometryOptionsElement.setAttribute( QStringLiteral(
"geometryPrecision" ), mGeometryPrecision );
90 activeCheckListElement.setTagName( QStringLiteral(
"activeChecks" ) );
91 geometryOptionsElement.appendChild( activeCheckListElement );
93 checkConfigurationElement.setTagName( QStringLiteral(
"checkConfiguration" ) );
94 geometryOptionsElement.appendChild( checkConfigurationElement );
99 QDomElement geometryOptionsElement = node.toElement();
100 setGeometryPrecision( geometryOptionsElement.attribute( QStringLiteral(
"geometryPrecision" ), QStringLiteral(
"0.0" ) ).toDouble() );
101 setRemoveDuplicateNodes( geometryOptionsElement.attribute( QStringLiteral(
"removeDuplicateNodes" ), QStringLiteral(
"0" ) ).toInt() == 1 );
103 QDomElement activeChecksElem = node.namedItem( QStringLiteral(
"activeChecks" ) ).toElement();
107 QDomElement checkConfigurationElem = node.namedItem( QStringLiteral(
"checkConfiguration" ) ).toElement();
109 mCheckConfiguration = checkConfiguration.toMap();
void setGeometryChecks(const QStringList &geometryChecks)
A list of activated geometry checks.
void readXml(const QDomNode &node)
Read the geometry options from node.
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...
double geometryPrecision() const
The precision in which geometries on this layer should be saved.
A geometry is the spatial representation of a feature.
void removeDuplicateNodesChanged()
Automatically remove duplicate nodes on all geometries which are edited on this layer.
QStringList geometryChecks() const
A list of activated geometry checks.
static QVariant readVariant(const QDomElement &element)
Read a QVariant from a QDomElement.
void setGeometryPrecision(double value)
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 setRemoveDuplicateNodes(bool value)
Automatically remove duplicate nodes on all geometries which are edited on this layer.
bool isActive() const
Determines if at least one fix is enabled.
void apply(QgsGeometry &geometry) const
Apply any fixes configured on this class to geometry.
void writeXml(QDomNode &node) const
Write the geometry options to the node.
QVariantMap checkConfiguration(const QString &checkId) const
Access the configuration for the check checkId.
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...
void checkConfigurationChanged()
Access the configuration for the check checkId.
void geometryPrecisionChanged()
The precision in which geometries on this layer should be saved.
void setCheckConfiguration(const QString &checkId, const QVariantMap &checkConfiguration)
Set the configuration for the check checkId.
void geometryChecksChanged()
A list of activated geometry checks.
static QDomElement writeVariant(const QVariant &value, QDomDocument &doc)
Write a QVariant to a QDomElement.