16 #ifndef QGSMAPTOOLIDENTIFY_H 17 #define QGSMAPTOOLIDENTIFY_H 54 DefaultQgsSetting = -1,
69 Q_DECLARE_FLAGS( LayerType,
Type )
75 IdentifyResult() =
default;
78 : mLayer( layer ), mFeature( feature ), mDerivedAttributes( derivedAttributes ) {}
80 IdentifyResult(
QgsMapLayer *layer,
const QString &label,
const QMap< QString, QString > &attributes,
const QMap< QString, QString > &derivedAttributes )
81 : mLayer( layer ), mLabel( label ), mAttributes( attributes ), mDerivedAttributes( derivedAttributes ) {}
84 : mLayer( layer ), mLabel( label ), mFields( fields ), mFeature( feature ), mDerivedAttributes( derivedAttributes ) {}
114 QList<QgsMapToolIdentify::IdentifyResult> identify(
int x,
int y,
const QList<QgsMapLayer *> &layerList = QList<QgsMapLayer *>(),
IdentifyMode mode = DefaultQgsSetting );
126 QList<QgsMapToolIdentify::IdentifyResult> identify(
int x,
int y,
IdentifyMode mode, LayerType layerType = AllLayers );
129 QList<QgsMapToolIdentify::IdentifyResult> identify(
const QgsGeometry &geometry,
IdentifyMode mode, LayerType layerType );
131 QList<QgsMapToolIdentify::IdentifyResult> identify(
const QgsGeometry &geometry,
IdentifyMode mode,
const QList<QgsMapLayer *> &layerList, LayerType layerType );
144 void identifyProgress(
int,
int );
145 void identifyMessage(
const QString & );
146 void changedRasterResults( QList<QgsMapToolIdentify::IdentifyResult> & );
161 QList<QgsMapToolIdentify::IdentifyResult> identify(
int x,
int y,
IdentifyMode mode,
const QList<QgsMapLayer *> &layerList, LayerType layerType = AllLayers );
166 bool identifyLayer( QList<QgsMapToolIdentify::IdentifyResult> *results,
QgsMapLayer *layer,
const QgsPointXY &point,
const QgsRectangle &viewExtent,
double mapUnitsPerPixel, QgsMapToolIdentify::LayerType layerType = AllLayers );
168 bool identifyRasterLayer( QList<QgsMapToolIdentify::IdentifyResult> *results,
QgsRasterLayer *layer,
QgsPointXY point,
const QgsRectangle &viewExtent,
double mapUnitsPerPixel );
169 bool identifyVectorLayer( QList<QgsMapToolIdentify::IdentifyResult> *results,
QgsVectorLayer *layer,
const QgsPointXY &point );
177 bool identifyMeshLayer( QList<QgsMapToolIdentify::IdentifyResult> *results,
QgsMeshLayer *layer,
const QgsPointXY &point );
180 QMap< QString, QString > derivedAttributesForPoint(
const QgsPoint &point );
194 void setCanvasPropertiesOverrides(
double searchRadiusMapUnits );
201 void restoreCanvasPropertiesOverrides();
205 bool identifyLayer( QList<QgsMapToolIdentify::IdentifyResult> *results,
QgsMapLayer *layer,
const QgsGeometry &geometry,
const QgsRectangle &viewExtent,
double mapUnitsPerPixel, QgsMapToolIdentify::LayerType layerType = AllLayers );
206 bool identifyRasterLayer( QList<QgsMapToolIdentify::IdentifyResult> *results,
QgsRasterLayer *layer,
const QgsGeometry &geometry,
const QgsRectangle &viewExtent,
double mapUnitsPerPixel );
207 bool identifyVectorLayer( QList<QgsMapToolIdentify::IdentifyResult> *results,
QgsVectorLayer *layer,
const QgsGeometry &geometry );
208 bool identifyMeshLayer( QList<QgsMapToolIdentify::IdentifyResult> *results,
QgsMeshLayer *layer,
const QgsGeometry &geometry );
229 QString formatDistance(
double distance )
const;
236 QString formatArea(
double area )
const;
260 void closestPointAttributes(
const QgsAbstractGeometry &geometry,
const QgsPointXY &layerPoint, QMap< QString, QString > &derivedAttributes );
262 QString formatCoordinate(
const QgsPointXY &canvasPoint )
const;
263 QString formatXCoordinate(
const QgsPointXY &canvasPoint )
const;
264 QString formatYCoordinate(
const QgsPointXY &canvasPoint )
const;
269 double mLastMapUnitsPerPixel;
273 int mCoordinatePrecision;
275 double mOverrideCanvasSearchRadius = -1;
278 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.
Point geometry type, with support for z-dimension and m-values.
DistanceUnit
Units of distance.
Represents a mesh layer supporting display of data on structured or unstructured meshes.
Represents a vector layer which manages a vector based data sets.