QGIS API Documentation  2.18.21-Las Palmas (9fba24a)
qgsmaphittest.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsmaphittest.h
3  ---------------------
4  begin : September 2014
5  copyright : (C) 2014 by Martin Dobias
6  email : wonder dot sk at gmail dot com
7  ***************************************************************************
8  * *
9  * This program is free software; you can redistribute it and/or modify *
10  * it under the terms of the GNU General Public License as published by *
11  * the Free Software Foundation; either version 2 of the License, or *
12  * (at your option) any later version. *
13  * *
14  ***************************************************************************/
15 #ifndef QGSMAPHITTEST_H
16 #define QGSMAPHITTEST_H
17 
18 #include "qgsmapsettings.h"
19 #include "qgsgeometry.h"
20 
21 #include <QSet>
22 
23 class QgsRenderContext;
24 class QgsSymbolV2;
25 class QgsVectorLayer;
26 class QgsExpression;
27 
34 class CORE_EXPORT QgsMapHitTest
35 {
36  public:
39 
43  QgsMapHitTest( const QgsMapSettings& settings, const QgsGeometry& polygon = QgsGeometry(), const LayerFilterExpression& layerFilterExpression = LayerFilterExpression() );
44 
46  QgsMapHitTest( const QgsMapSettings& settings, const LayerFilterExpression& layerFilterExpression );
47 
49  void run();
50 
57  bool symbolVisible( QgsSymbolV2* symbol, QgsVectorLayer* layer ) const;
58 
65  bool legendKeyVisible( const QString& ruleKey, QgsVectorLayer* layer ) const;
66 
67  protected:
68 
71 
74 
83  void runHitTestLayer( QgsVectorLayer* vl, SymbolV2Set& usedSymbols, SymbolV2Set& usedSymbolsRuleKey, QgsRenderContext& context );
84 
87 
89  HitTest mHitTest;
90 
92  HitTest mHitTestRuleKey;
93 
95  LayerFilterExpression mLayerFilterExpression;
96 
99 
102 };
103 
104 #endif // QGSMAPHITTEST_H
HitTest mHitTest
The hit test.
Definition: qgsmaphittest.h:89
Class for parsing and evaluation of expressions (formerly called "search strings").
QMap< QgsVectorLayer *, SymbolV2Set > HitTest
Definition: qgsmaphittest.h:73
HitTest mHitTestRuleKey
The hit test, using legend rule keys.
Definition: qgsmaphittest.h:92
A geometry is the spatial representation of a feature.
Definition: qgsgeometry.h:76
The QgsMapSettings class contains configuration for rendering of the map.
LayerFilterExpression mLayerFilterExpression
List of expression filter for each layer.
Definition: qgsmaphittest.h:95
QSet< QString > SymbolV2Set
Definition: qgsmaphittest.h:70
Class that runs a hit test with given map settings.
Definition: qgsmaphittest.h:34
Contains information about the context of a rendering operation.
QMap< QString, QString > LayerFilterExpression
Maps an expression string to a layer id.
Definition: qgsmaphittest.h:38
QgsGeometry mPolygon
Polygon used for filtering items. May be empty.
Definition: qgsmaphittest.h:98
bool mOnlyExpressions
Whether to use only expressions during the filtering.
Represents a vector layer which manages a vector based data sets.
QgsMapSettings mSettings
The initial map settings.
Definition: qgsmaphittest.h:86