QGIS API Documentation 3.32.0-Lima (311a8cb8a6)
Public Member Functions | Public Attributes | List of all members
QgsSnappingUtils::LayerConfig Struct Reference

Configures how a certain layer should be handled in a snapping operation. More...

#include <qgssnappingutils.h>

Public Member Functions

 LayerConfig (QgsVectorLayer *l, QgsPointLocator::Types t, double tol, Qgis::MapToolUnit u)
 Create a new configuration for a snapping layer. More...
 
bool operator!= (const QgsSnappingUtils::LayerConfig &other) const
 
bool operator== (const QgsSnappingUtils::LayerConfig &other) const
 

Public Attributes

QgsVectorLayerlayer = nullptr
 The layer to configure. More...
 
double tolerance
 The range around snapping targets in which snapping should occur. More...
 
QgsPointLocator::Types type
 To which geometry properties of this layers a snapping should happen. More...
 
Qgis::MapToolUnit unit
 The units in which the tolerance is specified. More...
 

Detailed Description

Configures how a certain layer should be handled in a snapping operation.

Definition at line 122 of file qgssnappingutils.h.

Constructor & Destructor Documentation

◆ LayerConfig()

QgsSnappingUtils::LayerConfig::LayerConfig ( QgsVectorLayer l,
QgsPointLocator::Types  t,
double  tol,
Qgis::MapToolUnit  u 
)
inline

Create a new configuration for a snapping layer.

snapper = QgsMapCanvasSnappingUtils(mapCanvas)
snapping_layer1 = QgsSnappingUtils.LayerConfig(layer1, QgsPointLocator.Vertex, 10, Qgis::MapToolUnit::Pixels)
snapping_layer2 = QgsSnappingUtils.LayerConfig(layer2, QgsPointLocator.Vertex and QgsPointLocator.Edge, 10, Qgis::MapToolUnit::Pixels)
snapper.setLayers([snapping_layer1, snapping_layer2])
Snapping utils instance that is connected to a canvas and updates the configuration (map settings + c...
Configures how a certain layer should be handled in a snapping operation.
Parameters
lThe vector layer for which this configuration is
tWhich parts of the geometry should be snappable
tolThe tolerance radius in which the snapping will trigger
uThe unit in which the tolerance is specified

Definition at line 142 of file qgssnappingutils.h.

Member Function Documentation

◆ operator!=()

bool QgsSnappingUtils::LayerConfig::operator!= ( const QgsSnappingUtils::LayerConfig other) const
inline

Definition at line 154 of file qgssnappingutils.h.

◆ operator==()

bool QgsSnappingUtils::LayerConfig::operator== ( const QgsSnappingUtils::LayerConfig other) const
inline

Definition at line 150 of file qgssnappingutils.h.

Member Data Documentation

◆ layer

QgsVectorLayer* QgsSnappingUtils::LayerConfig::layer = nullptr

The layer to configure.

Definition at line 160 of file qgssnappingutils.h.

◆ tolerance

double QgsSnappingUtils::LayerConfig::tolerance

The range around snapping targets in which snapping should occur.

Definition at line 164 of file qgssnappingutils.h.

◆ type

QgsPointLocator::Types QgsSnappingUtils::LayerConfig::type

To which geometry properties of this layers a snapping should happen.

Definition at line 162 of file qgssnappingutils.h.

◆ unit

Qgis::MapToolUnit QgsSnappingUtils::LayerConfig::unit

The units in which the tolerance is specified.

Definition at line 166 of file qgssnappingutils.h.


The documentation for this struct was generated from the following file: