16 #ifndef QGSSNAPPINGUTILS_H
17 #define QGSSNAPPINGUTILS_H
20 #include "qgis_core.h"
54 Q_PROPERTY(
QgsSnappingConfig config READ config WRITE setConfig NOTIFY configChanged )
169 QList<QgsSnappingUtils::LayerConfig>
layers()
const {
return mLayers; }
189 void setEnableSnappingForInvisibleFeature(
bool enable );
203 mExtraSnapLayers.insert( vl );
216 mExtraSnapLayers.remove( vl );
229 return mExtraSnapLayers;
245 void toggleEnabled();
262 void clearAllLocators();
267 void onInitFinished(
bool ok );
270 void onIndividualLayerSettingsChanged(
const QHash<QgsVectorLayer *, QgsSnappingConfig::IndividualLayerSettings> &layerSettings );
279 typedef QPair< QgsVectorLayer *, QgsRectangle > LayerAndAreaOfInterest;
284 void prepareIndex(
const QList<LayerAndAreaOfInterest> &layers,
bool relaxed );
294 IndexingStrategy mStrategy = IndexHybrid;
295 QList<LayerConfig> mLayers;
298 typedef QMap<QgsVectorLayer *, QgsPointLocator *> LocatorsMap;
300 LocatorsMap mLocators;
302 LocatorsMap mTemporaryLocators;
304 QSet<QString> mHybridNonindexableLayers;
306 QSet<QgsVectorLayer *> mExtraSnapLayers;
320 QHash<QString, double> mHybridMaxAreaPerLayer;
322 int mHybridPerLayerFeatureLimit = 50000;
325 bool mEnableSnappingForInvisibleFeature =
true;
This class represents a coordinate reference system (CRS).
The QgsMapSettings class contains configuration for rendering of the map.
The class defines interface for querying point location:
A class to represent a 2D point.
A rectangle specified with double values.
This is a container for configuration of the snapping of the project.
This class has all the configuration of snapping and can return answers to snapping queries.
@ IndexAlwaysFull
For all layers build index of full extent. Uses more memory, but queries are faster.
@ IndexHybrid
For "big" layers using IndexNeverFull, for the rest IndexAlwaysFull. Compromise between speed and mem...
@ IndexNeverFull
For all layers only create temporary indexes of small extent. Low memory usage, slower queries.
QgsMapSettings mapSettings() const
QList< QgsSnappingUtils::LayerConfig > layers() const
Query layers used for snapping.
void addExtraSnapLayer(QgsVectorLayer *vl)
Supply an extra snapping layer (typically a memory layer).
QSet< QgsVectorLayer * > getExtraSnapLayers()
Returns the list of extra snapping layers.
virtual void prepareIndexProgress(int index)
Called when finished indexing a layer with snapToMap. When index == count the indexing is complete.
IndexingStrategy indexingStrategy() const
Find out which strategy is used for indexing - by default hybrid indexing is used.
void configChanged(const QgsSnappingConfig &snappingConfig)
Emitted when the snapping settings object changes.
void removeExtraSnapLayer(QgsVectorLayer *vl)
Removes an extra snapping layer.
QgsVectorLayer * currentLayer() const
The current layer used if mode is SnapCurrentLayer.
void setIndexingStrategy(IndexingStrategy strategy)
Sets a strategy for indexing geometry data - determines how fast and memory consuming the data struct...
virtual void prepareIndexStarting(int count)
Called when starting to index with snapToMap - can be overridden and e.g. progress dialog can be prov...
UnitType
Type of unit of tolerance value from settings.
Represents a vector layer which manages a vector based data sets.
bool operator==(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)
Interface that allows rejection of some matches in intersection queries (e.g.
Configures how a certain layer should be handled in a snapping operation.
bool operator!=(const QgsSnappingUtils::LayerConfig &other) const
double tolerance
The range around snapping targets in which snapping should occur.
QgsTolerance::UnitType unit
The units in which the tolerance is specified.
LayerConfig(QgsVectorLayer *l, QgsPointLocator::Types t, double tol, QgsTolerance::UnitType u)
Create a new configuration for a snapping layer.
QgsPointLocator::Types type
To which geometry properties of this layers a snapping should happen.
QgsVectorLayer * layer
The layer to configure.
bool operator==(const QgsSnappingUtils::LayerConfig &other) const