16 #ifndef QGSMAPTOOLIDENTIFY_H 17 #define QGSMAPTOOLIDENTIFY_H 54 DefaultQgsSetting = -1,
66 AllLayers = VectorLayer | RasterLayer
68 Q_DECLARE_FLAGS( LayerType,
Type )
74 IdentifyResult() =
default;
77 : mLayer( layer ), mFeature( feature ), mDerivedAttributes( derivedAttributes ) {}
79 IdentifyResult(
QgsMapLayer *layer,
const QString &label,
const QMap< QString, QString > &attributes,
const QMap< QString, QString > &derivedAttributes )
80 : mLayer( layer ), mLabel( label ), mAttributes( attributes ), mDerivedAttributes( derivedAttributes ) {}
83 : mLayer( layer ), mLabel( label ), mFields( fields ), mFeature( feature ), mDerivedAttributes( derivedAttributes ) {}
113 QList<QgsMapToolIdentify::IdentifyResult> identify(
int x,
int y,
const QList<QgsMapLayer *> &layerList = QList<QgsMapLayer *>(),
IdentifyMode mode = DefaultQgsSetting );
124 QList<QgsMapToolIdentify::IdentifyResult> identify(
int x,
int y,
IdentifyMode mode, LayerType layerType = AllLayers );
136 void identifyProgress(
int,
int );
137 void identifyMessage(
const QString & );
138 void changedRasterResults( QList<QgsMapToolIdentify::IdentifyResult> & );
152 QList<QgsMapToolIdentify::IdentifyResult> identify(
int x,
int y,
IdentifyMode mode,
const QList<QgsMapLayer *> &layerList, LayerType layerType = AllLayers );
157 bool identifyLayer( QList<QgsMapToolIdentify::IdentifyResult> *results,
QgsMapLayer *layer,
const QgsPointXY &point,
const QgsRectangle &viewExtent,
double mapUnitsPerPixel, QgsMapToolIdentify::LayerType layerType = AllLayers );
159 bool identifyRasterLayer( QList<QgsMapToolIdentify::IdentifyResult> *results,
QgsRasterLayer *layer,
QgsPointXY point,
const QgsRectangle &viewExtent,
double mapUnitsPerPixel );
160 bool identifyVectorLayer( QList<QgsMapToolIdentify::IdentifyResult> *results,
QgsVectorLayer *layer,
const QgsPointXY &point );
183 QString formatDistance(
double distance )
const;
190 QString formatArea(
double area )
const;
199 QString formatCoordinate(
const QgsPointXY &canvasPoint )
const;
200 QString formatXCoordinate(
const QgsPointXY &canvasPoint )
const;
201 QString formatYCoordinate(
const QgsPointXY &canvasPoint )
const;
206 double mLastMapUnitsPerPixel;
210 int mCoordinatePrecision;
213 Q_DECLARE_OPERATORS_FOR_FLAGS( QgsMapToolIdentify::LayerType )
A rectangle specified with double values.
Base class for all map layer types.
This class provides qgis with the ability to render raster datasets onto the mapcanvas.
A class to represent a 2D point.
A QgsMapMouseEvent is the result of a user interaction with the mouse on a QgsMapCanvas.
Container of fields for a vector layer.
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
Map canvas is a class for displaying all GIS data types on a canvas.
Utility class for identifying a unique vertex within a geometry.
A class for highlight features on the map.
Abstract base class for all geometries.
DistanceUnit
Units of distance.
A general purpose distance and area calculator, capable of performing ellipsoid based calculations...
Represents a vector layer which manages a vector based data sets.