QGIS API Documentation
3.26.3-Buenos Aires (65e4edfdad)
|
Go to the documentation of this file.
41 , mCheckGeometryType( true )
67 void QgsMapToolDigitizeFeature::layerGeometryCaptured(
const QgsGeometry &geometry )
84 if ( mCheckGeometryType )
88 QVector<QgsGeometry> layerGeometries = geometry.
coerceToType( layerWKBType, defaultZ, defaultM );
89 if ( layerGeometries.count() > 0 )
90 layerGeometry = layerGeometries.at( 0 );
100 layerGeometry = geometry;
102 f.setGeometry( layerGeometry );
106 featureDigitized( f );
111 QgsVectorLayer *vlayer = qobject_cast<QgsVectorLayer *>( mLayer );
124 mCurrentLayer =
mCanvas->currentLayer();
126 mCanvas->setCurrentLayer( mLayer );
138 mCanvas->setCurrentLayer( mCurrentLayer );
144 return mCheckGeometryType;
154 QgsVectorLayer *vlayer = qobject_cast<QgsVectorLayer *>( mLayer );
170 emit
messageEmitted( tr(
"The data provider for this layer does not support the addition of features." ), Qgis::MessageLevel::Warning );
183 emit
messageEmitted( tr(
"Wrong editing tool, cannot apply the 'capture point' tool on this vector layer" ), Qgis::MessageLevel::Warning );
190 emit
messageEmitted( tr(
"Wrong editing tool, cannot apply the 'capture line' tool on this vector layer" ), Qgis::MessageLevel::Warning );
197 emit
messageEmitted( tr(
"Wrong editing tool, cannot apply the 'capture polygon' tool on this vector layer" ), Qgis::MessageLevel::Warning );
Q_INVOKABLE QgsWkbTypes::Type wkbType() const FINAL
Returns the WKBType or WKBUnknown in case of error.
static QString displayString(Type type) SIP_HOLDGIL
Returns a non-translated display string type for a WKB type, e.g., the geometry name used in WKT geom...
QgsVectorDataProvider * dataProvider() FINAL
Returns the layer's data provider, it may be nullptr.
void cleared()
Emitted when the project is cleared (and additionally when an open project is cleared just before a n...
Map canvas is a class for displaying all GIS data types on a canvas.
static QgsProject * instance()
Returns the QgsProject singleton instance.
void readProject(const QDomDocument &)
Emitted when a project is being read.
bool isSpatial() const FINAL
Returns true if this is a geometry layer and false in case of NoGeometry (table only) or UnknownGeome...
Type
The WKB type describes the number of dimensions a geometry has.
static const QgsSettingsEntryDouble settingsDigitizingDefaultMValue
Settings entry digitizing default m value.
bool isEditable() const FINAL
Returns true if the provider is in editing mode.
QgsFields fields() const FINAL
Returns the list of fields of this layer.
virtual Q_INVOKABLE QgsVectorDataProvider::Capabilities capabilities() const
Returns flags containing the supported capabilities.
@ CircularString
Capture in circular strings.
static Type linearType(Type type) SIP_HOLDGIL
Returns the linear type for a WKB type.
@ AddFeatures
Allows adding features.
A QgsMapMouseEvent is the result of a user interaction with the mouse on a QgsMapCanvas....
QVector< QgsGeometry > coerceToType(QgsWkbTypes::Type type, double defaultZ=0, double defaultM=0) const
Attempts to coerce this geometry into the specified destination type.
A geometry is the spatial representation of a feature.
@ StraightSegments
Default capture mode - capture occurs with straight line segments.
Represents a vector layer which manages a vector based data sets.
Base class for all map layer types. This is the base class for all map layer types (vector,...
static const QgsSettingsEntryDouble settingsDigitizingDefaultZValue
Settings entry digitizing default z value.
This is the base class for vector data providers.
The feature class encapsulates a single feature including its unique ID, geometry and a list of field...
CaptureTechnique
Capture technique.
Q_INVOKABLE QgsWkbTypes::GeometryType geometryType() const
Returns point, line or polygon.
@ Streaming
Streaming points digitizing mode (points are automatically added as the mouse cursor moves).
QgsWkbTypes::Type wkbType() const SIP_HOLDGIL
Returns type of the geometry as a WKB type (point / linestring / polygon etc.)
T value(const QString &dynamicKeyPart=QString()) const
Returns settings value.