Skip to content

Commit 4bbb050

Browse files
author
timlinux
committedMar 1, 2011
Updates from Luiz for spatial query plugin
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@15300 c8812cc2-4d05-0410-92ff-de0c093fc19c

9 files changed

+768
-511
lines changed
 

‎src/plugins/spatialquery/qgsspatialquery.cpp

100644100755
+2-2
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.cpp 15141 2011-02-08 13:34:43Z jef $ */
1919

2020
#include <QMessageBox>
2121

@@ -324,7 +324,7 @@ void QgsSpatialQuery::populateIndexResultDisjoint(
324324
mLayerReference->featureAtId( *iterIdReference, featureReference );
325325
geomReference = featureReference.geometry();
326326

327-
if ( !( geomTarget->*op )( geomTarget ) )
327+
if ( !( geomTarget->*op )( geomReference ) )
328328
{
329329
addIndex = false;
330330
break;

‎src/plugins/spatialquery/qgsspatialquerydialog.cpp

100644100755
+386-207
Large diffs are not rendered by default.

‎src/plugins/spatialquery/qgsspatialquerydialog.h

100644100755
+38-40
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: qgsspatialquerydialog.h 15141 2011-02-08 13:34:43Z jef $ */
1919

2020
#ifndef SPATIALQUERYDIALOG_H
2121
#define SPATIALQUERYDIALOG_H
@@ -26,19 +26,6 @@
2626
#include "qgisinterface.h"
2727
#include "qgsvectorlayer.h"
2828

29-
/**
30-
* \brief Enum with feature listwidget
31-
* \enum Feature_Widget
32-
*
33-
*/
34-
enum Feature_Widget
35-
{
36-
FW_Result,
37-
FW_InvalidTarget,
38-
FW_InvalidRefence
39-
};
40-
41-
4229
/**
4330
* \class QgsSpatialQueryDialog
4431
* \brief Spatial Query dialog
@@ -68,20 +55,23 @@ class QgsSpatialQueryDialog : public QDialog, private Ui::QgsSpatialQueryDialogB
6855

6956
private slots:
7057
//! Slots for signs of Dialog
71-
void on_buttonBoxMain_accepted();
72-
void on_buttonBoxMain_rejected();
73-
void on_targetLayerComboBox_currentIndexChanged( int index );
74-
void on_referenceLayerComboBox_currentIndexChanged( int index );
75-
void on_resultFeatureTargetListWidget_itemClicked( QListWidgetItem * item );
76-
void on_resultFeatureTargetListWidget_currentItemChanged( QListWidgetItem * item );
77-
void on_invalidFeatureTargetListWidget_itemClicked( QListWidgetItem * item );
78-
void on_invalidFeatureTargetListWidget_currentItemChanged( QListWidgetItem * item );
79-
void on_invalidFeatureReferenceListWidget_itemClicked( QListWidgetItem * item );
80-
void on_invalidFeatureReferenceListWidget_currentItemChanged( QListWidgetItem * item );
81-
void on_ckboxLogProcessing_clicked( bool checked );
82-
void on_pushButtonSelectResultTarget_clicked();
83-
void on_pushButtonSelectInvalidTarget_clicked();
84-
void on_pushButtonSelectInvalidReference_clicked();
58+
void on_bbMain_accepted();
59+
void on_bbMain_rejected();
60+
void on_cbTargetLayer_currentIndexChanged( int index );
61+
void on_cbReferenceLayer_currentIndexChanged( int index );
62+
void on_lwResultFeatureTarget_currentItemChanged( QListWidgetItem * item );
63+
void on_twResultInvalid_currentChanged ( int index );
64+
void on_twInvalid_currentChanged ( int index );
65+
void on_lwInvalidFeatureTarget_currentItemChanged( QListWidgetItem * item );
66+
void on_lwInvalidFeatureReference_currentItemChanged( QListWidgetItem * item );
67+
void on_ckbLogProcessing_clicked( bool checked );
68+
void on_ckbZoomItem_clicked( bool checked );
69+
void on_pbSelectResultTarget_clicked();
70+
void on_pbSelectResultTargetAdd_clicked();
71+
void on_pbSelectResultTargetRemove_clicked();
72+
void on_pbSelectedSubsetLayer_clicked();
73+
void on_pbSelectInvalidTarget_clicked();
74+
void on_pbSelectInvalidReference_clicked();
8575

8676
//! Slots for signs of QGIS
8777
void signal_qgis_layerWasAdded( QgsMapLayer* mapLayer );
@@ -101,13 +91,21 @@ class QgsSpatialQueryDialog : public QDialog, private Ui::QgsSpatialQueryDialogB
10191
//! Evaluate status of selected features from layer (Target or Reference)
10292
void evaluateCheckBox( bool isTarget );
10393
//! Run Query
94+
//! Evaluate button selected add and remove
95+
void evaluateButtonSelected();
10496
void runQuery();
10597
//! Show Log Processing
10698
void showLogProcessing( bool hasShow );
10799
//! Show result of query
108100
void showResultQuery( QDateTime *datetimeStart, QDateTime *datetimeEnd );
101+
//! Set label with number's selected features of layer
102+
void setLabelButtonSelected( QLabel *lb, QgsVectorLayer* layer, QPushButton *pb);
103+
//! Get string subset with selected FID
104+
QString getSubsetSelected( QgsVectorLayer* layer );
109105
//! Get Description Layer to show result
110106
QString getDescriptionLayerShow( bool isTarget );
107+
//! Get Description Layer to show result
108+
QString getDescriptionInvalidFeaturesShow( bool isTarget );
111109
//! Connect all slots
112110
void connectAll();
113111
//! Disconnect all slots
@@ -119,23 +117,25 @@ class QgsSpatialQueryDialog : public QDialog, private Ui::QgsSpatialQueryDialogB
119117
//! Get Icon for vector layer
120118
QIcon getIconTypeGeometry( QGis::GeometryType geomType );
121119
//! Add layer in combobox (text, data and tooltips)
122-
void addLayerCombobox( bool isTarget, QgsVectorLayer* vectorLayer );
120+
void addCbLayer( bool isTarget, QgsVectorLayer* vectorLayer );
123121
//! Find Layer in combobox
124-
int getIndexLayerCombobox( bool isTarget, QgsVectorLayer* vectorLayer );
122+
int getCbIndexLayer( bool isTarget, QgsVectorLayer* vectorLayer );
125123
//! Remove layer in combobox and setting GUI
126124
void removeLayer( bool isTarget, QgsVectorLayer* lyrRemove );
127-
//! Populates targetLayerComboBox with all layers
128-
void populateTargetLayerComboBox();
129-
//! Populates referenceLayerComboBox with all layers except the current target layer
130-
void populateReferenceLayerComboBox();
125+
//! Populates cbTargetLayer with all layers
126+
void populateCbTargetLayer();
127+
//! Populates cbReferenceLayer with all layers except the current target layer
128+
void populateCbReferenceLayer();
131129
//! Populates operationComboBox with the topological operations
132-
void populateOperationComboBox();
130+
void populateCbOperation();
133131
//! Populates the features in QListWidget (use by result, invalid target and reference)
134-
void populateFeatureListWidget( QListWidget *listWidget, QSet<int> & setFeatures, bool hasSetRow = true );
132+
void populateLwFeature( QListWidget *lw, QSet<int> & setFeatures );
135133
//! Clear the features of QListWidget (use by result, invalid target and reference)
136-
void clearFeatureListWidget( QListWidget *listWidget );
134+
void clearLwFeature( QListWidget *listWidget );
137135
//! Make action when change item in ListWidget
138-
void changeFeatureListWidget( QListWidget *listWidget, QgsVectorLayer* vectorLayer, const QString& currentText );
136+
void changeLwFeature( QListWidget *listWidget, QgsVectorLayer* vectorLayer, int fid );
137+
//! Zoom mapcanvas to current feature in listbox target
138+
void zoomFeatureTarget(QgsVectorLayer* vectorLayer, int fid);
139139
//! Show rubber from feature
140140
void showRubberFeature( QgsVectorLayer* vectorLayer, int id );
141141

@@ -157,8 +157,6 @@ class QgsSpatialQueryDialog : public QDialog, private Ui::QgsSpatialQueryDialogB
157157
QgsRubberSelectId* mRubberSelectId;
158158
//! RGB select feature result
159159
int mRGBRubberSelect[3];
160-
//! Current Feature Widget
161-
Feature_Widget mCurrentFeatureWidget;
162160

163161
// Message
164162
QString mMsgLayersLessTwo;

‎src/plugins/spatialquery/qgsspatialquerydialogbase.qrc

100644100755
+4-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
<RCC>
22
<qresource prefix="/icons">
33
<file>spatialquery.png</file>
4-
<file>selectall.png</file>
4+
<file>select.png</file>
5+
<file>selectadd.png</file>
6+
<file>selectremove.png</file>
7+
<file>selectesubsetlayer.png</file>
58
</qresource>
69
</RCC>

‎src/plugins/spatialquery/qgsspatialquerydialogbase.ui

100644100755
+338-261
Large diffs are not rendered by default.

‎src/plugins/spatialquery/select.png

595 Bytes
Loading
583 Bytes
Loading
585 Bytes
Loading
563 Bytes
Loading

0 commit comments

Comments
 (0)
Please sign in to comment.