HealingMethod.java 6.41 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/*-
 *  Copyright 2020 Beuth Hochschule für Technik Berlin, Hochschule für Technik Stuttgart
 * 
 *  This file is part of CityDoctor2.
 *
 *  CityDoctor2 is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU Lesser General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  CityDoctor2 is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU Lesser General Public License for more details.
 *
 *  You should have received a copy of the GNU Lesser General Public License
 *  along with CityDoctor2.  If not, see <https://www.gnu.org/licenses/>.
 */
package de.hft.stuttgart.citydoctor2.check;

import de.hft.stuttgart.citydoctor2.check.error.AllPolygonsWrongOrientationError;
import de.hft.stuttgart.citydoctor2.check.error.ConsecutivePointSameError;
import de.hft.stuttgart.citydoctor2.check.error.DependenciesNotMetError;
Matthias Betz's avatar
Matthias Betz committed
24
import de.hft.stuttgart.citydoctor2.check.error.NonPlanarPolygonDistancePlaneError;
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import de.hft.stuttgart.citydoctor2.check.error.DuplicatePointError;
import de.hft.stuttgart.citydoctor2.check.error.EdgeIntersectionError;
import de.hft.stuttgart.citydoctor2.check.error.HoleOutsideError;
import de.hft.stuttgart.citydoctor2.check.error.InteriorDisconnectedError;
import de.hft.stuttgart.citydoctor2.check.error.ManifoldEdgeError;
import de.hft.stuttgart.citydoctor2.check.error.MultipleConnectedComponentsError;
import de.hft.stuttgart.citydoctor2.check.error.NestedRingError;
import de.hft.stuttgart.citydoctor2.check.error.NonManifoldVertexError;
import de.hft.stuttgart.citydoctor2.check.error.NormalDeviationError;
import de.hft.stuttgart.citydoctor2.check.error.NotCeilingError;
import de.hft.stuttgart.citydoctor2.check.error.NotFloorError;
import de.hft.stuttgart.citydoctor2.check.error.NotGroundError;
import de.hft.stuttgart.citydoctor2.check.error.NotWallError;
import de.hft.stuttgart.citydoctor2.check.error.NullAreaError;
import de.hft.stuttgart.citydoctor2.check.error.PointTouchesEdgeError;
Matthias Betz's avatar
Matthias Betz committed
40
import de.hft.stuttgart.citydoctor2.check.error.PolygonIntersectingRingsError;
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
import de.hft.stuttgart.citydoctor2.check.error.PolygonWrongOrientationError;
import de.hft.stuttgart.citydoctor2.check.error.RingNotClosedError;
import de.hft.stuttgart.citydoctor2.check.error.RingSelfIntError;
import de.hft.stuttgart.citydoctor2.check.error.SameOrientationError;
import de.hft.stuttgart.citydoctor2.check.error.SchematronError;
import de.hft.stuttgart.citydoctor2.check.error.SolidNotClosedError;
import de.hft.stuttgart.citydoctor2.check.error.SolidSelfIntError;
import de.hft.stuttgart.citydoctor2.check.error.SurfaceUnfragmentedError;
import de.hft.stuttgart.citydoctor2.check.error.TinyEdgeError;
import de.hft.stuttgart.citydoctor2.check.error.TooFewPointsError;
import de.hft.stuttgart.citydoctor2.check.error.TooFewPolygonsError;
import de.hft.stuttgart.citydoctor2.check.error.UnknownCheckError;

/**
 * Visitor pattern interface used in the healing procedures. The modification
 * listener is to report changed polygons and the returned boolean indicates
 * that changes have happened.
 * 
 * @author Matthias Betz
 *
 */
public interface HealingMethod {

	default boolean visit(CheckError e, ModificationListener l) {
		return false;
	}
	
	default boolean visit(TinyEdgeError e, ModificationListener l) {
		return false;
	}

	default boolean visit(EdgeIntersectionError edgeIntersectionError, ModificationListener l) {
		return false;
	}

	default boolean visit(DuplicatePointError duplicatePointError, ModificationListener l) {
		return false;
	}

	default boolean visit(AllPolygonsWrongOrientationError err, ModificationListener l) {
		return false;
	}

	default boolean visit(DependenciesNotMetError err, ModificationListener l) {
		return false;
	}

Matthias Betz's avatar
Matthias Betz committed
88
	default boolean visit(NonPlanarPolygonDistancePlaneError err, ModificationListener l) {
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
		return false;
	}

	default boolean visit(ConsecutivePointSameError err, ModificationListener l) {
		return false;
	}

	default boolean visit(HoleOutsideError err, ModificationListener l) {
		return false;
	}

	default boolean visit(InteriorDisconnectedError err, ModificationListener l) {
		return false;
	}

	default boolean visit(ManifoldEdgeError err, ModificationListener l) {
		return false;
	}

	default boolean visit(MultipleConnectedComponentsError err, ModificationListener l) {
		return false;
	}

	default boolean visit(NestedRingError err, ModificationListener l) {
		return false;
	}

	default boolean visit(NonManifoldVertexError err, ModificationListener l) {
		return false;
	}

	default boolean visit(NormalDeviationError err, ModificationListener l) {
		return false;
	}

	default boolean visit(NullAreaError err, ModificationListener l) {
		return false;
	}

Matthias Betz's avatar
Matthias Betz committed
128
	default boolean visit(PolygonIntersectingRingsError err, ModificationListener l) {
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
		return false;
	}

	default boolean visit(PolygonWrongOrientationError err, ModificationListener l) {
		return false;
	}

	default boolean visit(RingNotClosedError err, ModificationListener l) {
		return false;
	}

	default boolean visit(RingSelfIntError err, ModificationListener l) {
		return false;
	}

	default boolean visit(SameOrientationError err, ModificationListener l) {
		return false;
	}

	default boolean visit(SolidNotClosedError err, ModificationListener l) {
		return false;
	}

	default boolean visit(SolidSelfIntError err, ModificationListener l) {
		return false;
	}

	default boolean visit(TooFewPointsError err, ModificationListener l) {
		return false;
	}

	default boolean visit(TooFewPolygonsError err, ModificationListener l) {
		return false;
	}

	default boolean visit(UnknownCheckError err, ModificationListener l) {
		return false;
	}

	default boolean visit(PointTouchesEdgeError err, ModificationListener l) {
		return false;
	}

	default boolean visit(NotCeilingError err, ModificationListener l) {
		return false;
	}

	default boolean visit(NotFloorError err, ModificationListener l) {
		return false;
	}

	default boolean visit(NotWallError err, ModificationListener l) {
		return false;
	}

	default boolean visit(NotGroundError err, ModificationListener l) {
		return false;
	}
	
	default boolean visit(SchematronError err, ModificationListener l) {
		return false;
	}
	
	default boolean visit(SurfaceUnfragmentedError err, ModificationListener l) {
		return false;
	}

	public HealingMethod createNew();

}