39 , mCheckGeometryType( true )
46 void QgsMapToolDigitizeFeature::digitized(
const QgsFeature &f )
87 return mCheckGeometryType;
128 if ( e->button() != Qt::LeftButton )
139 bool isMatchPointZ =
false;
146 isMatchPointZ =
true;
151 savePoint = fetchPoint;
153 savePoint =
QgsPoint( fetchPoint.
x(), fetchPoint.
y() );
161 savePoint =
QgsPoint( layerPoint.
x(), layerPoint.
y() );
181 g =
QgsGeometry( qgis::make_unique<QgsPoint>( savePoint ) );
200 g =
QgsGeometry( qgis::make_unique<QgsPoint>( savePoint ) );
205 g.get()->addMValue();
241 if ( e->button() == Qt::LeftButton )
249 else if ( error == 2 )
258 else if ( e->button() == Qt::RightButton )
290 QList<QgsPointLocator::Match> snappingMatchesList;
292 if ( hasCurvedSegments && providerSupportsCurvedSegments )
310 if ( hasCurvedSegments && providerSupportsCurvedSegments )
324 f->setGeometry( featGeom );
325 if ( avoidIntersectionsReturn == 1 )
329 if ( f->geometry().isEmpty() )
331 emit
messageEmitted( tr(
"The feature cannot be added because it's geometry collapsed due to intersection avoidance" ),
Qgis::Critical );
virtual void setExteriorRing(QgsCurve *ring)
Sets the exterior ring of the polygon.
QgsCompoundCurve * clone() const override
Clones the geometry by performing a deep copy.
Base class for all map layer types.
virtual QgsVectorDataProvider::Capabilities capabilities() const
Returns flags containing the supported capabilities.
QgsLineString * curveToLine(double tolerance=M_PI_2/90, SegmentationToleranceType toleranceType=MaximumAngle) const override
Returns a new line string geometry corresponding to a segmentized approximation of the curve...
Multi point geometry collection.
static bool isMultiType(Type type)
Returns true if the WKB type is a multi type.
QgsWkbTypes::Type wkbType() const FINAL
Returns the WKBType or WKBUnknown in case of error.
A class to represent a 2D point.
void setCurrentLayer(QgsMapLayer *layer)
Curve polygon geometry type.
A QgsMapMouseEvent is the result of a user interaction with the mouse on a QgsMapCanvas.
QgsWkbTypes::GeometryType geometryType() const
Returns point, line or polygon.
A geometry is the spatial representation of a feature.
QVector< QgsPointXY > QgsMultiPointXY
A collection of QgsPoints that share a common collection of attributes.
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
static bool hasZ(Type type)
Tests whether a WKB type contains the z-dimension.
Map canvas is a class for displaying all GIS data types on a canvas.
bool isEditable() const FINAL
Returns true if the provider is in editing mode.
Type
The WKB type describes the number of dimensions a geometry has.
QgsFields fields() const FINAL
Returns the list of fields of this layer.
void readProject(const QDomDocument &)
Emitted when a project is being read.
bool hasCurvedSegments() const override
Returns true if the geometry contains curved segments.
static QgsGeometry fromMultiPointXY(const QgsMultiPointXY &multipoint)
Creates a new geometry from a QgsMultiPointXY object.
Abstract base class for curved geometry type.
QgsWkbTypes::Type wkbType() const
Returns the WKB type of the geometry.
Point geometry type, with support for z-dimension and m-values.
Supports circular geometry types (circularstring, compoundcurve, curvepolygon)
QgsMapLayer * currentLayer()
returns current layer (set by legend widget)
QgsPointLocator::Match mapPointMatch() const
Returns the matching data from the most recently snapped point.
bool addGeometry(QgsAbstractGeometry *g) override
Adds a geometry and takes ownership. Returns true in case of success.
void setValid(bool validity)
Sets the validity of the feature.
void cleared()
Emitted when the project is cleared (and additionally when an open project is cleared just before a n...
QgsPointXY mapPoint() const
mapPoint returns the point in coordinates
static QgsProject * instance()
Returns the QgsProject singleton instance.
void setGeometry(const QgsGeometry &geometry)
Set the feature's geometry.
static bool hasM(Type type)
Tests whether a WKB type contains m values.
Custom exception class for Coordinate Reference System related exceptions.
QgsVectorDataProvider * dataProvider() FINAL
Returns the layer's data provider, it may be nullptr.
This is the base class for vector data providers.
Represents a vector layer which manages a vector based data sets.
int avoidIntersections(const QList< QgsVectorLayer *> &avoidIntersectionsLayers, const QHash< QgsVectorLayer *, QSet< QgsFeatureId > > &ignoreFeatures=(QHash< QgsVectorLayer *, QSet< QgsFeatureId > >()))
Modifies geometry to avoid intersections with the layers specified in project properties.