QGIS API Documentation  2.12.0-Lyon
Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
QgsMapHitTest Class Reference

Class that runs a hit test with given map settings. More...

#include <qgsmaphittest.h>

Public Member Functions

 QgsMapHitTest (const QgsMapSettings &settings)
 
void run ()
 
bool symbolVisible (QgsSymbolV2 *symbol, QgsVectorLayer *layer) const
 Tests whether a symbol is visible for a specified layer. More...
 

Protected Types

typedef QMap< QgsVectorLayer *, SymbolV2SetHitTest
 
typedef QSet< QStringSymbolV2Set
 

Protected Member Functions

void runHitTestLayer (QgsVectorLayer *vl, SymbolV2Set &usedSymbols, QgsRenderContext &context)
 Runs test for visible symbols within a layer. More...
 

Protected Attributes

HitTest mHitTest
 
QgsMapSettings mSettings
 

Detailed Description

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.

Note
added in 2.6

Definition at line 18 of file qgsmaphittest.h.

Member Typedef Documentation

Definition at line 35 of file qgsmaphittest.h.

Definition at line 34 of file qgsmaphittest.h.

Constructor & Destructor Documentation

QgsMapHitTest::QgsMapHitTest ( const QgsMapSettings settings)

Definition at line 11 of file qgsmaphittest.cpp.

Member Function Documentation

void QgsMapHitTest::run ( )

Definition at line 17 of file qgsmaphittest.cpp.

void QgsMapHitTest::runHitTestLayer ( QgsVectorLayer vl,
SymbolV2Set usedSymbols,
QgsRenderContext context 
)
protected

Runs test for visible symbols within a layer.

Parameters
vlvector layer
usedSymbolsset for storage of visible symbols
contextrender context
Note
added in QGIS 2.12

Definition at line 62 of file qgsmaphittest.cpp.

bool QgsMapHitTest::symbolVisible ( QgsSymbolV2 symbol,
QgsVectorLayer layer 
) const

Tests whether a symbol is visible for a specified layer.

Parameters
symbolsymbol to find
layervector layer
Note
added in QGIS 2.12

Definition at line 54 of file qgsmaphittest.cpp.

Member Data Documentation

HitTest QgsMapHitTest::mHitTest
protected

Definition at line 46 of file qgsmaphittest.h.

QgsMapSettings QgsMapHitTest::mSettings
protected

Definition at line 45 of file qgsmaphittest.h.


The documentation for this class was generated from the following files: