Skip to content

Commit 9950959

Browse files
author
timlinux
committedMar 1, 2011
Applied latest spatialquery_X_full.zip patch from Luiz Motta from #2634. This adds a number of improvements in functionality and usability to the spatial query tool. Muito Obrigado Luiz.
git-svn-id: http://svn.osgeo.org/qgis/trunk@15302 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 0b65851 commit 9950959

21 files changed

+863
-957
lines changed
 

‎src/plugins/spatialquery/CMakeLists.txt

100644100755
File mode changed.

‎src/plugins/spatialquery/README

100644100755
File mode changed.
581 Bytes
Loading

‎src/plugins/spatialquery/qgsgeometrycoordinatetransform.cpp

100644100755
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* (at your option) any later version. *
1616
* *
1717
***************************************************************************/
18-
/* $Id$ */
18+
/* $Id: qgsgeometrycoordinatetransform.cpp 13377 2010-04-25 01:07:36Z jef $ */
1919

2020
#include "qgsgeometrycoordinatetransform.h"
2121

‎src/plugins/spatialquery/qgsgeometrycoordinatetransform.h

100644100755
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* (at your option) any later version. *
1616
* *
1717
***************************************************************************/
18-
/* $Id$ */
18+
/* $Id: qgsgeometrycoordinatetransform.h 13377 2010-04-25 01:07:36Z jef $ */
1919
#ifndef GEOMETRYCOORDINATETRANSFORM_H
2020
#define GEOMETRYCOORDINATETRANSFORM_H
2121

‎src/plugins/spatialquery/qgsmngprogressbar.cpp

100644100755
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* (at your option) any later version. *
1616
* *
1717
***************************************************************************/
18-
/* $Id$ */
18+
/* $Id: qgsmngprogressbar.cpp 13377 2010-04-25 01:07:36Z jef $ */
1919

2020
#include "qgsmngprogressbar.h"
2121

‎src/plugins/spatialquery/qgsmngprogressbar.h

100644100755
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* (at your option) any later version. *
1616
* *
1717
***************************************************************************/
18-
/* $Id$ */
18+
/* $Id: qgsmngprogressbar.h 13377 2010-04-25 01:07:36Z jef $ */
1919
#ifndef QGSMNGPROGRESSBAR_H
2020
#define QGSMNGPROGRESSBAR_H
2121

‎src/plugins/spatialquery/qgsreaderfeatures.cpp

100644100755
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* (at your option) any later version. *
1616
* *
1717
***************************************************************************/
18-
/* $Id$ */
18+
/* $Id: qgsreaderfeatures.cpp 13377 2010-04-25 01:07:36Z jef $ */
1919

2020
#include <qgsvectordataprovider.h>
2121

‎src/plugins/spatialquery/qgsreaderfeatures.h

100644100755
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* (at your option) any later version. *
1616
* *
1717
***************************************************************************/
18-
/* $Id$ */
18+
/* $Id: qgsreaderfeatures.h 13377 2010-04-25 01:07:36Z jef $ */
1919
#ifndef READERFEATURES_H
2020
#define READERFEATURES_H
2121

‎src/plugins/spatialquery/qgsrubberselectid.cpp

100644100755
File mode changed.

‎src/plugins/spatialquery/qgsrubberselectid.h

100644100755
File mode changed.

‎src/plugins/spatialquery/qgsspatialquery.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,8 @@
1919

2020
#include <QMessageBox>
2121

22-
#include <qgsvectordataprovider.h>
23-
#include <qgsfeature.h>
24-
22+
#include "qgsvectordataprovider.h"
23+
#include "qgsfeature.h"
2524
#include "qgsgeometrycoordinatetransform.h"
2625
#include "qgsspatialquery.h"
2726

‎src/plugins/spatialquery/qgsspatialquery.h

100644100755
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* (at your option) any later version. *
1616
* *
1717
***************************************************************************/
18-
/* $Id$ */
18+
/* $Id: qgsspatialquery.h 15141 2011-02-08 13:34:43Z jef $ */
1919
#ifndef SPATIALQUERY_H
2020
#define SPATIALQUERY_H
2121

‎src/plugins/spatialquery/qgsspatialquerydialog.cpp

100644100755
Lines changed: 389 additions & 361 deletions
Large diffs are not rendered by default.

‎src/plugins/spatialquery/qgsspatialquerydialog.h

100644100755
Lines changed: 37 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -47,30 +47,20 @@ class QgsSpatialQueryDialog : public QDialog, private Ui::QgsSpatialQueryDialogB
4747
//! Message about number layers less Two
4848
static void messageLayersLessTwo();
4949

50-
//! Unload plugins by QGIS - Disconnect signal from QGIS
51-
void disconnectQGis();
52-
53-
//! Override show for ajust size
54-
void show();
55-
5650
private slots:
5751
//! Slots for signs of Dialog
58-
void on_bbMain_accepted();
59-
void on_bbMain_rejected();
52+
void on_bbMain_clicked( QAbstractButton * button);
53+
void on_pbCreateLayerItems_clicked();
54+
void on_pbCreateLayerSelected_clicked();
6055
void on_cbTargetLayer_currentIndexChanged( int index );
6156
void on_cbReferenceLayer_currentIndexChanged( int index );
62-
void on_lwResultFeatureTarget_currentItemChanged( QListWidgetItem * item );
63-
void on_twResultInvalid_currentChanged ( int index );
64-
void on_lwInvalidFeatureTarget_currentItemChanged( QListWidgetItem * item );
65-
void on_lwInvalidFeatureReference_currentItemChanged( QListWidgetItem * item );
57+
void on_cbTypeItems_currentIndexChanged( int index );
58+
void on_cbResultFor_currentIndexChanged();
59+
void on_cbOperation_currentIndexChanged();
60+
void on_lwFeatures_currentItemChanged( QListWidgetItem * item );
61+
void on_ckbUsingSelectedTarget_toggled();
6662
void on_ckbLogProcessing_clicked( bool checked );
6763
void on_ckbZoomItem_clicked( bool checked );
68-
void on_pbSelectResultTarget_clicked();
69-
void on_pbSelectResultTargetAdd_clicked();
70-
void on_pbSelectResultTargetRemove_clicked();
71-
void on_pbSelectedSubsetLayer_clicked();
72-
void on_pbSelectInvalidTarget_clicked();
73-
void on_pbSelectInvalidReference_clicked();
7464

7565
//! Slots for signs of QGIS
7666
void signal_qgis_layerWasAdded( QgsMapLayer* mapLayer );
@@ -81,24 +71,33 @@ class QgsSpatialQueryDialog : public QDialog, private Ui::QgsSpatialQueryDialogB
8171
void signal_layerReference_selectionFeaturesChanged();
8272

8373
private:
74+
//! Enum Type of items
75+
enum TypeItems { itemsResult, itemsInvalidTarget, itemsInvalidReference };
76+
//! Enum Type Result for
77+
enum TypeResultFor { selectedNew, selectedAdd, selectedRemove };
78+
//! Enum Type of verify subset
79+
enum TypeVerifyCreateSubset { verifyOk, verifyTry, verifyImpossible };
80+
8481
//! Initialize the Gui
8582
void initGui();
83+
//! Apply Button
84+
void apply();
85+
//! Visible result
86+
void visibleResult( bool show );
8687
//! Set Layer (Target or Reference)
8788
void setLayer( bool isTarget, int index );
8889
//! Evaluate status of selected features from layer (Target or Reference)
89-
void evaluateCheckBox( bool isTarget );
90+
void evaluateCheckBoxLayer( bool isTarget );
9091
//! Run Query
91-
//! Evaluate button selected add and remove
92-
void evaluateButtonSelected();
9392
void runQuery();
94-
//! Show Log Processing
95-
void showLogProcessing( bool hasShow );
9693
//! Show result of query
9794
void showResultQuery( QDateTime *datetimeStart, QDateTime *datetimeEnd );
98-
//! Set label with number's selected features of layer
99-
void setLabelButtonSelected( QLabel *lb, QgsVectorLayer* lyr, QPushButton *pb);
10095
//! Get string subset with selected FID
101-
QString getSubsetSelected( QgsVectorLayer* lyr );
96+
QString getSubsetFIDs( const QSet< int > *fids, QString fieldFID );
97+
//! Verify can create layer subset
98+
TypeVerifyCreateSubset verifyCreateSubset(QString &msg, QString &fieldFID);
99+
//! Add layer target with subset
100+
bool addLayerSubset( QString name, QString subset );
102101
//! Get Description Layer to show result
103102
QString getDescriptionLayerShow( bool isTarget );
104103
//! Get Description Layer to show result
@@ -119,20 +118,22 @@ class QgsSpatialQueryDialog : public QDialog, private Ui::QgsSpatialQueryDialogB
119118
int getCbIndexLayer( bool isTarget, QgsVectorLayer* lyr );
120119
//! Remove layer in combobox and setting GUI
121120
void removeLayer( bool isTarget, QgsVectorLayer* lyr );
121+
//! Populate cbResultFor
122+
void populateCbResulFor();
123+
//! Populate cbTypeItems
124+
void populateTypeItems();
122125
//! Populates cbTargetLayer with all layers
123126
void populateCbTargetLayer();
124127
//! Populates cbReferenceLayer with all layers except the current target layer
125128
void populateCbReferenceLayer();
126129
//! Populates operationComboBox with the topological operations
127130
void populateCbOperation();
128-
//! Populates the features in QListWidget (use by result, invalid target and reference)
129-
void populateLwFeature( QListWidget *lw, QSet<int> & setFeatures );
130-
//! Clear the features of QListWidget (use by result, invalid target and reference)
131-
void clearLwFeature( QListWidget *listWidget );
132-
//! Make action when change item in ListWidget
133-
void changeLwFeature( QListWidget *listWidget, QgsVectorLayer* lyr, int fid );
131+
//! Set selected GUI (lbStatusSelected and pbCreateLayerSelected)
132+
void setSelectedGui();
133+
//! Make action when change item in List feature
134+
void changeLwFeature( QgsVectorLayer* lyr, int fid );
134135
//! Zoom mapcanvas to current feature in listbox target
135-
void zoomFeatureTarget(QgsVectorLayer* lyr, int fid);
136+
void zoomFeature(QgsVectorLayer* lyr, int fid);
136137
//! Show rubber from feature
137138
void showRubberFeature( QgsVectorLayer* lyr, int id );
138139

@@ -152,16 +153,14 @@ class QgsSpatialQueryDialog : public QDialog, private Ui::QgsSpatialQueryDialogB
152153
QMap<QString, QgsVectorLayer *> mMapIdVectorLayers;
153154
//! Rubber band for features result
154155
QgsRubberSelectId* mRubberSelectId;
156+
//! Text for source selected
157+
QString mSourceSelected;
158+
bool mIsSelectedOperator;
155159

156160
// Message
157161
QString mMsgLayersLessTwo;
158162

159163
void MsgDEBUG( QString sMSg );
160-
161-
//! show/hide operation inputs: target, reference and operation group box
162-
void setLayoutOperationVisible( bool show );
163-
//! show/hide result of operation: result and invalid group box
164-
void setLayoutResultInvalid( bool show );
165164
};
166165

167166
#endif // SPATIALQUERYDIALOG_H
Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
<RCC>
22
<qresource prefix="/icons">
33
<file>spatialquery.png</file>
4-
<file>select.png</file>
5-
<file>selectadd.png</file>
6-
<file>selectremove.png</file>
7-
<file>selectesubsetlayer.png</file>
4+
<file>selectcreatelayer.png</file>
5+
<file>itemscreatelayer.png</file>
86
</qresource>
97
</RCC>

‎src/plugins/spatialquery/qgsspatialquerydialogbase.ui

100644100755
Lines changed: 424 additions & 542 deletions
Large diffs are not rendered by default.

‎src/plugins/spatialquery/qgsspatialqueryplugin.cpp

100644100755
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* (at your option) any later version. *
1717
* *
1818
***************************************************************************/
19-
/* $Id$ */
19+
/* $Id: qgsspatialqueryplugin.cpp 14897 2010-12-12 19:19:54Z wonder $ */
2020

2121

2222
//

‎src/plugins/spatialquery/qgsspatialqueryplugin.h

100644100755
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* (at your option) any later version. *
1717
* *
1818
***************************************************************************/
19-
/* $Id$ */
19+
/* $Id: qgsspatialqueryplugin.h 13377 2010-04-25 01:07:36Z jef $ */
2020

2121
#ifndef SPATIALQUERYPLUGIN_H
2222
#define SPATIALQUERYPLUGIN_H
585 Bytes
Loading

‎src/plugins/spatialquery/spatialquery.png

100644100755
File mode changed.

0 commit comments

Comments
 (0)
Please sign in to comment.