QGIS/python/gui/qgsmaptoolidentify.sip.in

170 lines
6.6 KiB
Plaintext
Raw Normal View History

2017-06-07 16:16:21 +02:00
/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/qgsmaptoolidentify.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsMapToolIdentify : QgsMapTool
{
2017-06-07 16:16:21 +02:00
%Docstring
Map tool for identifying features in layers
after selecting a point, performs the identification:
- for raster layers shows value of underlying pixel
- for vector layers shows feature attributes within search radius
(allows editing values when vector layer is in editing mode)
%End
2017-06-07 16:16:21 +02:00
%TypeHeaderCode
#include "qgsmaptoolidentify.h"
%End
public:
2013-06-23 16:00:16 +02:00
enum IdentifyMode
{
2014-06-02 21:00:51 +02:00
DefaultQgsSetting,
2013-06-23 16:00:16 +02:00
ActiveLayer,
TopDownStopAtFirst,
TopDownAll,
LayerSelection
};
2014-08-14 08:25:09 +02:00
enum Type
{
2013-06-23 16:00:16 +02:00
VectorLayer,
2014-08-14 08:25:09 +02:00
RasterLayer,
AllLayers
};
2014-08-14 08:25:09 +02:00
typedef QFlags<QgsMapToolIdentify::Type> LayerType;
2017-06-07 16:16:21 +02:00
struct IdentifyResult
{
IdentifyResult();
2017-11-11 15:22:19 +10:00
%Docstring
Constructor for IdentifyResult
%End
IdentifyResult( QgsMapLayer *layer, const QgsFeature &feature, const QMap< QString, QString > &derivedAttributes );
IdentifyResult( QgsMapLayer *layer, const QString &label, const QMap< QString, QString > &attributes, const QMap< QString, QString > &derivedAttributes );
IdentifyResult( QgsMapLayer *layer, const QString &label, const QgsFields &fields, const QgsFeature &feature, const QMap< QString, QString > &derivedAttributes );
QgsMapLayer *mLayer;
QString mLabel;
QgsFields mFields;
QgsFeature mFeature;
QMap< QString, QString > mAttributes;
QMap< QString, QString > mDerivedAttributes;
2013-06-23 16:00:16 +02:00
QMap< QString, QVariant > mParams;
};
QgsMapToolIdentify( QgsMapCanvas *canvas );
2017-06-07 16:16:21 +02:00
%Docstring
constructor
%End
2013-06-23 16:00:16 +02:00
~QgsMapToolIdentify();
virtual Flags flags() const;
virtual void canvasMoveEvent( QgsMapMouseEvent *e );
virtual void canvasPressEvent( QgsMapMouseEvent *e );
virtual void canvasReleaseEvent( QgsMapMouseEvent *e );
virtual void activate();
virtual void deactivate();
2017-06-07 16:16:21 +02:00
QList<QgsMapToolIdentify::IdentifyResult> identify( int x, int y, const QList<QgsMapLayer *> &layerList = QList<QgsMapLayer *>(), IdentifyMode mode = DefaultQgsSetting );
%Docstring
2017-12-15 10:36:55 -04:00
Performs the identification.
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param x: x coordinates of mouseEvent
:param y: y coordinates of mouseEvent
:param layerList: Performs the identification within the given list of layers. Default value is an empty list, i.e. uses all the layers.
:param mode: Identification mode. Can use Qgis default settings or a defined mode. Default mode is DefaultQgsSetting.
2017-06-07 16:16:21 +02:00
:return: a list of IdentifyResult*
%End
QList<QgsMapToolIdentify::IdentifyResult> identify( int x, int y, IdentifyMode mode, LayerType layerType = AllLayers );
2017-06-07 16:16:21 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Performs the identification.
2017-06-07 16:16:21 +02:00
To avoid being forced to specify IdentifyMode with a list of layers
this has been made private and two publics methods are offered
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param x: x coordinates of mouseEvent
:param y: y coordinates of mouseEvent
:param mode: Identification mode. Can use Qgis default settings or a defined mode.
:param layerType: Only performs identification in a certain type of layers (raster, vector). Default value is AllLayers.
2017-06-07 16:16:21 +02:00
:return: a list of IdentifyResult*
%End
QList<QgsMapToolIdentify::IdentifyResult> identify( const QgsGeometry &geometry, IdentifyMode mode, LayerType layerType );
QList<QgsMapToolIdentify::IdentifyResult> identify( const QgsGeometry &geometry, IdentifyMode mode, const QList<QgsMapLayer *> &layerList, LayerType layerType );
QgsIdentifyMenu *identifyMenu();
2017-06-07 16:16:21 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
return a pointer to the identify menu which will be used in layer selection mode
this menu can also be customized
2017-06-07 16:16:21 +02:00
%End
2015-02-03 02:21:52 +01:00
2013-06-23 16:00:16 +02:00
public slots:
void formatChanged( QgsRasterLayer *layer );
signals:
void identifyProgress( int, int );
2017-06-07 16:16:21 +02:00
void identifyMessage( const QString & );
void changedRasterResults( QList<QgsMapToolIdentify::IdentifyResult> & );
2014-05-22 16:39:18 +02:00
protected:
2017-06-07 16:16:21 +02:00
QList<QgsMapToolIdentify::IdentifyResult> identify( int x, int y, IdentifyMode mode, const QList<QgsMapLayer *> &layerList, LayerType layerType = AllLayers );
%Docstring
2017-12-15 10:36:55 -04:00
Performs the identification.
2017-06-07 16:16:21 +02:00
To avoid being forced to specify IdentifyMode with a list of layers
this has been made private and two publics methods are offered
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param x: x coordinates of mouseEvent
:param y: y coordinates of mouseEvent
:param mode: Identification mode. Can use Qgis default settings or a defined mode.
:param layerList: Performs the identification within the given list of layers.
:param layerType: Only performs identification in a certain type of layers (raster, vector).
2017-06-07 16:16:21 +02:00
:return: a list of IdentifyResult*
%End
bool identifyLayer( QList<QgsMapToolIdentify::IdentifyResult> *results, QgsMapLayer *layer, const QgsPointXY &point, const QgsRectangle &viewExtent, double mapUnitsPerPixel, QgsMapToolIdentify::LayerType layerType = AllLayers );
%Docstring
Call the right method depending on layer type
%End
bool identifyLayer( QList<IdentifyResult> *results, QgsMapLayer *layer, const QgsGeometry &geometry, const QgsRectangle &viewExtent, double mapUnitsPerPixel, LayerType layerType );
2014-05-22 16:39:18 +02:00
bool identifyRasterLayer( QList<QgsMapToolIdentify::IdentifyResult> *results, QgsRasterLayer *layer, QgsPointXY point, const QgsRectangle &viewExtent, double mapUnitsPerPixel );
bool identifyRasterLayer( QList<IdentifyResult> *results, QgsRasterLayer *layer, const QgsGeometry &geometry, const QgsRectangle &viewExtent, double mapUnitsPerPixel );
bool identifyVectorLayer( QList<QgsMapToolIdentify::IdentifyResult> *results, QgsVectorLayer *layer, const QgsPointXY &point );
bool identifyVectorLayer( QList<QgsMapToolIdentify::IdentifyResult> *results, QgsVectorLayer *layer, const QgsGeometry &geometry );
2017-06-07 16:16:21 +02:00
};
2017-06-07 16:16:21 +02:00
QFlags<QgsMapToolIdentify::Type> operator|(QgsMapToolIdentify::Type f1, QFlags<QgsMapToolIdentify::Type> f2);
2017-06-07 16:16:21 +02:00
/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/qgsmaptoolidentify.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/