33 , mCheckGeometryType( true )
59void QgsMapToolDigitizeFeature::layerGeometryCaptured(
const QgsGeometry &geometry )
76 if ( mCheckGeometryType )
80 QVector<QgsGeometry> layerGeometries = geometry.
coerceToType( layerWKBType, defaultZ, defaultM );
81 if ( layerGeometries.count() > 0 )
82 layerGeometry = layerGeometries.at( 0 );
92 layerGeometry = geometry;
94 f.setGeometry( layerGeometry );
98 featureDigitized( f );
103 QgsVectorLayer *vlayer = qobject_cast<QgsVectorLayer *>( mLayer );
117 mCurrentLayer =
mCanvas->currentLayer();
119 mCanvas->setCurrentLayer( mLayer );
131 mCanvas->setCurrentLayer( mCurrentLayer );
137 QgsVectorLayer *vlayer = qobject_cast<QgsVectorLayer *>( mLayer );
149 if ( e->key() == Qt::Key_Escape )
158 return mCheckGeometryType;
168 QgsVectorLayer *vlayer = qobject_cast<QgsVectorLayer *>( mLayer );
@ AddFeatures
Allows adding features.
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).
@ Warning
Warning message.
WkbType
The WKB type describes the number of dimensions a geometry has.
The feature class encapsulates a single feature including its unique ID, geometry and a list of field...
A geometry is the spatial representation of a feature.
QVector< QgsGeometry > coerceToType(Qgis::WkbType type, double defaultZ=0, double defaultM=0) const
Attempts to coerce this geometry into the specified destination type.
Qgis::WkbType wkbType() const
Returns type of the geometry as a WKB type (point / linestring / polygon etc.)
Map canvas is a class for displaying all GIS data types on a canvas.
Base class for all map layer types.
A QgsMapMouseEvent is the result of a user interaction with the mouse on a QgsMapCanvas.
static QgsProject * instance()
Returns the QgsProject singleton instance.
void cleared()
Emitted when the project is cleared (and additionally when an open project is cleared just before a n...
void readProject(const QDomDocument &document)
Emitted when a project is being read.
T value(const QString &dynamicKeyPart=QString()) const
Returns settings value.
static const QgsSettingsEntryDouble * settingsDigitizingDefaultMValue
Settings entry digitizing default m value.
static const QgsSettingsEntryDouble * settingsDigitizingDefaultZValue
Settings entry digitizing default z value.
This is the base class for vector data providers.
virtual Q_INVOKABLE Qgis::VectorProviderCapabilities capabilities() const
Returns flags containing the supported capabilities.
Represents a vector layer which manages a vector based data sets.
bool isSpatial() const FINAL
Returns true if this is a geometry layer and false in case of NoGeometry (table only) or UnknownGeome...
bool isEditable() const FINAL
Returns true if the provider is in editing mode.
Q_INVOKABLE Qgis::WkbType wkbType() const FINAL
Returns the WKBType or WKBUnknown in case of error.
QgsVectorDataProvider * dataProvider() FINAL
Returns the layer's data provider, it may be nullptr.
Q_INVOKABLE Qgis::GeometryType geometryType() const
Returns point, line or polygon.
static Qgis::WkbType linearType(Qgis::WkbType type)
Returns the linear type for a WKB type.
static QString displayString(Qgis::WkbType type)
Returns a non-translated display string type for a WKB type, e.g., the geometry name used in WKT geom...