15#ifndef QGSMAPHITTEST_H
16#define QGSMAPHITTEST_H
110 typedef QSet<QString> SymbolSet;
113 typedef QMap<QString, SymbolSet> HitTest;
129 const QString &layerId,
132 SymbolSet &usedSymbols,
133 SymbolSet &usedSymbolsRuleKey,
142 HitTest mHitTestRuleKey;
193 struct PreparedLayerData
195 std::unique_ptr< QgsAbstractFeatureSource > source;
198 std::unique_ptr< QgsFeatureRenderer > renderer;
201 std::unique_ptr< QgsExpressionContextScope > layerScope;
204 std::vector< PreparedLayerData > mPreparedData;
208 QMap<QString, QSet<QString>> mResults;
210 std::unique_ptr< QgsFeedback > mFeedback;
Base class that can be used for any class that is capable of returning features.
Handles parsing and evaluation of expressions (formerly called "search strings").
Abstract base class for all 2D vector feature renderers.
Base class for feedback objects to be used for cancellation of something running in a worker thread.
Container of fields for a vector layer.
A geometry is the spatial representation of a feature.
Contains settings relating to filtering the contents of QgsLayerTreeModel and views.
QMap< QString, QSet< QString > > results() const
Returns the hit test results, which are a map of layer ID to visible symbol legend keys.
QgsMapHitTestTask(const QgsLayerTreeFilterSettings &settings)
Constructor for QgsMapHitTestTask, using the specified filter settings.
bool run() override
Performs the task's operation.
PRIVATE void cancel() override
Notifies the task that it should terminate.
void run()
Runs the map hit test.
friend class QgsMapHitTestTask
PRIVATE bool symbolVisible(QgsSymbol *symbol, QgsVectorLayer *layer) const
Tests whether a symbol is visible for a specified layer.
bool legendKeyVisible(const QString &ruleKey, QgsVectorLayer *layer) const
Tests whether a given legend key is visible for a specified layer.
QgsMapHitTest(const QgsMapSettings &settings, const QgsGeometry &polygon=QgsGeometry(), const QgsMapHitTest::LayerFilterExpression &layerFilterExpression=QgsMapHitTest::LayerFilterExpression())
Constructor for QgsMapHitTest.
QMap< QString, QSet< QString > > results() const
Returns the hit test results, which are a map of layer ID to visible symbol legend keys.
QMap< QString, QString > LayerFilterExpression
Maps an expression string to a layer id.
Contains configuration for rendering maps.
Contains information about the context of a rendering operation.
Abstract base class for all rendered symbols.
QgsTask(const QString &description=QString(), QgsTask::Flags flags=AllFlags)
Constructor for QgsTask.
Represents a vector layer which manages a vector based dataset.