QGIS API Documentation
3.14.0-Pi (9f7028fd23)
|
Go to the documentation of this file.
16 #ifndef QGSSNAPPINGUTILS_H
17 #define QGSSNAPPINGUTILS_H
20 #include "qgis_core.h"
168 QList<QgsSnappingUtils::LayerConfig>
layers()
const {
return mLayers; }
188 void setEnableSnappingForInvisibleFeature(
bool enable );
202 mExtraSnapLayers.insert( vl );
215 mExtraSnapLayers.remove( vl );
228 return mExtraSnapLayers;
244 void toggleEnabled();
261 void clearAllLocators();
266 void onInitFinished(
bool ok );
269 void onIndividualLayerSettingsChanged(
const QHash<QgsVectorLayer *, QgsSnappingConfig::IndividualLayerSettings> &layerSettings );
278 typedef QPair< QgsVectorLayer *, QgsRectangle > LayerAndAreaOfInterest;
283 void prepareIndex(
const QList<LayerAndAreaOfInterest> &layers,
bool relaxed );
293 IndexingStrategy mStrategy = IndexHybrid;
294 QList<LayerConfig> mLayers;
297 typedef QMap<QgsVectorLayer *, QgsPointLocator *> LocatorsMap;
299 LocatorsMap mLocators;
301 LocatorsMap mTemporaryLocators;
303 QSet<QString> mHybridNonindexableLayers;
305 QSet<QgsVectorLayer *> mExtraSnapLayers;
319 QHash<QString, double> mHybridMaxAreaPerLayer;
321 int mHybridPerLayerFeatureLimit = 50000;
324 bool mEnableSnappingForInvisibleFeature =
true;
328 #endif // QGSSNAPPINGUTILS_H
void setIndexingStrategy(IndexingStrategy strategy)
Sets a strategy for indexing geometry data - determines how fast and memory consuming the data struct...
double tolerance
The range around snapping targets in which snapping should occur.
bool operator==(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)
void addExtraSnapLayer(QgsVectorLayer *vl)
Supply an extra snapping layer (typically a memory layer).
QgsMapSettings mapSettings() const
QgsVectorLayer * currentLayer() const
The current layer used if mode is SnapCurrentLayer.
@ IndexHybrid
For "big" layers using IndexNeverFull, for the rest IndexAlwaysFull. Compromise between speed and mem...
UnitType
Type of unit of tolerance value from settings.
virtual void prepareIndexStarting(int count)
Called when starting to index with snapToMap - can be overridden and e.g. progress dialog can be prov...
@ IndexNeverFull
For all layers only create temporary indexes of small extent. Low memory usage, slower queries.
QSet< QgsVectorLayer * > getExtraSnapLayers()
Returns the list of extra snapping layers.
bool operator==(const QgsSnappingUtils::LayerConfig &other) const
@ IndexAlwaysFull
For all layers build index of full extent. Uses more memory, but queries are faster.
QgsTolerance::UnitType unit
The units in which the tolerance is specified.
QList< QgsSnappingUtils::LayerConfig > layers() const
Query layers used for snapping.
IndexingStrategy indexingStrategy() const
Find out which strategy is used for indexing - by default hybrid indexing is used.
The class defines interface for querying point location:
Interface that allows rejection of some matches in intersection queries (e.g.
QgsVectorLayer * layer
The layer to configure.
bool operator!=(const QgsSnappingUtils::LayerConfig &other) const
LayerConfig(QgsVectorLayer *l, QgsPointLocator::Types t, double tol, QgsTolerance::UnitType u)
Create a new configuration for a snapping layer.
void removeExtraSnapLayer(QgsVectorLayer *vl)
Removes an extra snapping layer.
QgsPointLocator::Types type
To which geometry properties of this layers a snapping should happen.
Configures how a certain layer should be handled in a snapping operation.
virtual void prepareIndexProgress(int index)
Called when finished indexing a layer with snapToMap. When index == count the indexing is complete.