Skip to content

Commit

Permalink
Merge pull request #6835 from wonder-sk/identify-selection-modes
Browse files Browse the repository at this point in the history
[FEATURE] Identify: more selection modes (simple / polygon / freehand / radius)
  • Loading branch information
wonder-sk committed Apr 26, 2018
2 parents 16a6a90 + f2a2eeb commit e811c54
Show file tree
Hide file tree
Showing 30 changed files with 1,268 additions and 950 deletions.
4 changes: 4 additions & 0 deletions images/images.qrc
Expand Up @@ -649,6 +649,10 @@
<file>themes/default/mActionNewReport.svg</file>
<file>themes/default/mIconReport.svg</file>
<file>themes/default/downloading_svg.svg</file>
<file>themes/default/mActionIdentifyByFreehand.svg</file>
<file>themes/default/mActionIdentifyByPolygon.svg</file>
<file>themes/default/mActionIdentifyByRadius.svg</file>
<file>themes/default/mActionIdentifyByRectangle.svg</file>
</qresource>
<qresource prefix="/images/tips">
<file alias="symbol_levels.png">qgis_tips/symbol_levels.png</file>
Expand Down
63 changes: 63 additions & 0 deletions images/themes/default/mActionIdentifyByFreehand.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
63 changes: 63 additions & 0 deletions images/themes/default/mActionIdentifyByPolygon.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
68 changes: 68 additions & 0 deletions images/themes/default/mActionIdentifyByRadius.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
59 changes: 59 additions & 0 deletions images/themes/default/mActionIdentifyByRectangle.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions python/gui/qgsmaptoolidentify.sip.in
Expand Up @@ -108,6 +108,16 @@ this has been made private and two publics methods are offered
:return: a list of IdentifyResult*
%End

QList<QgsMapToolIdentify::IdentifyResult> identify( const QgsGeometry &geometry, IdentifyMode mode, LayerType layerType );
%Docstring
Performs identification based on a geometry (in map coordinates)
%End
QList<QgsMapToolIdentify::IdentifyResult> identify( const QgsGeometry &geometry, IdentifyMode mode, const QList<QgsMapLayer *> &layerList, LayerType layerType );
%Docstring
Performs identification based on a geometry (in map coordinates)
%End


QgsIdentifyMenu *identifyMenu();
%Docstring
return a pointer to the identify menu which will be used in layer selection mode
Expand Down
10 changes: 2 additions & 8 deletions src/app/CMakeLists.txt
Expand Up @@ -97,10 +97,7 @@ SET(QGIS_APP_SRCS
qgsmaptoolrotatelabel.cpp
qgsmaptoolrotatepointsymbols.cpp
qgsmaptoolselect.cpp
qgsmaptoolselectrectangle.cpp
qgsmaptoolselectfreehand.cpp
qgsmaptoolselectpolygon.cpp
qgsmaptoolselectradius.cpp
qgsmaptoolselectionhandler.cpp
qgsmaptoolselectutils.cpp
qgsmaptoolsimplify.cpp
qgsmaptoolsplitfeatures.cpp
Expand Down Expand Up @@ -310,11 +307,8 @@ SET (QGIS_APP_MOC_HDRS
qgsmaptoolrotatefeature.h
qgsmaptoolrotatelabel.h
qgsmaptoolrotatepointsymbols.h
qgsmaptoolselectfreehand.h
qgsmaptoolselect.h
qgsmaptoolselectpolygon.h
qgsmaptoolselectradius.h
qgsmaptoolselectrectangle.h
qgsmaptoolselectionhandler.h
qgsmaptoolsimplify.h
qgsmaptoolsplitfeatures.h
qgsmaptoolsplitparts.h
Expand Down
17 changes: 8 additions & 9 deletions src/app/qgisapp.cpp
Expand Up @@ -386,10 +386,6 @@ Q_GUI_EXPORT extern int qt_defaultDpiX();
#include "qgsmaptooloffsetpointsymbol.h"
#include "qgsmaptoolpan.h"
#include "qgsmaptoolselect.h"
#include "qgsmaptoolselectrectangle.h"
#include "qgsmaptoolselectfreehand.h"
#include "qgsmaptoolselectpolygon.h"
#include "qgsmaptoolselectradius.h"
#include "qgsmaptoolsvgannotation.h"
#include "qgsmaptoolreshape.h"
#include "qgsmaptoolrotatepointsymbols.h"
Expand Down Expand Up @@ -1317,7 +1313,6 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, bool skipVersionCh
// should come after fileNewBlank to ensure project is properly set up to receive any data source files
QgsApplication::setFileOpenEventReceiver( this );


#ifdef ANDROID
toggleFullScreen();
#endif
Expand Down Expand Up @@ -3413,14 +3408,18 @@ void QgisApp::createCanvasTools()
mMapTools.mSplitFeatures->setAction( mActionSplitFeatures );
mMapTools.mSplitParts = new QgsMapToolSplitParts( mMapCanvas );
mMapTools.mSplitParts->setAction( mActionSplitParts );
mMapTools.mSelectFeatures = new QgsMapToolSelectFeatures( mMapCanvas );
mMapTools.mSelectFeatures = new QgsMapToolSelect( mMapCanvas );
mMapTools.mSelectFeatures->setAction( mActionSelectFeatures );
mMapTools.mSelectPolygon = new QgsMapToolSelectPolygon( mMapCanvas );
mMapTools.mSelectFeatures->setSelectionMode( QgsMapToolSelectionHandler::SelectSimple );
mMapTools.mSelectPolygon = new QgsMapToolSelect( mMapCanvas );
mMapTools.mSelectPolygon->setAction( mActionSelectPolygon );
mMapTools.mSelectFreehand = new QgsMapToolSelectFreehand( mMapCanvas );
mMapTools.mSelectPolygon->setSelectionMode( QgsMapToolSelectionHandler::SelectPolygon );
mMapTools.mSelectFreehand = new QgsMapToolSelect( mMapCanvas );
mMapTools.mSelectFreehand->setAction( mActionSelectFreehand );
mMapTools.mSelectRadius = new QgsMapToolSelectRadius( mMapCanvas );
mMapTools.mSelectFreehand->setSelectionMode( QgsMapToolSelectionHandler::SelectFreehand );
mMapTools.mSelectRadius = new QgsMapToolSelect( mMapCanvas );
mMapTools.mSelectRadius->setAction( mActionSelectRadius );
mMapTools.mSelectRadius->setSelectionMode( QgsMapToolSelectionHandler::SelectRadius );
mMapTools.mAddRing = new QgsMapToolAddRing( mMapCanvas );
mMapTools.mAddRing->setAction( mActionAddRing );
mMapTools.mFillRing = new QgsMapToolFillRing( mMapCanvas );
Expand Down

0 comments on commit e811c54

Please sign in to comment.