Skip to content

Commit cfaa71c

Browse files
committedMay 16, 2013
modified topology checker mostly GUI overhaul
1 parent 2c7eff7 commit cfaa71c

File tree

5 files changed

+177
-172
lines changed

5 files changed

+177
-172
lines changed
 

‎src/plugins/topology/checkDock.cpp

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ checkDock::checkDock( QgisInterface* qIface, QWidget* parent )
8787
connect( mValidateAllButton, SIGNAL( clicked() ), this, SLOT( validateAll() ) );
8888
//connect( mValidateSelectedButton, SIGNAL( clicked() ), this, SLOT( validateSelected() ) );
8989
connect( mValidateExtentButton, SIGNAL( clicked() ), this, SLOT( validateExtent() ) );
90-
connect( mToggleRubberbands, SIGNAL( clicked() ), this, SLOT( toggleErrorMarkers() ) );
90+
connect( mToggleRubberband, SIGNAL( clicked() ), this, SLOT( toggleErrorMarker() ) );
9191

9292
connect( mFixButton, SIGNAL( clicked() ), this, SLOT( fix() ) );
9393
connect( mErrorTableView, SIGNAL( clicked( const QModelIndex & ) ), this, SLOT( errorListClicked( const QModelIndex & ) ) );
@@ -380,6 +380,7 @@ void checkDock::runTests( ValidateType type )
380380
mErrorList << errors;
381381
}
382382
mMarkersVisible = true;
383+
mToggleRubberband->setChecked( true );
383384
mErrorListModel->resetModel();
384385
}
385386

@@ -406,6 +407,7 @@ void checkDock::validate( ValidateType type )
406407
clearVertexMarkers();
407408

408409
mErrorTableView->resizeColumnsToContents();
410+
mToggleRubberband->setChecked( true );
409411
}
410412

411413
void checkDock::validateExtent()
@@ -423,21 +425,19 @@ void checkDock::validateSelected()
423425
validate( ValidateSelected );
424426
}
425427

426-
void checkDock::toggleErrorMarkers()
428+
void checkDock::toggleErrorMarker()
427429
{
428-
QList<QgsRubberBand*>::const_iterator it;
429-
for ( it = mRbErrorMarkers.begin(); it != mRbErrorMarkers.end(); ++it )
430-
{
431-
QgsRubberBand* rb = *it;
432-
if ( mMarkersVisible == true )
433-
{
434-
rb->hide();
435-
}
436-
else
430+
QList<QgsRubberBand*>::const_iterator it;
431+
for ( it = mRbErrorMarkers.begin(); it != mRbErrorMarkers.end(); ++it )
437432
{
438-
rb->show();
433+
QgsRubberBand* rb = *it;
434+
if ( mToggleRubberband->isChecked() )
435+
{
436+
rb->show();
437+
}
438+
else
439+
{
440+
rb->hide();
441+
}
439442
}
440-
}
441-
mMarkersVisible = !mMarkersVisible;
442-
443443
}

‎src/plugins/topology/checkDock.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ class checkDock : public QDockWidget, public Ui::checkDock
7676
/**
7777
* toggles the visibility of rubber band error markers
7878
*/
79-
void toggleErrorMarkers();
79+
void toggleErrorMarker();
8080
/**
8181
* Handles error selection
8282
* @param index clicked index in the table

‎src/plugins/topology/checkDock.ui

Lines changed: 61 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -6,44 +6,65 @@
66
<rect>
77
<x>0</x>
88
<y>0</y>
9-
<width>436</width>
10-
<height>439</height>
9+
<width>307</width>
10+
<height>280</height>
1111
</rect>
1212
</property>
1313
<property name="windowTitle">
1414
<string>Topology Checker</string>
1515
</property>
1616
<widget class="QWidget" name="dockWidgetContents">
17-
<layout class="QGridLayout" name="gridLayout">
17+
<layout class="QGridLayout" name="gridLayout_2">
1818
<item row="0" column="0">
19-
<layout class="QVBoxLayout" name="verticalLayout">
19+
<layout class="QHBoxLayout" name="horizontalLayout">
2020
<item>
21-
<layout class="QHBoxLayout" name="horizontalLayout">
22-
<item>
23-
<widget class="QPushButton" name="mValidateAllButton">
24-
<property name="text">
25-
<string>Validate All</string>
26-
</property>
27-
</widget>
28-
</item>
29-
<item>
30-
<widget class="QPushButton" name="mValidateExtentButton">
31-
<property name="text">
32-
<string>Validate Extent</string>
33-
</property>
34-
</widget>
35-
</item>
36-
</layout>
21+
<widget class="QTableView" name="mErrorTableView"/>
3722
</item>
23+
</layout>
24+
</item>
25+
<item row="1" column="0">
26+
<layout class="QHBoxLayout" name="horizontalLayout_4">
3827
<item>
39-
<widget class="QPushButton" name="mToggleRubberbands">
28+
<widget class="QPushButton" name="mConfigureButton">
4029
<property name="text">
41-
<string>Toggle Error Markers</string>
30+
<string>Configure</string>
4231
</property>
4332
</widget>
4433
</item>
34+
</layout>
35+
</item>
36+
<item row="2" column="0">
37+
<layout class="QHBoxLayout" name="horizontalLayout_3">
4538
<item>
46-
<widget class="QTableView" name="mErrorTableView"/>
39+
<widget class="QPushButton" name="mValidateAllButton">
40+
<property name="text">
41+
<string>Validate All</string>
42+
</property>
43+
</widget>
44+
</item>
45+
<item>
46+
<widget class="QPushButton" name="mValidateExtentButton">
47+
<property name="text">
48+
<string>Validate Extent</string>
49+
</property>
50+
</widget>
51+
</item>
52+
</layout>
53+
</item>
54+
<item row="3" column="0">
55+
<layout class="QHBoxLayout" name="horizontalLayout_5">
56+
<item>
57+
<widget class="QCheckBox" name="mToggleRubberband">
58+
<property name="toolTip">
59+
<string>Show topology errors</string>
60+
</property>
61+
<property name="text">
62+
<string>Show errors</string>
63+
</property>
64+
<property name="checked">
65+
<bool>false</bool>
66+
</property>
67+
</widget>
4768
</item>
4869
<item>
4970
<widget class="QLabel" name="mComment">
@@ -52,32 +73,25 @@
5273
</property>
5374
</widget>
5475
</item>
55-
<item>
56-
<layout class="QHBoxLayout" name="horizontalLayout_2">
57-
<item>
58-
<widget class="QPushButton" name="mConfigureButton">
59-
<property name="text">
60-
<string>Configure</string>
61-
</property>
62-
</widget>
63-
</item>
64-
<item>
65-
<widget class="QComboBox" name="mFixBox">
66-
<item>
67-
<property name="text">
68-
<string>Select automatic fix</string>
69-
</property>
70-
</item>
71-
</widget>
72-
</item>
76+
</layout>
77+
</item>
78+
<item row="4" column="0">
79+
<layout class="QGridLayout" name="gridLayout">
80+
<item row="0" column="0">
81+
<widget class="QComboBox" name="mFixBox">
7382
<item>
74-
<widget class="QPushButton" name="mFixButton">
75-
<property name="text">
76-
<string>Fix!</string>
77-
</property>
78-
</widget>
83+
<property name="text">
84+
<string>Select automatic fix</string>
85+
</property>
7986
</item>
80-
</layout>
87+
</widget>
88+
</item>
89+
<item row="0" column="1">
90+
<widget class="QPushButton" name="mFixButton">
91+
<property name="text">
92+
<string>Fix!</string>
93+
</property>
94+
</widget>
8195
</item>
8296
</layout>
8397
</item>

‎src/plugins/topology/rulesDialog.ui

Lines changed: 95 additions & 104 deletions
Original file line numberDiff line numberDiff line change
@@ -6,103 +6,60 @@
66
<rect>
77
<x>0</x>
88
<y>0</y>
9-
<width>739</width>
10-
<height>545</height>
9+
<width>620</width>
10+
<height>416</height>
1111
</rect>
1212
</property>
1313
<property name="windowTitle">
1414
<string>Topology Rule Settings</string>
1515
</property>
1616
<layout class="QGridLayout" name="gridLayout">
1717
<item row="0" column="0">
18-
<layout class="QVBoxLayout" name="verticalLayout">
18+
<widget class="QLabel" name="label">
19+
<property name="text">
20+
<string>Current Rules</string>
21+
</property>
22+
</widget>
23+
</item>
24+
<item row="1" column="0" colspan="2">
25+
<layout class="QHBoxLayout" name="horizontalLayout">
1926
<item>
20-
<widget class="QLabel" name="label">
21-
<property name="text">
22-
<string>Current Rules</string>
27+
<widget class="QComboBox" name="mLayer1Box">
28+
<property name="sizeAdjustPolicy">
29+
<enum>QComboBox::AdjustToContents</enum>
2330
</property>
31+
<item>
32+
<property name="text">
33+
<string>No layer</string>
34+
</property>
35+
</item>
2436
</widget>
2537
</item>
2638
<item>
27-
<widget class="QTableWidget" name="mRulesTable">
28-
<column>
29-
<property name="text">
30-
<string>Rule</string>
31-
</property>
32-
</column>
33-
<column>
34-
<property name="text">
35-
<string>Layer #1</string>
36-
</property>
37-
</column>
38-
<column>
39-
<property name="text">
40-
<string>Layer #2</string>
41-
</property>
42-
</column>
43-
<column>
44-
<property name="text">
45-
<string>Tolerance</string>
46-
</property>
47-
</column>
48-
<column>
49-
<property name="text">
50-
<string>Layer1ID</string>
51-
</property>
52-
</column>
53-
<column>
54-
<property name="text">
55-
<string>Layer2ID</string>
56-
</property>
57-
</column>
39+
<widget class="QComboBox" name="mRuleBox">
40+
<property name="sizeAdjustPolicy">
41+
<enum>QComboBox::AdjustToContents</enum>
42+
</property>
5843
</widget>
5944
</item>
6045
<item>
61-
<layout class="QHBoxLayout" name="horizontalLayout">
62-
<item>
63-
<widget class="QComboBox" name="mLayer1Box">
64-
<property name="sizeAdjustPolicy">
65-
<enum>QComboBox::AdjustToContents</enum>
66-
</property>
67-
<item>
68-
<property name="text">
69-
<string>No layer</string>
70-
</property>
71-
</item>
72-
</widget>
73-
</item>
74-
<item>
75-
<widget class="QComboBox" name="mRuleBox">
76-
<property name="sizeAdjustPolicy">
77-
<enum>QComboBox::AdjustToContents</enum>
78-
</property>
79-
</widget>
80-
</item>
81-
<item>
82-
<widget class="QComboBox" name="mLayer2Box">
83-
<property name="sizeAdjustPolicy">
84-
<enum>QComboBox::AdjustToContents</enum>
85-
</property>
86-
<item>
87-
<property name="text">
88-
<string>No layer</string>
89-
</property>
90-
</item>
91-
</widget>
92-
</item>
46+
<widget class="QComboBox" name="mLayer2Box">
47+
<property name="sizeAdjustPolicy">
48+
<enum>QComboBox::AdjustToContents</enum>
49+
</property>
9350
<item>
94-
<spacer name="horizontalSpacer_2">
95-
<property name="orientation">
96-
<enum>Qt::Horizontal</enum>
97-
</property>
98-
<property name="sizeHint" stdset="0">
99-
<size>
100-
<width>40</width>
101-
<height>20</height>
102-
</size>
103-
</property>
104-
</spacer>
51+
<property name="text">
52+
<string>No layer</string>
53+
</property>
10554
</item>
55+
</widget>
56+
</item>
57+
</layout>
58+
</item>
59+
<item row="2" column="0" colspan="2">
60+
<layout class="QHBoxLayout" name="horizontalLayout_5">
61+
<item>
62+
<layout class="QHBoxLayout" name="horizontalLayout_3">
10663
<item>
10764
<widget class="QLabel" name="mToleranceLabel">
10865
<property name="text">
@@ -116,7 +73,20 @@
11673
</layout>
11774
</item>
11875
<item>
119-
<layout class="QHBoxLayout" name="horizontalLayout_2">
76+
<spacer name="horizontalSpacer_2">
77+
<property name="orientation">
78+
<enum>Qt::Horizontal</enum>
79+
</property>
80+
<property name="sizeHint" stdset="0">
81+
<size>
82+
<width>40</width>
83+
<height>20</height>
84+
</size>
85+
</property>
86+
</spacer>
87+
</item>
88+
<item>
89+
<layout class="QHBoxLayout" name="horizontalLayout_4">
12090
<item>
12191
<widget class="QPushButton" name="mAddTestButton">
12292
<property name="text">
@@ -131,33 +101,54 @@
131101
</property>
132102
</widget>
133103
</item>
134-
<item>
135-
<spacer name="horizontalSpacer">
136-
<property name="orientation">
137-
<enum>Qt::Horizontal</enum>
138-
</property>
139-
<property name="sizeHint" stdset="0">
140-
<size>
141-
<width>198</width>
142-
<height>20</height>
143-
</size>
144-
</property>
145-
</spacer>
146-
</item>
147-
<item>
148-
<widget class="QDialogButtonBox" name="buttonBox">
149-
<property name="orientation">
150-
<enum>Qt::Horizontal</enum>
151-
</property>
152-
<property name="standardButtons">
153-
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
154-
</property>
155-
</widget>
156-
</item>
157104
</layout>
158105
</item>
159106
</layout>
160107
</item>
108+
<item row="3" column="0" colspan="2">
109+
<widget class="QTableWidget" name="mRulesTable">
110+
<column>
111+
<property name="text">
112+
<string>Rule</string>
113+
</property>
114+
</column>
115+
<column>
116+
<property name="text">
117+
<string>Layer #1</string>
118+
</property>
119+
</column>
120+
<column>
121+
<property name="text">
122+
<string>Layer #2</string>
123+
</property>
124+
</column>
125+
<column>
126+
<property name="text">
127+
<string>Tolerance</string>
128+
</property>
129+
</column>
130+
<column>
131+
<property name="text">
132+
<string>Layer1ID</string>
133+
</property>
134+
</column>
135+
<column>
136+
<property name="text">
137+
<string>Layer2ID</string>
138+
</property>
139+
</column>
140+
</widget>
141+
</item>
142+
<item row="4" column="0" colspan="2">
143+
<widget class="QDialogButtonBox" name="buttonBox">
144+
<property name="orientation">
145+
<enum>Qt::Horizontal</enum>
146+
</property>
147+
<property name="standardButtons">
148+
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Help|QDialogButtonBox::Ok</set>
149+
</property>
150+
</widget>
151+
</item>
161152
</layout>
162153
</widget>
163154
<resources/>

‎src/plugins/topology/topolTest.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,11 @@ topolTest::topolTest( QgisInterface* qgsIface )
7777
mTopologyRuleMap[QObject::tr( "must not have gaps" )].useSpatialIndex = false;
7878
mTopologyRuleMap[QObject::tr( "must not have gaps" )].layer1SupportedTypes << QGis::Polygon;
7979

80-
mTopologyRuleMap[QObject::tr( "Must not have multi-part geometries" )].f = &topolTest::checkMultipart;
81-
mTopologyRuleMap[QObject::tr( "Must not have multi-part geometries" )].useSecondLayer = false;
82-
mTopologyRuleMap[QObject::tr( "Must not have multi-part geometries" )].useTolerance = false;
83-
mTopologyRuleMap[QObject::tr( "Must not have multi-part geometries" )].useSpatialIndex = false;
84-
mTopologyRuleMap[QObject::tr( "Must not have multi-part geometries" )].layer1SupportedTypes << QGis::Point << QGis::Polygon << QGis::Line;
80+
mTopologyRuleMap[QObject::tr( "must not have multi-part geometries" )].f = &topolTest::checkMultipart;
81+
mTopologyRuleMap[QObject::tr( "must not have multi-part geometries" )].useSecondLayer = false;
82+
mTopologyRuleMap[QObject::tr( "must not have multi-part geometries" )].useTolerance = false;
83+
mTopologyRuleMap[QObject::tr( "must not have multi-part geometries" )].useSpatialIndex = false;
84+
mTopologyRuleMap[QObject::tr( "must not have multi-part geometries" )].layer1SupportedTypes << QGis::Point << QGis::Polygon << QGis::Line;
8585

8686
// two layer tests
8787
mTopologyRuleMap[QObject::tr( "must not overlap with" )].f = &topolTest::checkOverlapWithLayer;

0 commit comments

Comments
 (0)
Please sign in to comment.