QGIS API Documentation
3.12.1-București (121cc00ff0)
|
This is a container for configuration of the snapping of the project. More...
#include <qgssnappingconfig.h>
Classes | |
class | IndividualLayerSettings |
This is a container of advanced configuration (per layer) of the snapping of the project. More... | |
Public Types | |
enum | SnappingMode { ActiveLayer = 1, AllLayers = 2, AdvancedConfiguration = 3 } |
SnappingMode defines on which layer the snapping is performed. More... | |
enum | SnappingType { Vertex = 1, VertexAndSegment = 2, Segment = 3 } |
SnappingType defines on what object the snapping is performed. More... | |
Public Member Functions | |
QgsSnappingConfig (QgsProject *project=nullptr) | |
Constructor with default parameters defined in global settings. More... | |
bool | addLayers (const QList< QgsMapLayer *> &layers) |
Adds the specified layers as individual layers to the configuration with standard configuration. More... | |
bool | enabled () const |
Returns if snapping is enabled. More... | |
QHash< QgsVectorLayer *, QgsSnappingConfig::IndividualLayerSettings > | individualLayerSettings () const |
Returns individual snapping settings for all layers. More... | |
QgsSnappingConfig::IndividualLayerSettings | individualLayerSettings (QgsVectorLayer *vl) const |
Returns individual layer snappings settings (applied if mode is AdvancedConfiguration) More... | |
bool | intersectionSnapping () const |
Returns if the snapping on intersection is enabled. More... | |
SnappingMode | mode () const |
Returns the mode (all layers, active layer, per layer settings) More... | |
bool | operator!= (const QgsSnappingConfig &other) const |
Compare this configuration to other. More... | |
bool | operator== (const QgsSnappingConfig &other) const |
QgsProject * | project () const |
The project from which the snapped layers should be retrieved. More... | |
void | readProject (const QDomDocument &doc) |
Reads the configuration from the specified QGIS project document. More... | |
bool | removeLayers (const QList< QgsMapLayer *> &layers) |
Removes the specified layers from the individual layer configuration. More... | |
void | reset () |
reset to default values More... | |
void | setEnabled (bool enabled) |
enables the snapping More... | |
void | setIndividualLayerSettings (QgsVectorLayer *vl, const QgsSnappingConfig::IndividualLayerSettings &individualLayerSettings) |
Sets individual layer snappings settings (applied if mode is AdvancedConfiguration) More... | |
void | setIntersectionSnapping (bool enabled) |
Sets if the snapping on intersection is enabled. More... | |
void | setMode (SnappingMode mode) |
define the mode of snapping More... | |
void | setProject (QgsProject *project) |
The project from which the snapped layers should be retrieved. More... | |
void | setTolerance (double tolerance) |
Sets the tolerance. More... | |
void | setType (SnappingType type) |
define the type of snapping More... | |
void | setUnits (QgsTolerance::UnitType units) |
Sets the type of units. More... | |
double | tolerance () const |
Returns the tolerance. More... | |
SnappingType | type () const |
Returns the type (vertices and/or segments) More... | |
QgsTolerance::UnitType | units () const |
Returns the type of units. More... | |
void | writeProject (QDomDocument &doc) |
Writes the configuration to the specified QGIS project document. More... | |
Properties | |
QgsProject | project |
This is a container for configuration of the snapping of the project.
Definition at line 34 of file qgssnappingconfig.h.
SnappingMode defines on which layer the snapping is performed.
Enumerator | |
---|---|
ActiveLayer | On the active layer. |
AllLayers | On all vector layers. |
AdvancedConfiguration | On a per layer configuration basis. |
Definition at line 45 of file qgssnappingconfig.h.
SnappingType defines on what object the snapping is performed.
Enumerator | |
---|---|
Vertex | On vertices only. |
VertexAndSegment | Both on vertices and segments. |
Segment | On segments only. |
Definition at line 56 of file qgssnappingconfig.h.
|
explicit |
Constructor with default parameters defined in global settings.
Definition at line 100 of file qgssnappingconfig.cpp.
bool QgsSnappingConfig::addLayers | ( | const QList< QgsMapLayer *> & | layers | ) |
Adds the specified layers as individual layers to the configuration with standard configuration.
When implementing a long-living QgsSnappingConfig (like the one in QgsProject) it is best to directly feed this with information from the layer registry.
true
if changes have been done.Definition at line 372 of file qgssnappingconfig.cpp.
bool QgsSnappingConfig::enabled | ( | ) | const |
Returns if snapping is enabled.
Definition at line 165 of file qgssnappingconfig.cpp.
QHash< QgsVectorLayer *, QgsSnappingConfig::IndividualLayerSettings > QgsSnappingConfig::individualLayerSettings | ( | ) | const |
Returns individual snapping settings for all layers.
Definition at line 245 of file qgssnappingconfig.cpp.
QgsSnappingConfig::IndividualLayerSettings QgsSnappingConfig::individualLayerSettings | ( | QgsVectorLayer * | vl | ) | const |
Returns individual layer snappings settings (applied if mode is AdvancedConfiguration)
Definition at line 250 of file qgssnappingconfig.cpp.
bool QgsSnappingConfig::intersectionSnapping | ( | ) | const |
Returns if the snapping on intersection is enabled.
Definition at line 235 of file qgssnappingconfig.cpp.
QgsSnappingConfig::SnappingMode QgsSnappingConfig::mode | ( | ) | const |
Returns the mode (all layers, active layer, per layer settings)
Definition at line 179 of file qgssnappingconfig.cpp.
bool QgsSnappingConfig::operator!= | ( | const QgsSnappingConfig & | other | ) | const |
Compare this configuration to other.
Definition at line 272 of file qgssnappingconfig.cpp.
bool QgsSnappingConfig::operator== | ( | const QgsSnappingConfig & | other | ) | const |
Definition at line 107 of file qgssnappingconfig.cpp.
QgsProject* QgsSnappingConfig::project | ( | ) | const |
The project from which the snapped layers should be retrieved.
void QgsSnappingConfig::readProject | ( | const QDomDocument & | doc | ) |
Reads the configuration from the specified QGIS project document.
Definition at line 282 of file qgssnappingconfig.cpp.
bool QgsSnappingConfig::removeLayers | ( | const QList< QgsMapLayer *> & | layers | ) |
Removes the specified layers from the individual layer configuration.
When implementing a long-living QgsSnappingConfig (like the one in QgsProject) it is best to directly feed this with information from the layer registry.
true
if changes have been done.Definition at line 393 of file qgssnappingconfig.cpp.
void QgsSnappingConfig::reset | ( | ) |
reset to default values
Definition at line 118 of file qgssnappingconfig.cpp.
void QgsSnappingConfig::setEnabled | ( | bool | enabled | ) |
enables the snapping
Definition at line 170 of file qgssnappingconfig.cpp.
void QgsSnappingConfig::setIndividualLayerSettings | ( | QgsVectorLayer * | vl, |
const QgsSnappingConfig::IndividualLayerSettings & | individualLayerSettings | ||
) |
Sets individual layer snappings settings (applied if mode is AdvancedConfiguration)
Definition at line 263 of file qgssnappingconfig.cpp.
void QgsSnappingConfig::setIntersectionSnapping | ( | bool | enabled | ) |
Sets if the snapping on intersection is enabled.
Definition at line 240 of file qgssnappingconfig.cpp.
void QgsSnappingConfig::setMode | ( | QgsSnappingConfig::SnappingMode | mode | ) |
define the mode of snapping
Definition at line 184 of file qgssnappingconfig.cpp.
void QgsSnappingConfig::setProject | ( | QgsProject * | project | ) |
The project from which the snapped layers should be retrieved.
Definition at line 483 of file qgssnappingconfig.cpp.
void QgsSnappingConfig::setTolerance | ( | double | tolerance | ) |
Sets the tolerance.
Definition at line 212 of file qgssnappingconfig.cpp.
void QgsSnappingConfig::setType | ( | QgsSnappingConfig::SnappingType | type | ) |
define the type of snapping
Definition at line 198 of file qgssnappingconfig.cpp.
void QgsSnappingConfig::setUnits | ( | QgsTolerance::UnitType | units | ) |
Sets the type of units.
Definition at line 226 of file qgssnappingconfig.cpp.
double QgsSnappingConfig::tolerance | ( | ) | const |
Returns the tolerance.
Definition at line 207 of file qgssnappingconfig.cpp.
QgsSnappingConfig::SnappingType QgsSnappingConfig::type | ( | ) | const |
Returns the type (vertices and/or segments)
Definition at line 193 of file qgssnappingconfig.cpp.
QgsTolerance::UnitType QgsSnappingConfig::units | ( | ) | const |
Returns the type of units.
Definition at line 221 of file qgssnappingconfig.cpp.
void QgsSnappingConfig::writeProject | ( | QDomDocument & | doc | ) |
Writes the configuration to the specified QGIS project document.
Definition at line 343 of file qgssnappingconfig.cpp.
|
readwrite |
Definition at line 38 of file qgssnappingconfig.h.