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 );
127 QList<QgsMapToolIdentify::IdentifyResult> identify(
const QgsGeometry &geometry,
IdentifyMode mode, LayerType layerType );
129 QList<QgsMapToolIdentify::IdentifyResult> identify(
const QgsGeometry &geometry,
IdentifyMode mode,
const QList<QgsMapLayer *> &layerList, LayerType layerType );
142 void identifyProgress(
int,
int );
143 void identifyMessage(
const QString & );
144 void changedRasterResults( QList<QgsMapToolIdentify::IdentifyResult> & );
158 QList<QgsMapToolIdentify::IdentifyResult> identify(
int x,
int y,
IdentifyMode mode,
const QList<QgsMapLayer *> &layerList, LayerType layerType = AllLayers );
163 bool identifyLayer( QList<QgsMapToolIdentify::IdentifyResult> *results,
QgsMapLayer *layer,
const QgsPointXY &point,
const QgsRectangle &viewExtent,
double mapUnitsPerPixel, QgsMapToolIdentify::LayerType layerType = AllLayers );
165 bool identifyRasterLayer( QList<QgsMapToolIdentify::IdentifyResult> *results,
QgsRasterLayer *layer,
QgsPointXY point,
const QgsRectangle &viewExtent,
double mapUnitsPerPixel );
166 bool identifyVectorLayer( QList<QgsMapToolIdentify::IdentifyResult> *results,
QgsVectorLayer *layer,
const QgsPointXY &point );
170 bool identifyLayer( QList<QgsMapToolIdentify::IdentifyResult> *results,
QgsMapLayer *layer,
const QgsGeometry &geometry,
const QgsRectangle &viewExtent,
double mapUnitsPerPixel, QgsMapToolIdentify::LayerType layerType = AllLayers );
171 bool identifyRasterLayer( QList<QgsMapToolIdentify::IdentifyResult> *results,
QgsRasterLayer *layer,
const QgsGeometry &geometry,
const QgsRectangle &viewExtent,
double mapUnitsPerPixel );
172 bool identifyVectorLayer( QList<QgsMapToolIdentify::IdentifyResult> *results,
QgsVectorLayer *layer,
const QgsGeometry &geometry );
193 QString formatDistance(
double distance )
const;
200 QString formatArea(
double area )
const;
221 QString formatCoordinate(
const QgsPointXY &canvasPoint )
const;
222 QString formatXCoordinate(
const QgsPointXY &canvasPoint )
const;
223 QString formatYCoordinate(
const QgsPointXY &canvasPoint )
const;
228 double mLastMapUnitsPerPixel;
232 int mCoordinatePrecision;
235 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.
A geometry is the spatial representation of a feature.
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.