47 , mCaptureMode( mode )
48 , mCaptureModeFromLayer( mode == CaptureNone )
57 this, &QgsMapToolCapture::currentLayerChanged );
62 mExtraSnapLayer =
new QgsVectorLayer( QStringLiteral(
"LineString?crs=" ), QStringLiteral(
"extra snap" ), QStringLiteral(
"memory" ), layerOptions );
66 mExtraSnapFeatureId = f.
id();
69 this, &QgsMapToolCapture::updateExtraSnapLayer );
82 mCanvas->snappingUtils()->removeExtraSnapLayer( mExtraSnapLayer );
84 mExtraSnapLayer->deleteLater();
85 mExtraSnapLayer =
nullptr;
91 mValidator->deleteLater();
117 if ( mTempRubberBand )
118 mTempRubberBand->show();
120 mCanvas->snappingUtils()->addExtraSnapLayer( mExtraSnapLayer );
124 mCurrentShapeMapTool->
activate( mCaptureMode, mCaptureLastPoint );
129 if ( mTempRubberBand )
130 mTempRubberBand->hide();
134 mCanvas->snappingUtils()->removeExtraSnapLayer( mExtraSnapLayer );
142void QgsMapToolCapture::currentLayerChanged(
QgsMapLayer *layer )
144 if ( !mCaptureModeFromLayer )
171 if ( mTempRubberBand )
179bool QgsMapToolCapture::tracingEnabled()
187QgsPointXY QgsMapToolCapture::tracingStartPoint()
192 return mTracingStartPoint;
194 return mCaptureLastPoint;
220 mTempRubberBand->addPoint( mCaptureLastPoint );
226 const QgsPoint lastPoint = mCaptureLastPoint;
228 if ( lastPointXY == pt0 &&
points[0] != lastPointXY )
244 for (
int i = 1; i <
points.count(); ++i )
255bool QgsMapToolCapture::tracingAddVertex(
const QgsPointXY &point )
261 if ( mTempRubberBand->pointsCount() == 0 )
263 if ( !tracer->
init() )
273 mTracingStartPoint = point;
283 const QVector<QgsPointXY> tracedPointsInMapCrs = tracer->
findShortestPath( pt0, point, &err );
284 if ( tracedPointsInMapCrs.isEmpty() )
289 layerPoints.reserve( tracedPointsInMapCrs.size() );
291 mapPoints.reserve( tracedPointsInMapCrs.size() );
292 for (
const QgsPointXY &tracedPointMapCrs : tracedPointsInMapCrs )
313 mCaptureCurve.
moveVertex( lastVertexId, layerPoints.first() );
314 mSnappingMatches.removeLast();
317 int pointBefore = mCaptureCurve.
numPoints();
327 if ( vlayer &&
capabilities().testFlag( QgsMapToolCapture::Capability::SupportsCurves ) && vlayer->
dataProvider()->
capabilities().testFlag( QgsVectorDataProvider::Capability::CircularGeometries ) )
336 mCaptureCurve.
clear();
337 mCaptureCurve.
addCurve( qgsgeometry_cast< const QgsCurve * >( curved.
constGet() )->clone() );
341 mCaptureCurve = *qgsgeometry_cast<QgsCompoundCurve *>( curved.
constGet() );
347 const int pointAfter = mCaptureCurve.
numPoints();
348 for ( ; pointBefore < pointAfter; ++pointBefore )
360QgsMapToolCaptureRubberBand *QgsMapToolCapture::createCurveRubberBand()
const
362 QgsMapToolCaptureRubberBand *rb =
new QgsMapToolCaptureRubberBand(
mCanvas );
367 color.setAlphaF( color.alphaF() * alphaScale );
368 rb->setLineStyle( Qt::DotLine );
369 rb->setStrokeColor( color );
372 rb->setFillColor( fillColor );
377void QgsMapToolCapture::resetRubberBand()
410 if ( mCurrentCaptureTechnique == technique )
413 mStartNewCurve =
true;
439 if ( mTempRubberBand )
440 mTempRubberBand->setStringType( mLineDigitizingType );
442 mCurrentCaptureTechnique = technique;
447 mCurrentShapeMapTool->
activate( mCaptureMode, mCaptureLastPoint );
453 if ( mCurrentShapeMapTool )
455 if ( shapeMapToolMetadata && mCurrentShapeMapTool->
id() == shapeMapToolMetadata->
id() )
459 mCurrentShapeMapTool->deleteLater();
462 mCurrentShapeMapTool.
reset( shapeMapToolMetadata ? shapeMapToolMetadata->
factory(
this ) :
nullptr );
467 if ( mCurrentShapeMapTool )
468 mCurrentShapeMapTool->
activate( mCaptureMode, mCaptureLastPoint );
482 if ( !mCurrentShapeMapTool )
484 emit
messageEmitted( tr(
"Select an option from the Shape Digitizing Toolbar in order to capture shapes" ), Qgis::MessageLevel::Warning );
488 if ( !mTempRubberBand )
490 mTempRubberBand.
reset( createCurveRubberBand() );
491 mTempRubberBand->setStringType( mLineDigitizingType );
503 if ( mCaptureMode !=
CapturePoint && mTempRubberBand && mCapturing )
505 bool hasTrace =
false;
509 if ( !mCaptureCurve.
isEmpty() )
516 mAllowAddingStreamingPoints =
true;
518 mAllowAddingStreamingPoints =
false;
520 else if ( tracingEnabled() && mCaptureCurve.
numPoints() != 0 )
527 mTempRubberBand->curveIsComplete() )
528 mCircularItermediatePoint = mTempRubberBand->pointFromEnd( 1 );
530 !mTempRubberBand->curveIsComplete() )
531 mCircularItermediatePoint =
QgsPoint();
533 hasTrace = tracingMouseMove( e );
539 mTempRubberBand->addPoint( mCaptureLastPoint );
540 if ( !mCircularItermediatePoint.
isEmpty() )
542 mTempRubberBand->movePoint( mCircularItermediatePoint );
543 mTempRubberBand->addPoint( mCircularItermediatePoint );
552 const QgsPoint mapPt = mCaptureLastPoint;
554 if ( mTempRubberBand )
556 mTempRubberBand->movePoint(
mapPoint );
557 mTempRubberBand->movePoint( 0, mapPt );
564 else if ( mTempRubberBand )
565 mTempRubberBand->movePoint(
mapPoint );
587 QgsDebugMsg( QStringLiteral(
"transformation to layer coordinate failed" ) );
619 if ( match.
isValid() && sourceLayer )
623 if ( sourceLayer->
crs() != vlayer->
crs() )
677 QgsDebugMsg( QStringLiteral(
"invalid capture mode" ) );
706 mSnappingMatches.append( match );
710 if ( mCaptureFirstPoint.
isEmpty() )
718 if ( !mTempRubberBand )
720 mTempRubberBand.
reset( createCurveRubberBand() );
721 mTempRubberBand->setStringType( mLineDigitizingType );
725 bool traceCreated =
false;
726 if ( tracingEnabled() )
728 traceCreated = tracingAddVertex(
mapPoint );
733 mTracingStartPoint = traceCreated ? point :
QgsPointXY();
738 mTempRubberBand->movePoint(
mapPoint );
739 if ( mTempRubberBand->curveIsComplete() )
741 if (
QgsCurve *curve = mTempRubberBand->curve() )
746 if ( match.
isValid() && mSnappingMatches.count() > 0 && !mSnappingMatches.last().isValid() )
748 mSnappingMatches.removeLast();
752 mSnappingMatches.removeLast();
753 mSnappingMatches.append( mCircularIntermediateMatch );
755 mSnappingMatches.append( match );
761 else if ( mTempRubberBand->pointsCount() == 0 )
765 mSnappingMatches.append( match );
771 mCircularIntermediateMatch = match;
775 mTempRubberBand->addPoint(
mapPoint );
780 mTempRubberBand->addPoint( mCaptureLastPoint );
784 updateExtraSnapLayer();
802 if ( mTempRubberBand )
806 mTempRubberBand->addPoint( endPt );
813 c->transform( ct, Qgis::TransformDirection::Reverse );
815 const int countBefore = mCaptureCurve.
vertexCount();
822 mCaptureCurve.
addCurve(
c, !mStartNewCurve );
823 mStartNewCurve =
false;
825 const int countAfter = mCaptureCurve.
vertexCount();
826 const int addedPoint = countAfter - countBefore;
828 updateExtraSnapLayer();
830 for (
int i = 0; i < addedPoint; ++i )
840 mCaptureCurve.
clear();
841 updateExtraSnapLayer();
846 return mSnappingMatches;
853 if ( mTempRubberBand )
855 if (
size() <= 1 && mTempRubberBand->pointsCount() != 0 )
858 if ( isAutoRepeat && mIgnoreSubsequentAutoRepeatUndo )
860 mIgnoreSubsequentAutoRepeatUndo =
false;
862 const QgsPoint lastPoint = mTempRubberBand->lastPoint();
866 mTempRubberBand->removeLastPoint();
867 mTempRubberBand->movePoint( lastPoint );
872 vertexToRemove.
part = 0;
873 vertexToRemove.
ring = 0;
885 const int curvesBefore = mCaptureCurve.
nCurves();
886 const bool lastCurveIsLineString = qgsgeometry_cast< QgsLineString * >( mCaptureCurve.
curveAt( curvesBefore - 1 ) );
888 const int pointsCountBefore = mCaptureCurve.
numPoints();
890 int pointsCountAfter = mCaptureCurve.
numPoints();
891 for ( ; pointsCountAfter < pointsCountBefore; pointsCountAfter++ )
892 if ( !mSnappingMatches.empty() )
893 mSnappingMatches.removeLast();
899 if ( mCaptureCurve.
nCurves() < curvesBefore && lastCurveIsLineString )
900 mIgnoreSubsequentAutoRepeatUndo =
true;
903 updateExtraSnapLayer();
913 mTempRubberBand->addPoint( mCaptureLastPoint );
914 mTempRubberBand->movePoint( lastPoint );
927 if ( e->isAccepted() )
938 if ( e->key() == Qt::Key_Backspace || e->key() == Qt::Key_Delete )
942 if ( !e->isAutoRepeat() )
944 mCurrentShapeMapTool->
undo();
949 undo( e->isAutoRepeat() );
955 else if ( e->key() == Qt::Key_Escape )
957 if ( mCurrentShapeMapTool )
958 mCurrentShapeMapTool->
clean();
983 qDeleteAll( mGeomErrorMarkers );
984 mGeomErrorMarkers.clear();
993 mCaptureCurve.
clear();
994 updateExtraSnapLayer();
995 mSnappingMatches.clear();
997 lCurrentVectorLayer->triggerRepaint();
1002 mTempRubberBand.
reset();
1009 mCurrentShapeMapTool->
clean();
1016 mCaptureCurve.
close();
1017 updateExtraSnapLayer();
1020void QgsMapToolCapture::validateGeometry()
1029 mValidator->deleteLater();
1030 mValidator =
nullptr;
1033 mGeomErrors.clear();
1034 while ( !mGeomErrorMarkers.isEmpty() )
1036 delete mGeomErrorMarkers.takeFirst();
1041 switch ( mCaptureMode )
1055 exteriorRing->
close();
1067 method = Qgis::GeometryValidationEngine::Geos;
1070 mValidator->start();
1087 vm->setToolTip( e.
what() );
1089 vm->setZValue( vm->zValue() + 1 );
1090 mGeomErrorMarkers << vm;
1101 QVector<QgsPointXY> pointsXY;
1110 mCaptureCurve.
points( pts );
1117 mCaptureCurve.
clear();
1119 updateExtraSnapLayer();
1120 mSnappingMatches.clear();
1121 for (
int i = 0; i < line->
length(); ++i )
1129 mCaptureCurve.
clear();
1131 updateExtraSnapLayer();
1132 mSnappingMatches.clear();
1133 for (
int i = 0; i < line->
length(); ++i )
1190 if ( match.
layer() )
1208void QgsMapToolCapture::updateExtraSnapLayer()
1210 if ( !mExtraSnapLayer )
1213 if (
canvas()->snappingUtils()->config().selfSnapping() &&
layer() && mCaptureCurve.
numPoints() >= 2 )
1221 qgsgeometry_cast<QgsCompoundCurve *>( geom.
get() )->close();
1238 if ( e->button() != Qt::LeftButton )
1242 bool isMatchPointZ =
false;
1243 bool isMatchPointM =
false;
1254 if ( isMatchPointM && isMatchPointZ )
1256 geomType = QgsWkbTypes::Type::PointZM;
1258 else if ( isMatchPointM )
1260 geomType = QgsWkbTypes::Type::PointM;
1262 else if ( isMatchPointZ )
1264 geomType = QgsWkbTypes::Type::PointZ;
1266 savePoint =
QgsPoint( geomType, fetchPoint.
x(), fetchPoint.
y(), fetchPoint.
z(), fetchPoint.
m() );
1272 savePoint =
QgsPoint( point.
x(), point.
y(), fetchPoint.
z(), fetchPoint.
m() );
1278 emit
messageEmitted( tr(
"Cannot transform the point to the layer's coordinate system" ), Qgis::MessageLevel::Warning );
1282 QgsGeometry g( std::make_unique<QgsPoint>( savePoint ) );
1287 geometryCaptured( g );
1288 pointCaptured( savePoint );
1299 bool digitizingFinished =
false;
1303 if ( !mCurrentShapeMapTool )
1305 emit
messageEmitted( tr(
"Select an option from the Shape Digitizing Toolbar in order to capture shapes" ), Qgis::MessageLevel::Warning );
1310 if ( !mTempRubberBand )
1312 mTempRubberBand.
reset( createCurveRubberBand() );
1313 mTempRubberBand->setStringType( mLineDigitizingType );
1318 if ( digitizingFinished )
1319 mCurrentShapeMapTool->
clean();
1325 if ( e->button() == Qt::LeftButton )
1331 emit
messageEmitted( tr(
"Cannot transform the point to the layers coordinate system" ), Qgis::MessageLevel::Warning );
1337 else if ( e->button() == Qt::RightButton )
1361 digitizingFinished =
true;
1365 if ( digitizingFinished )
1373 geometryCaptured( g );
1374 lineCaptured( curveToAdd );
1381 geometryCaptured( g );
1382 polygonCaptured( poly );
void setParentOwner(QObject *parent)
Sets the parent object.
void reset(T *p=nullptr)
Will reset the managed pointer to p.
void reset(T *p=nullptr)
Will reset the managed pointer to p.
T * release()
Clears the pointer and returns it.
CaptureTechnique
Capture technique.
@ StraightSegments
Default capture mode - capture occurs with straight line segments.
@ CircularString
Capture in circular strings.
@ Streaming
Streaming points digitizing mode (points are automatically added as the mouse cursor moves).
GeometryValidationEngine
Available engines for validating geometries.
bool is3D() const SIP_HOLDGIL
Returns true if the geometry is 3D and contains a z-value.
virtual QgsPoint vertexAt(QgsVertexId id) const =0
Returns the point corresponding to a specified vertex id.
QgsWkbTypes::Type wkbType() const SIP_HOLDGIL
Returns the WKB type of the geometry.
bool isMeasure() const SIP_HOLDGIL
Returns true if the geometry contains m values.
static QCursor getThemeCursor(Cursor cursor)
Helper to get a theme cursor.
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.
void close()
Appends first point if not already closed.
QgsPoint endPoint() const override SIP_HOLDGIL
Returns the end point of the curve.
const QgsCurve * curveAt(int i) const SIP_HOLDGIL
Returns the curve at the specified index.
int numPoints() const override SIP_HOLDGIL
Returns the number of points in the curve.
void removeCurve(int i)
Removes a curve from the geometry.
void addCurve(QgsCurve *c, bool extendPrevious=false)
Adds a curve to the geometry (takes ownership).
bool moveVertex(QgsVertexId position, const QgsPoint &newPos) override
Moves a vertex within the geometry.
bool deleteVertex(QgsVertexId position) override
Deletes a vertex within the geometry.
QgsCompoundCurve * clone() const override
Clones the geometry by performing a deep copy.
void points(QgsPointSequence &pts) const override
Returns a list of points within the curve.
void clear() override
Clears the geometry, ie reset it to a null geometry.
QgsPoint startPoint() const override SIP_HOLDGIL
Returns the starting point of the curve.
bool isEmpty() const override SIP_HOLDGIL
Returns true if the geometry is empty.
void addVertex(const QgsPoint &pt)
Adds a vertex to the end of the geometry.
int nCurves() const SIP_HOLDGIL
Returns the number of curves in the geometry.
Custom exception class for Coordinate Reference System related exceptions.
Curve polygon geometry type.
virtual void setExteriorRing(QgsCurve *ring)
Sets the exterior ring of the polygon.
Abstract base class for curved geometry type.
QgsCurve * segmentize(double tolerance=M_PI_2/90, SegmentationToleranceType toleranceType=MaximumAngle) const override
Returns a geometry without curves.
int vertexCount(int part=0, int ring=0) const override
Returns the number of vertices of which this geometry is built.
virtual QgsPoint endPoint() const =0
Returns the end point of the curve.
bool nextFeature(QgsFeature &f)
This class wraps a request for features to a vector layer (or directly its vector data provider).
QgsFeatureRequest & setFilterFid(QgsFeatureId fid)
Sets the feature ID that should be fetched.
The feature class encapsulates a single feature including its unique ID, geometry and a list of field...
void errorFound(const QgsGeometry::Error &error)
Sent when an error has been found during the validation process.
bool hasWhere() const
true if the location available from
QgsPointXY where() const
The coordinates at which the error is located and should be visualized.
QString what() const
A human readable error message containing details about the error.
A geometry is the spatial representation of a feature.
const QgsAbstractGeometry * constGet() const SIP_HOLDGIL
Returns a non-modifiable (const) reference to the underlying abstract geometry primitive.
QgsWkbTypes::Type wkbType() const SIP_HOLDGIL
Returns type of the geometry as a WKB type (point / linestring / polygon etc.)
bool vertexIdFromVertexNr(int number, QgsVertexId &id) const
Calculates the vertex ID from a vertex number.
QgsPoint vertexAt(int atVertex) const
Returns coordinates of a vertex.
QgsAbstractGeometry * get()
Returns a modifiable (non-const) reference to the underlying abstract geometry primitive.
QgsGeometry convertToCurves(double distanceTolerance=1e-8, double angleTolerance=1e-8) const
Attempts to convert a non-curved geometry into a curved geometry type (e.g.
static void convertPointList(const QVector< QgsPointXY > &input, QgsPointSequence &output)
Upgrades a point list from QgsPointXY to QgsPoint.
Line string geometry type, with support for z-dimension and m-values.
double length() const override SIP_HOLDGIL
Returns the planar, 2-dimensional length of the geometry.
void close()
Closes the line string by appending the first point to the end of the line, if it is not already clos...
Extension of QgsTracer that provides extra functionality:
QAction * actionEnableSnapping() const
Access to action that user may use to toggle snapping on/off.
void reportError(PathError err, bool addingVertex)
Report a path finding error to the user.
QAction * actionEnableTracing() const
Access to action that user may use to toggle tracing on/off. May be nullptr if no action was associat...
static QgsMapCanvasTracer * tracerForCanvas(QgsMapCanvas *canvas)
Retrieve instance of this class associated with given canvas (if any).
Map canvas is a class for displaying all GIS data types on a canvas.
void currentLayerChanged(QgsMapLayer *layer)
Emitted when the current layer is changed.
QgsMapLayer * currentLayer()
returns current layer (set by legend widget)
Base class for all map layer types.
QgsCoordinateReferenceSystem crs
void setCrs(const QgsCoordinateReferenceSystem &srs, bool emitSignal=true)
Sets layer's spatial reference system.
A QgsMapMouseEvent is the result of a user interaction with the mouse on a QgsMapCanvas.
bool isSnapped() const
Returns true if there is a snapped point cached.
QgsPointXY mapPoint() const
mapPoint returns the point in coordinates
QgsPointLocator::Match mapPointMatch() const
Returns the matching data from the most recently snapped point.
A class to represent a 2D point.
Point geometry type, with support for z-dimension and m-values.
bool addMValue(double mValue=0) override
Adds a measure to the geometry, initialized to a preset value.
bool dropMValue() override
Drops any measure values which exist in the geometry.
bool isEmpty() const override SIP_HOLDGIL
Returns true if the geometry is empty.
bool addZValue(double zValue=0) override
Adds a z-dimension to the geometry, initialized to a preset value.
bool convertTo(QgsWkbTypes::Type type) override
Converts the geometry to a specified type.
void setZ(double z) SIP_HOLDGIL
Sets the point's z-coordinate.
bool dropZValue() override
Drops any z-dimensions which exist in the geometry.
void setM(double m) SIP_HOLDGIL
Sets the point's m-value.
void setExteriorRing(QgsCurve *ring) override
Sets the exterior ring of the polygon.
static QgsProject * instance()
Returns the QgsProject singleton instance.
void snappingConfigChanged(const QgsSnappingConfig &config)
Emitted whenever the configuration for snapping has changed.
A class for drawing transient features (e.g.
void movePoint(const QgsPointXY &p, int geometryIndex=0, int ringIndex=0)
Moves the rubber band point specified by index.
const QgsPointXY * getPoint(int i, int j=0, int ringIndex=0) const
Returns a vertex.
void reset(QgsWkbTypes::GeometryType geometryType=QgsWkbTypes::LineGeometry)
Clears all the geometries in this rubberband.
int numberOfVertices() const
Returns count of vertices in all lists of mPoint.
void addGeometry(const QgsGeometry &geometry, QgsMapLayer *layer, bool doUpdate=true)
Adds the geometry of an existing feature to a rubberband This is useful for multi feature highlightin...
T value(const QString &dynamicKeyPart=QString()) const
Returns settings value.
static const QgsSettingsEntryBool settingsDigitizingConvertToCurve
Settings entry digitizing convert to curve.
static const QgsSettingsEntryInteger settingsDigitizingStreamTolerance
Settings entry digitizing stream tolerance.
static const QgsSettingsEntryDouble settingsDigitizingConvertToCurveDistanceTolerance
Settings entry digitizing convert to curve distance tolerance.
static const QgsSettingsEntryInteger settingsDigitizingValidateGeometries
Settings entry digitizing validate geometries.
static const QgsSettingsEntryDouble settingsDigitizingConvertToCurveAngleTolerance
Settings entry digitizing convert to curve angle tolerance.
static const QgsSettingsEntryDouble settingsDigitizingLineColorAlphaScale
Settings entry digitizing line color alpha scale.
Class that shows snapping marker on map canvas for the current snapping match.
bool isPointSnapped(const QgsPointXY &pt)
Find out whether the point is snapped to a vertex or edge (i.e. it can be used for tracing start/stop...
QVector< QgsPointXY > findShortestPath(const QgsPointXY &p1, const QgsPointXY &p2, PathError *error=nullptr)
Given two points, find the shortest path and return points on the way.
PathError
Possible errors that may happen when calling findShortestPath()
@ ErrTooManyFeatures
Max feature count threshold was reached while reading features.
bool init()
Build the internal data structures.
virtual Q_INVOKABLE QgsVectorDataProvider::Capabilities capabilities() const
Returns flags containing the supported capabilities.
Represents a vector layer which manages a vector based data sets.
Q_INVOKABLE QgsWkbTypes::Type wkbType() const FINAL
Returns the WKBType or WKBUnknown in case of error.
Q_INVOKABLE QgsWkbTypes::GeometryType geometryType() const
Returns point, line or polygon.
Q_INVOKABLE bool startEditing()
Makes the layer editable.
QgsFeatureIterator getFeatures(const QgsFeatureRequest &request=QgsFeatureRequest()) const FINAL
Queries the layer for features specified in request.
QgsVectorDataProvider * dataProvider() FINAL
Returns the layer's data provider, it may be nullptr.
QgsFeature getFeature(QgsFeatureId fid) const
Queries the layer for the feature with the given id.
bool addFeature(QgsFeature &feature, QgsFeatureSink::Flags flags=QgsFeatureSink::Flags()) FINAL
Adds a single feature to the sink.
bool changeGeometry(QgsFeatureId fid, QgsGeometry &geometry, bool skipDefaultValue=false)
Changes a feature's geometry within the layer's edit buffer (but does not immediately commit the chan...
A class for marking vertices of features using e.g.
void setPenWidth(int width)
void setCenter(const QgsPointXY &point)
Sets the center point of the marker, in map coordinates.
void setIconType(int iconType)
void setColor(const QColor &color)
Sets the stroke color for the marker.
static bool hasM(Type type) SIP_HOLDGIL
Tests whether a WKB type contains m values.
Type
The WKB type describes the number of dimensions a geometry has.
static Type flatType(Type type) SIP_HOLDGIL
Returns the flat type for a WKB type.
static bool hasZ(Type type) SIP_HOLDGIL
Tests whether a WKB type contains the z-dimension.
As part of the API refactoring and improvements which landed in the Processing API was substantially reworked from the x version This was done in order to allow much of the underlying Processing framework to be ported into c
#define BUILTIN_UNREACHABLE
QVector< QgsPoint > QgsPointSequence
#define QgsDebugMsgLevel(str, level)
const QgsCoordinateReferenceSystem & crs
QgsFeatureId featureId() const
The id of the feature to which the snapped geometry belongs.
QgsVectorLayer * layer() const
The vector layer where the snap occurred.
QgsPoint interpolatedPoint(const QgsCoordinateReferenceSystem &destinationCrs=QgsCoordinateReferenceSystem()) const
Convenient method to return a point on an edge with linear interpolation of the Z value.
bool hasEdge() const
Returns true if the Match is an edge.
bool hasLineEndpoint() const
Returns true if the Match is a line endpoint (start or end vertex).
bool hasMiddleSegment() const
Returns true if the Match is the middle of a segment.
int vertexIndex() const
for vertex / edge match (first vertex of the edge)
bool hasVertex() const
Returns true if the Match is a vertex.
Setting options for loading vector layers.
bool skipCrsValidation
Controls whether the layer is allowed to have an invalid/unknown CRS.
bool loadDefaultStyle
Set to true if the default layer style should be loaded.
Utility class for identifying a unique vertex within a geometry.