|
QGIS API Documentation 4.0.0-Norrköping (1ddcee3d0e4)
|
Stores configuration of snapping settings for the project. More...
#include <qgssnappingconfig.h>
Classes | |
| class | IndividualLayerSettings |
| A container of advanced configuration (per layer) of the snapping of the project. More... | |
Public Types | |
| enum | ScaleDependencyMode { Disabled = 0 , Global = 1 , PerLayer = 2 } |
| ScaleDependencyMode the scale dependency mode of snapping. 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. | |
| bool | addLayers (const QList< QgsMapLayer * > &layers) |
| Adds the specified layers as individual layers to the configuration with standard configuration. | |
| void | clearIndividualLayerSettings () |
| Removes all individual layer snapping settings. | |
| bool | enabled () const |
| Returns if snapping is enabled. | |
| QHash< QgsVectorLayer *, QgsSnappingConfig::IndividualLayerSettings > | individualLayerSettings () const |
| Returns individual snapping settings for all layers. | |
| QgsSnappingConfig::IndividualLayerSettings | individualLayerSettings (QgsVectorLayer *vl) const |
| Returns individual layer snappings settings (applied if mode is AdvancedConfiguration). | |
| bool | intersectionSnapping () const |
| Returns if the snapping on intersection is enabled. | |
| double | maximumScale () const |
| Returns the max scale (i.e. | |
| double | minimumScale () const |
| Returns the min scale (i.e. | |
| Qgis::SnappingMode | mode () const |
| Returns the mode (all layers, active layer, per layer settings). | |
| bool | operator!= (const QgsSnappingConfig &other) const |
| bool | operator== (const QgsSnappingConfig &other) const |
| QgsProject * | project () const |
| The project from which the snapped layers should be retrieved. | |
| void | readProject (const QDomDocument &doc) |
| Reads the configuration from the specified QGIS project document. | |
| bool | removeLayers (const QList< QgsMapLayer * > &layers) |
| Removes the specified layers from the individual layer configuration. | |
| void | reset () |
| reset to default values | |
| ScaleDependencyMode | scaleDependencyMode () const |
| Returns the scale dependency mode. | |
| bool | selfSnapping () const |
| Returns if self snapping (snapping to the currently digitized feature) is enabled. | |
| void | setEnabled (bool enabled) |
| enables the snapping | |
| void | setIndividualLayerSettings (QgsVectorLayer *vl, const QgsSnappingConfig::IndividualLayerSettings &individualLayerSettings) |
| Sets individual layer snappings settings (applied if mode is AdvancedConfiguration). | |
| void | setIntersectionSnapping (bool enabled) |
| Sets if the snapping on intersection is enabled. | |
| void | setMaximumScale (double maxScale) |
| Set the max scale on which snapping is enabled, 0.0 disable scale limit. | |
| void | setMinimumScale (double minScale) |
| Sets the min scale on which snapping is enabled, 0.0 disable scale limit. | |
| void | setMode (Qgis::SnappingMode mode) |
| define the mode of snapping | |
| void | setProject (QgsProject *project) |
| The project from which the snapped layers should be retrieved. | |
| void | setScaleDependencyMode (ScaleDependencyMode mode) |
| Set the scale dependency mode. | |
| void | setSelfSnapping (bool enabled) |
| Sets if self snapping (snapping to the currently digitized feature) is enabled. | |
| void | setTolerance (double tolerance) |
| Sets the tolerance. | |
| Q_DECL_DEPRECATED void | setType (QgsSnappingConfig::SnappingType type) |
| define the type of snapping | |
| void | setTypeFlag (Qgis::SnappingTypes type) |
| define the type of snapping | |
| void | setUnits (Qgis::MapToolUnit units) |
| Sets the type of units. | |
| double | tolerance () const |
| Returns the tolerance. | |
| Q_DECL_DEPRECATED QgsSnappingConfig::SnappingType | type () const |
| Returns the flags type (vertices | segments | area | centroid | middle). | |
| Qgis::SnappingTypes | typeFlag () const |
| Returns the flags type (vertices | segments | area | centroid | middle). | |
| Qgis::MapToolUnit | units () const |
| Returns the type of units. | |
| void | writeProject (QDomDocument &doc) |
| Writes the configuration to the specified QGIS project document. | |
Static Public Member Functions | |
| static Q_DECL_DEPRECATED QIcon | snappingTypeFlagToIcon (Qgis::SnappingType type) |
| Convenient method to return an icon corresponding to the enum type Qgis::SnappingTypes. | |
| static Q_DECL_DEPRECATED QString | snappingTypeFlagToString (Qgis::SnappingType type) |
| Convenient method to return the translated name of the enum type Qgis::SnappingTypes. | |
| static QIcon | snappingTypeToIcon (Qgis::SnappingType type) |
| Convenient method to return an icon corresponding to the enum type Qgis::SnappingTypes. | |
| static QString | snappingTypeToString (Qgis::SnappingType type) |
| Convenient method to returns the translated name of the enum type Qgis::SnappingTypes. | |
Properties | |
| bool | enabled |
| Qgis::SnappingMode | mode |
| QgsProject * | project |
Stores configuration of snapping settings for the project.
Definition at line 35 of file qgssnappingconfig.h.
ScaleDependencyMode the scale dependency mode of snapping.
| Enumerator | |
|---|---|
| Disabled | No scale dependency. |
| Global | Scale dependency using global min max range. |
| PerLayer | Scale dependency using min max range per layer. |
Definition at line 62 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 48 of file qgssnappingconfig.h.
|
explicit |
Constructor with default parameters defined in global settings.
Definition at line 170 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 594 of file qgssnappingconfig.cpp.
| void QgsSnappingConfig::clearIndividualLayerSettings | ( | ) |
Removes all individual layer snapping settings.
Definition at line 417 of file qgssnappingconfig.cpp.
| bool QgsSnappingConfig::enabled | ( | ) | const |
Returns if snapping is enabled.
Definition at line 237 of file qgssnappingconfig.cpp.
| QHash< QgsVectorLayer *, QgsSnappingConfig::IndividualLayerSettings > QgsSnappingConfig::individualLayerSettings | ( | ) | const |
Returns individual snapping settings for all layers.
Definition at line 399 of file qgssnappingconfig.cpp.
| QgsSnappingConfig::IndividualLayerSettings QgsSnappingConfig::individualLayerSettings | ( | QgsVectorLayer * | vl | ) | const |
Returns individual layer snappings settings (applied if mode is AdvancedConfiguration).
Definition at line 404 of file qgssnappingconfig.cpp.
| bool QgsSnappingConfig::intersectionSnapping | ( | ) | const |
Returns if the snapping on intersection is enabled.
Definition at line 379 of file qgssnappingconfig.cpp.
| double QgsSnappingConfig::maximumScale | ( | ) | const |
Returns the max scale (i.e.
most "zoomed in" scale)
Definition at line 721 of file qgssnappingconfig.cpp.
| double QgsSnappingConfig::minimumScale | ( | ) | const |
Returns the min scale (i.e.
most "zoomed out" scale)
Definition at line 711 of file qgssnappingconfig.cpp.
| Qgis::SnappingMode QgsSnappingConfig::mode | ( | ) | const |
Returns the mode (all layers, active layer, per layer settings).
Definition at line 251 of file qgssnappingconfig.cpp.
| bool QgsSnappingConfig::operator!= | ( | const QgsSnappingConfig & | other | ) | const |
Definition at line 431 of file qgssnappingconfig.cpp.
| bool QgsSnappingConfig::operator== | ( | const QgsSnappingConfig & | other | ) | const |
Definition at line 177 of file qgssnappingconfig.cpp.
| QgsProject * QgsSnappingConfig::project | ( | ) | const |
The project from which the snapped layers should be retrieved.
Definition at line 696 of file qgssnappingconfig.cpp.
| void QgsSnappingConfig::readProject | ( | const QDomDocument & | doc | ) |
Reads the configuration from the specified QGIS project document.
Definition at line 444 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 615 of file qgssnappingconfig.cpp.
| void QgsSnappingConfig::reset | ( | ) |
reset to default values
Definition at line 192 of file qgssnappingconfig.cpp.
| QgsSnappingConfig::ScaleDependencyMode QgsSnappingConfig::scaleDependencyMode | ( | ) | const |
Returns the scale dependency mode.
Definition at line 736 of file qgssnappingconfig.cpp.
| bool QgsSnappingConfig::selfSnapping | ( | ) | const |
Returns if self snapping (snapping to the currently digitized feature) is enabled.
Definition at line 389 of file qgssnappingconfig.cpp.
| void QgsSnappingConfig::setEnabled | ( | bool | enabled | ) |
enables the snapping
Definition at line 242 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 422 of file qgssnappingconfig.cpp.
| void QgsSnappingConfig::setIntersectionSnapping | ( | bool | enabled | ) |
Sets if the snapping on intersection is enabled.
Definition at line 384 of file qgssnappingconfig.cpp.
| void QgsSnappingConfig::setMaximumScale | ( | double | maxScale | ) |
Set the max scale on which snapping is enabled, 0.0 disable scale limit.
Definition at line 726 of file qgssnappingconfig.cpp.
| void QgsSnappingConfig::setMinimumScale | ( | double | minScale | ) |
Sets the min scale on which snapping is enabled, 0.0 disable scale limit.
Definition at line 716 of file qgssnappingconfig.cpp.
| void QgsSnappingConfig::setMode | ( | Qgis::SnappingMode | mode | ) |
define the mode of snapping
Definition at line 256 of file qgssnappingconfig.cpp.
| void QgsSnappingConfig::setProject | ( | QgsProject * | project | ) |
The project from which the snapped layers should be retrieved.
Definition at line 701 of file qgssnappingconfig.cpp.
| void QgsSnappingConfig::setScaleDependencyMode | ( | QgsSnappingConfig::ScaleDependencyMode | mode | ) |
| void QgsSnappingConfig::setSelfSnapping | ( | bool | enabled | ) |
Sets if self snapping (snapping to the currently digitized feature) is enabled.
Definition at line 394 of file qgssnappingconfig.cpp.
| void QgsSnappingConfig::setTolerance | ( | double | tolerance | ) |
Sets the tolerance.
Definition at line 356 of file qgssnappingconfig.cpp.
| void QgsSnappingConfig::setType | ( | QgsSnappingConfig::SnappingType | type | ) |
define the type of snapping
Definition at line 324 of file qgssnappingconfig.cpp.
| void QgsSnappingConfig::setTypeFlag | ( | Qgis::SnappingTypes | type | ) |
| void QgsSnappingConfig::setUnits | ( | Qgis::MapToolUnit | units | ) |
Sets the type of units.
Definition at line 370 of file qgssnappingconfig.cpp.
|
inlinestatic |
Convenient method to return an icon corresponding to the enum type Qgis::SnappingTypes.
Definition at line 99 of file qgssnappingconfig.h.
|
inlinestatic |
Convenient method to return the translated name of the enum type Qgis::SnappingTypes.
Definition at line 83 of file qgssnappingconfig.h.
|
static |
Convenient method to return an icon corresponding to the enum type Qgis::SnappingTypes.
Definition at line 302 of file qgssnappingconfig.cpp.
|
static |
Convenient method to returns the translated name of the enum type Qgis::SnappingTypes.
Definition at line 280 of file qgssnappingconfig.cpp.
| double QgsSnappingConfig::tolerance | ( | ) | const |
Returns the tolerance.
Definition at line 351 of file qgssnappingconfig.cpp.
| QgsSnappingConfig::SnappingType QgsSnappingConfig::type | ( | ) | const |
Returns the flags type (vertices | segments | area | centroid | middle).
Definition at line 270 of file qgssnappingconfig.cpp.
| Qgis::SnappingTypes QgsSnappingConfig::typeFlag | ( | ) | const |
Returns the flags type (vertices | segments | area | centroid | middle).
Definition at line 265 of file qgssnappingconfig.cpp.
| Qgis::MapToolUnit QgsSnappingConfig::units | ( | ) | const |
Returns the type of units.
Definition at line 365 of file qgssnappingconfig.cpp.
| void QgsSnappingConfig::writeProject | ( | QDomDocument & | doc | ) |
Writes the configuration to the specified QGIS project document.
Definition at line 559 of file qgssnappingconfig.cpp.
|
readwrite |
Definition at line 40 of file qgssnappingconfig.h.
|
readwrite |
Definition at line 41 of file qgssnappingconfig.h.
|
readwrite |
Definition at line 39 of file qgssnappingconfig.h.