QGIS API Documentation
2.18.21-Las Palmas (9fba24a)
|
Class that runs a hit test with given map settings. More...
#include <qgsmaphittest.h>
Public Types | |
typedef QMap< QString, QString > | LayerFilterExpression |
Maps an expression string to a layer id. More... | |
Public Member Functions | |
QgsMapHitTest (const QgsMapSettings &settings, const QgsGeometry &polygon=QgsGeometry(), const LayerFilterExpression &layerFilterExpression=LayerFilterExpression()) | |
QgsMapHitTest (const QgsMapSettings &settings, const LayerFilterExpression &layerFilterExpression) | |
Constructor version used with only expressions to filter symbols (no extent or polygon intersection) More... | |
bool | legendKeyVisible (const QString &ruleKey, QgsVectorLayer *layer) const |
Tests whether a given legend key is visible for a specified layer. More... | |
void | run () |
Runs the map hit test. More... | |
bool | symbolVisible (QgsSymbolV2 *symbol, QgsVectorLayer *layer) const |
Tests whether a symbol is visible for a specified layer. More... | |
Protected Types | |
typedef QMap< QgsVectorLayer *, SymbolV2Set > | HitTest |
typedef QSet< QString > | SymbolV2Set |
Protected Member Functions | |
void | runHitTestLayer (QgsVectorLayer *vl, SymbolV2Set &usedSymbols, SymbolV2Set &usedSymbolsRuleKey, QgsRenderContext &context) |
Runs test for visible symbols within a layer. More... | |
Protected Attributes | |
HitTest | mHitTest |
The hit test. More... | |
HitTest | mHitTestRuleKey |
The hit test, using legend rule keys. More... | |
LayerFilterExpression | mLayerFilterExpression |
List of expression filter for each layer. More... | |
bool | mOnlyExpressions |
Whether to use only expressions during the filtering. More... | |
QgsGeometry | mPolygon |
Polygon used for filtering items. May be empty. More... | |
QgsMapSettings | mSettings |
The initial map settings. More... | |
Class that runs a hit test with given map settings.
Based on the hit test it returns which symbols will be visible on the map - this is useful for content based legend.
Definition at line 34 of file qgsmaphittest.h.
|
protected |
Definition at line 73 of file qgsmaphittest.h.
Maps an expression string to a layer id.
Definition at line 38 of file qgsmaphittest.h.
|
protected |
Definition at line 70 of file qgsmaphittest.h.
QgsMapHitTest::QgsMapHitTest | ( | const QgsMapSettings & | settings, |
const QgsGeometry & | polygon = QgsGeometry() , |
||
const LayerFilterExpression & | layerFilterExpression = LayerFilterExpression() |
||
) |
settings | Map settings used to evaluate symbols |
polygon | Polygon geometry to refine the hit test |
layerFilterExpression | Expression string for each layer id to evaluate in order to refine the symbol selection |
Definition at line 29 of file qgsmaphittest.cpp.
QgsMapHitTest::QgsMapHitTest | ( | const QgsMapSettings & | settings, |
const LayerFilterExpression & | layerFilterExpression | ||
) |
Constructor version used with only expressions to filter symbols (no extent or polygon intersection)
Definition at line 40 of file qgsmaphittest.cpp.
bool QgsMapHitTest::legendKeyVisible | ( | const QString & | ruleKey, |
QgsVectorLayer * | layer | ||
) | const |
Tests whether a given legend key is visible for a specified layer.
ruleKey | legend rule key |
layer | vector layer |
Definition at line 97 of file qgsmaphittest.cpp.
void QgsMapHitTest::run | ( | ) |
Runs the map hit test.
Definition at line 47 of file qgsmaphittest.cpp.
|
protected |
Runs test for visible symbols within a layer.
vl | vector layer |
usedSymbols | set for storage of visible symbols |
usedSymbolsRuleKey | set of storage of visible legend rule keys |
context | render context |
Definition at line 105 of file qgsmaphittest.cpp.
bool QgsMapHitTest::symbolVisible | ( | QgsSymbolV2 * | symbol, |
QgsVectorLayer * | layer | ||
) | const |
Tests whether a symbol is visible for a specified layer.
symbol | symbol to find |
layer | vector layer |
Definition at line 89 of file qgsmaphittest.cpp.
|
protected |
The hit test.
Definition at line 89 of file qgsmaphittest.h.
|
protected |
The hit test, using legend rule keys.
Definition at line 92 of file qgsmaphittest.h.
|
protected |
List of expression filter for each layer.
Definition at line 95 of file qgsmaphittest.h.
|
protected |
Whether to use only expressions during the filtering.
Definition at line 101 of file qgsmaphittest.h.
|
protected |
Polygon used for filtering items. May be empty.
Definition at line 98 of file qgsmaphittest.h.
|
protected |
The initial map settings.
Definition at line 86 of file qgsmaphittest.h.