QGIS API Documentation
3.8.0-Zanzibar (11aff65)
|
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 369 of file qgssnappingconfig.cpp.
bool QgsSnappingConfig::enabled | ( | ) | const |
Returns if snapping is enabled.
Definition at line 162 of file qgssnappingconfig.cpp.
QHash< QgsVectorLayer *, QgsSnappingConfig::IndividualLayerSettings > QgsSnappingConfig::individualLayerSettings | ( | ) | const |
Returns individual snapping settings for all layers.
Definition at line 242 of file qgssnappingconfig.cpp.
QgsSnappingConfig::IndividualLayerSettings QgsSnappingConfig::individualLayerSettings | ( | QgsVectorLayer * | vl | ) | const |
Returns individual layer snappings settings (applied if mode is AdvancedConfiguration)
Definition at line 247 of file qgssnappingconfig.cpp.
bool QgsSnappingConfig::intersectionSnapping | ( | ) | const |
Returns if the snapping on intersection is enabled.
Definition at line 232 of file qgssnappingconfig.cpp.
QgsSnappingConfig::SnappingMode QgsSnappingConfig::mode | ( | ) | const |
Returns the mode (all layers, active layer, per layer settings)
Definition at line 176 of file qgssnappingconfig.cpp.
bool QgsSnappingConfig::operator!= | ( | const QgsSnappingConfig & | other | ) | const |
Compare this configuration to other.
Definition at line 269 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 279 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 390 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 167 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 260 of file qgssnappingconfig.cpp.
void QgsSnappingConfig::setIntersectionSnapping | ( | bool | enabled | ) |
Sets if the snapping on intersection is enabled.
Definition at line 237 of file qgssnappingconfig.cpp.
void QgsSnappingConfig::setMode | ( | QgsSnappingConfig::SnappingMode | mode | ) |
define the mode of snapping
Definition at line 181 of file qgssnappingconfig.cpp.
void QgsSnappingConfig::setProject | ( | QgsProject * | project | ) |
The project from which the snapped layers should be retrieved.
Definition at line 480 of file qgssnappingconfig.cpp.
void QgsSnappingConfig::setTolerance | ( | double | tolerance | ) |
Sets the tolerance.
Definition at line 209 of file qgssnappingconfig.cpp.
void QgsSnappingConfig::setType | ( | QgsSnappingConfig::SnappingType | type | ) |
define the type of snapping
Definition at line 195 of file qgssnappingconfig.cpp.
void QgsSnappingConfig::setUnits | ( | QgsTolerance::UnitType | units | ) |
Sets the type of units.
Definition at line 223 of file qgssnappingconfig.cpp.
double QgsSnappingConfig::tolerance | ( | ) | const |
Returns the tolerance.
Definition at line 204 of file qgssnappingconfig.cpp.
QgsSnappingConfig::SnappingType QgsSnappingConfig::type | ( | ) | const |
Returns the type (vertices and/or segments)
Definition at line 190 of file qgssnappingconfig.cpp.
QgsTolerance::UnitType QgsSnappingConfig::units | ( | ) | const |
Returns the type of units.
Definition at line 218 of file qgssnappingconfig.cpp.
void QgsSnappingConfig::writeProject | ( | QDomDocument & | doc | ) |
Writes the configuration to the specified QGIS project document.
Definition at line 340 of file qgssnappingconfig.cpp.
|
readwrite |
Definition at line 38 of file qgssnappingconfig.h.