25void QgsMapToolCaptureLayerGeometry::geometryCaptured(
const QgsGeometry &geometry )
44 if ( !hasCurvedSegments || !providerSupportsCurvedSegments )
47 QList<QgsVectorLayer *> avoidIntersectionsLayers;
52 avoidIntersectionsLayers.append( vlayer );
60 if ( avoidIntersectionsLayers.size() > 0 )
62 const int avoidIntersectionsReturn = g.avoidIntersections( avoidIntersectionsLayers );
63 if ( avoidIntersectionsReturn == 3 )
65 emit
messageEmitted( tr(
"The feature has been added, but at least one geometry intersected is invalid. These geometries must be manually repaired." ), Qgis::MessageLevel::Warning );
69 emit
messageEmitted( tr(
"The feature cannot be added because its geometry collapsed due to intersection avoidance" ), Qgis::MessageLevel::Critical );
77 layerGeometryCaptured( g );
84 layerPointCaptured( *qgsgeometry_cast<const QgsPoint *>( g.constGet() ) );
87 layerLineCaptured( qgsgeometry_cast<const QgsCurve *>( g.constGet() ) );
90 layerPolygonCaptured( qgsgeometry_cast<const QgsCurvePolygon *>( g.constGet() ) );
@ AvoidIntersectionsLayers
Overlap with features from a specified list of layers when digitizing new features not allowed.
@ AllowIntersections
Overlap with any feature allowed when digitizing new features.
@ AvoidIntersectionsCurrentLayer
Overlap with features from the active layer when digitizing new features not allowed.
bool hasCurvedSegments() const override
Returns true if the geometry contains curved segments.
A geometry is the spatial representation of a feature.
static QgsProject * instance()
Returns the QgsProject singleton instance.
QList< QgsVectorLayer * > avoidIntersectionsLayers
@ CircularGeometries
Supports circular geometry types (circularstring, compoundcurve, curvepolygon)
virtual Q_INVOKABLE QgsVectorDataProvider::Capabilities capabilities() const
Returns flags containing the supported capabilities.
Represents a vector layer which manages a vector based data sets.
QgsVectorDataProvider * dataProvider() FINAL
Returns the layer's data provider, it may be nullptr.