@@ -78,10 +78,6 @@ class QgsMapToolIdentify : QgsMapTool
78
78
@return a list of IdentifyResult*/
79
79
QList<QgsMapToolIdentify::IdentifyResult> identify( int x, int y, IdentifyMode mode, LayerType layerType = AllLayers );
80
80
81
- protected:
82
- //! rubber bands for layer select mode
83
- void deleteRubberBands();
84
-
85
81
public slots:
86
82
void formatChanged( QgsRasterLayer *layer );
87
83
void layerDestroyed();
@@ -90,4 +86,25 @@ class QgsMapToolIdentify : QgsMapTool
90
86
void identifyProgress( int, int );
91
87
void identifyMessage( QString );
92
88
void changedRasterResults( QList<QgsMapToolIdentify::IdentifyResult>& );
89
+
90
+ protected:
91
+ //! rubber bands for layer select mode
92
+ void deleteRubberBands();
93
+
94
+ /** Performs the identification.
95
+ To avoid beeing forced to specify IdentifyMode with a list of layers
96
+ this has been made private and two publics methods are offered
97
+ @param x x coordinates of mouseEvent
98
+ @param y y coordinates of mouseEvent
99
+ @param mode Identification mode. Can use Qgis default settings or a defined mode.
100
+ @param layerList Performs the identification within the given list of layers.
101
+ @param layerType Only performs identification in a certain type of layers (raster, vector).
102
+ @return true if identification succeeded and a feature has been found, false otherwise.*/
103
+ QList<QgsMapToolIdentify::IdentifyResult> identify( int x, int y, IdentifyMode mode, QList<QgsMapLayer*> layerList, LayerType layerType = AllLayers );
104
+
105
+ /** call the right method depending on layer type */
106
+ bool identifyLayer( QList<QgsMapToolIdentify::IdentifyResult> *results, QgsMapLayer *layer, QgsPoint point, QgsRectangle viewExtent, double mapUnitsPerPixel, LayerType layerType = AllLayers );
107
+
108
+ bool identifyRasterLayer( QList<QgsMapToolIdentify::IdentifyResult> *results, QgsRasterLayer *layer, QgsPoint point, QgsRectangle viewExtent, double mapUnitsPerPixel );
109
+ bool identifyVectorLayer( QList<QgsMapToolIdentify::IdentifyResult> *results, QgsVectorLayer *layer, QgsPoint point );
93
110
};
0 commit comments