-
-
Notifications
You must be signed in to change notification settings - Fork 3k
/
qgsmaptoolidentifyaction.h
99 lines (77 loc) · 3.15 KB
/
qgsmaptoolidentifyaction.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
/***************************************************************************
qgsmaptoolidentify.h - map tool for identifying features
---------------------
begin : January 2006
copyright : (C) 2006 by Martin Dobias
email : wonder.sk at gmail dot com
***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef QGSMAPTOOLIDENTIFYACTION_H
#define QGSMAPTOOLIDENTIFYACTION_H
#include "qgis.h"
#include "qgsmaptoolidentify.h"
#include "qgspoint.h"
#include "qgsfeature.h"
#include "qgsfeaturestore.h"
#include "qgsfield.h"
#include "qgsdistancearea.h"
#include <QObject>
#include <QPointer>
class QgsIdentifyResultsDialog;
class QgsMapLayer;
class QgsRasterLayer;
class QgsRubberBand;
class QgsVectorLayer;
class QMenu;
/**
\brief Map tool for identifying features layers and showing results
after selecting a point shows dialog with identification results
- for raster layers shows value of underlying pixel
- for vector layers shows feature attributes within search radius
(allows to edit values when vector layer is in editing mode)
*/
class QgsMapToolIdentifyAction : public QgsMapToolIdentify
{
Q_OBJECT
public:
QgsMapToolIdentifyAction( QgsMapCanvas * canvas );
~QgsMapToolIdentifyAction();
//! Overridden mouse move event
virtual void canvasMoveEvent( QMouseEvent * e );
//! Overridden mouse press event
virtual void canvasPressEvent( QMouseEvent * e );
//! Overridden mouse release event
virtual void canvasReleaseEvent( QMouseEvent * e );
virtual void activate();
virtual void deactivate();
public slots:
void handleCopyToClipboard( QgsFeatureStore & );
void handleChangedRasterResults( QList<IdentifyResult>& results );
signals:
void identifyProgress( int, int );
void identifyMessage( QString );
void copyToClipboard( QgsFeatureStore & );
private:
//! Pointer to the identify results dialog for name/value pairs
QPointer<QgsIdentifyResultsDialog> mResultsDialog;
//! layer id map for layer select mode
QMap< QgsMapLayer*, QList<IdentifyResult> > mLayerIdResults;
//! rubber bands for layer select mode
QList<QgsRubberBand*> mRubberBands;
QgsIdentifyResultsDialog *resultsDialog();
virtual QGis::UnitType displayUnits();
//helper functions for layer selection mode
void deleteRubberBands();
void fillLayerIdResults( int x, int y );
void fillLayerSelectionMenu( QMenu& menu );
void execLayerSelectionMenu( QMenu& menu, const QPoint& pos, QList<IdentifyResult>& resultList );
private slots:
void handleMenuHover();
};
#endif