Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
CityDoctor
CityDoctor2
Commits
3610be70
Commit
3610be70
authored
Oct 23, 2020
by
Matthias Betz
Browse files
more translation
parent
2d43c43b
Pipeline
#1077
passed with stage
in 2 minutes and 18 seconds
Changes
18
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/check/ErrorVisitor.java
View file @
3610be70
...
...
@@ -21,7 +21,7 @@ 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
;
import
de.hft.stuttgart.citydoctor2.check.error.DistanceError
;
import
de.hft.stuttgart.citydoctor2.check.error.
NonPlanarPolygon
Distance
Plane
Error
;
import
de.hft.stuttgart.citydoctor2.check.error.DuplicatePointError
;
import
de.hft.stuttgart.citydoctor2.check.error.EdgeIntersectionError
;
import
de.hft.stuttgart.citydoctor2.check.error.HoleOutsideError
;
...
...
@@ -37,7 +37,7 @@ 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
;
import
de.hft.stuttgart.citydoctor2.check.error.Polygon
SelfInt
Error
;
import
de.hft.stuttgart.citydoctor2.check.error.Polygon
IntersectingRings
Error
;
import
de.hft.stuttgart.citydoctor2.check.error.PolygonWrongOrientationError
;
import
de.hft.stuttgart.citydoctor2.check.error.RingNotClosedError
;
import
de.hft.stuttgart.citydoctor2.check.error.RingSelfIntError
;
...
...
@@ -96,9 +96,9 @@ public interface ErrorVisitor {
public
void
visit
(
NormalDeviationError
err
);
public
void
visit
(
DistanceError
err
);
public
void
visit
(
NonPlanarPolygon
Distance
Plane
Error
err
);
public
void
visit
(
Polygon
SelfInt
Error
err
);
public
void
visit
(
Polygon
IntersectingRings
Error
err
);
public
void
visit
(
SolidSelfIntError
err
);
...
...
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/check/HealingMethod.java
View file @
3610be70
...
...
@@ -21,7 +21,7 @@ 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
;
import
de.hft.stuttgart.citydoctor2.check.error.DistanceError
;
import
de.hft.stuttgart.citydoctor2.check.error.
NonPlanarPolygon
Distance
Plane
Error
;
import
de.hft.stuttgart.citydoctor2.check.error.DuplicatePointError
;
import
de.hft.stuttgart.citydoctor2.check.error.EdgeIntersectionError
;
import
de.hft.stuttgart.citydoctor2.check.error.HoleOutsideError
;
...
...
@@ -37,7 +37,7 @@ 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
;
import
de.hft.stuttgart.citydoctor2.check.error.Polygon
SelfInt
Error
;
import
de.hft.stuttgart.citydoctor2.check.error.Polygon
IntersectingRings
Error
;
import
de.hft.stuttgart.citydoctor2.check.error.PolygonWrongOrientationError
;
import
de.hft.stuttgart.citydoctor2.check.error.RingNotClosedError
;
import
de.hft.stuttgart.citydoctor2.check.error.RingSelfIntError
;
...
...
@@ -85,7 +85,7 @@ public interface HealingMethod {
return
false
;
}
default
boolean
visit
(
DistanceError
err
,
ModificationListener
l
)
{
default
boolean
visit
(
NonPlanarPolygon
Distance
Plane
Error
err
,
ModificationListener
l
)
{
return
false
;
}
...
...
@@ -125,7 +125,7 @@ public interface HealingMethod {
return
false
;
}
default
boolean
visit
(
Polygon
SelfInt
Error
err
,
ModificationListener
l
)
{
default
boolean
visit
(
Polygon
IntersectingRings
Error
err
,
ModificationListener
l
)
{
return
false
;
}
...
...
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/check/error/DistanceError.java
→
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/check/error/
NonPlanarPolygon
Distance
Plane
Error.java
View file @
3610be70
...
...
@@ -37,7 +37,7 @@ import de.hft.stuttgart.citydoctor2.utils.Localization;
* @author Matthias Betz
*
*/
public
class
DistanceError
extends
CheckError
{
public
class
NonPlanarPolygon
Distance
Plane
Error
extends
CheckError
{
private
static
final
long
serialVersionUID
=
-
3504364055236383519L
;
...
...
@@ -46,7 +46,7 @@ public class DistanceError extends CheckError {
private
Vertex
v
;
private
Plane
plane
;
public
DistanceError
(
Polygon
p
,
double
distance
,
Vertex
v
,
Plane
plane
)
{
public
NonPlanarPolygon
Distance
Plane
Error
(
Polygon
p
,
double
distance
,
Vertex
v
,
Plane
plane
)
{
super
(
ErrorId
.
GE_P_NON_PLANAR_POLYGON_DISTANCE_PLANE
,
ErrorType
.
ERROR
,
p
);
this
.
p
=
p
;
this
.
distance
=
distance
;
...
...
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/check/error/Polygon
SelfInt
Error.java
→
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/check/error/Polygon
IntersectingRings
Error.java
View file @
3610be70
...
...
@@ -36,14 +36,14 @@ import de.hft.stuttgart.citydoctor2.utils.SerializablePair;
* @author Matthias Betz
*
*/
public
class
Polygon
SelfInt
Error
extends
CheckError
{
public
class
Polygon
IntersectingRings
Error
extends
CheckError
{
private
static
final
long
serialVersionUID
=
-
7043521697085991901L
;
private
Polygon
p
;
private
SerializablePair
<
LinearRing
,
LinearRing
>
intersectingRings
;
public
Polygon
SelfInt
Error
(
Polygon
p
,
SerializablePair
<
LinearRing
,
LinearRing
>
intersectingRings
)
{
public
Polygon
IntersectingRings
Error
(
Polygon
p
,
SerializablePair
<
LinearRing
,
LinearRing
>
intersectingRings
)
{
super
(
ErrorId
.
GE_P_INTERSECTING_RINGS
,
ErrorType
.
ERROR
,
p
);
this
.
p
=
p
;
this
.
intersectingRings
=
intersectingRings
;
...
...
CityDoctorParent/CityDoctorModel/src/main/resources/CityDoctorLocalization.properties
View file @
3610be70
...
...
@@ -3,6 +3,7 @@ DistanceError.distanceFromPlane=distance from plane
AboutDialog.developedBy
=
Developed by
AboutDialog.contact
=
Contact
AboutDialog.title
=
CityDoctor 3 - About
AboutDialog.closeBtn
=
Close
CheckDialog.title
=
Check Configuration
CheckDialog.schematronFiles
=
Schematron Files
CheckDialog.schematronChooserTitle
=
Choose schematron file..
...
...
@@ -53,5 +54,28 @@ MainWindow.showLabel=Show:
MainWindow.searchLabel
=
Search:
MainWindow.searchBtn
=
Search
MainWindow.clearBtn
=
Clear
MainWindow.errorsTab
=
Errors
MainWindow.polygonsTab
=
Polygons
MainWindow.edgesTab
=
Edges
MainWindow.verticesTab
=
Vertices
MainWindow.logTab
=
Log
MainWindow.globalErrorsTab
=
Global Errors
OpenFileDialog.fileLabel
=
File:
OpenFileDialog.selectBtn
=
Select
\ No newline at end of file
OpenFileDialog.selectBtn
=
Select
OpenFileDialog.loadBtn
=
Load
OpenFileDialog.settingsPane
=
Parser Preferences
OpenFileDialog.roundingPlacesLabel
=
NumberOfRoundingPlaces
OpenFileDialog.xmlValidationLabel
=
Use XML Validation
Checker.failXml
=
Failed to write XML Error Report.
Checker.failPdf
=
Failed to write PDF Report.
Checker.checksFinished
=
Finished executing checks
Checker.schematronValidation
=
Starting Schematron validation
Checker.finishedSchematron
=
Finished Schematron validation
Checker.failReports
=
Failed to write reports.
Checker.checkFeature
=
Checking feature: {}
Checker.executeCheck
=
Executing check: {}
ValidationConfiguration.reenable
=
{} has been disabled but {} depends on it, reenabling
ValidationConfiguration.missingSchematron
=
{} is not an existing file, disabling schematron check
CheckContainer.error
=
Unexpected exception while executing check: {}
Checks.missingCheck
=
Could not find check for id: {}
OpenFileDialog.cancelBtn
=
Cancel
\ No newline at end of file
CityDoctorParent/CityDoctorModel/src/main/resources/CityDoctorLocalization_de.properties
View file @
3610be70
DistanceError.distanceFromPlane
=
Abstand von der Ebene
AboutDialog.developedBy
=
Entwickelt von
AboutDialog.contact
=
Kontakt
AboutDialog.title
=
CityDoctor 3 - ber
CheckDialog.title
=
Prfungskonfiguration
AboutDialog.title
=
CityDoctor 3 -
\u
00DCber
AboutDialog.closeBtn
=
Schlie
\u
00DFen
CheckDialog.title
=
Pr
\u
00fcfungskonfiguration
CheckDialog.schematronFiles
=
Schematron Dateien
CheckDialog.schematronChooserTitle
=
Whle Schematron Datei..
CheckDialog.schematronChooserTitle
=
W
\u
00e4
hle Schematron Datei..
CheckDialog.validationConfiguration
=
Validierungs Konfiguration
CheckDialog.startingChecks
=
Starte Prfung
CheckDialog.checksDone
=
Prfung abgeschlossen
CheckDialog.failedChecks
=
Konnte Prfungen nicht ausfhren
CheckDialog.startingChecks
=
Starte Pr
\u
00fc
fung
CheckDialog.checksDone
=
Pr
\u
00fc
fung abgeschlossen
CheckDialog.failedChecks
=
Konnte Pr
\u
00fc
fungen nicht ausf
\u
00fc
hren
CheckDialog.schematronFileNotExisting
=
Schematron Datei existiert nicht, ignoriere
CheckDialog.checkEnabled
=
Aktiv
CheckDialog.parameterValue
=
Wert
CheckDialog.parameterUnit
=
Einheit
CityDoctorController.noDatamodel
=
Datenmodell ist null, keine Prfungen konnten ausgefhrt werden
CityDoctorController.noSourceFile
=
Quelldatei ist null, keine Prfungen konnten ausgefhrt werden
CityDoctorController.noDatamodel
=
Datenmodell ist null, keine Pr
\u
00fc
fungen konnten ausgef
\u
00fc
hrt werden
CityDoctorController.noSourceFile
=
Quelldatei ist null, keine Pr
\u
00fc
fungen konnten ausgef
\u
00fc
hrt werden
ExceptionDialog.stacktrace
=
Der Stacktrace des Fehlers war:
FilterPane.buildings
=
Gebude
FilterPane.bridges
=
Brcken
FilterPane.buildings
=
Geb
\u
00e4
ude
FilterPane.bridges
=
Br
\u
00fc
cken
FilterPane.landUse
=
Landnutzung
FilterPane.transportation
=
Transport
FilterPane.vegetation
=
Vegetation
FilterPane.water
=
Wasser
MainToolBar.wireframe
=
Zeige/Verstecke Gitternetz
MainToolBar.culling
=
Aktiviere/Deaktiviere Entfernen der Rckseiten
MainToolBar.culling
=
Aktiviere/Deaktiviere Entfernen der R
\u
00fc
ckseiten
MainToolBar.writeReports
=
Schreibe Reports
MainToolBar.executeChecks
=
F
hre Pr
fungen aus
MainToolBar.executeChecks
=
F
\u
00fchre Pr
\u
00fc
fungen aus
MainWindow.missingConfig
=
Konnte Konfigurationsdatei nicht finden.
MainWindow.loadGivenFile
=
Lade vorhandene Datei, bitte warten
MainWindow.finishedLoading
=
Fertig geladen
MainWindow.checking
=
Prfe, bitte warten
MainWindow.checking
=
Pr
\u
00fc
fe, bitte warten
MainWindow.writeXml
=
Schreibe Xml Report
MainWindow.finishedXml
=
Xml Report abgeschlossen
MainWindow.writePdf
=
Schreibe Pdf Report
...
...
@@ -38,18 +39,41 @@ MainWindow.loadFailed=Konnte GML-Datei nicht laden: {}
MainWindow.all
=
Alle
MainWindow.withErrors
=
Mit Fehlern
MainWindow.export
=
Exportieren
OpenFileDialog.select
=
Whle CityGML Datei aus
MainWindow.languageChange
=
Um die Spracheinstellung zu bernehmen muss CityDoctor2 neugestartet werden.
MainWindow.buildingsTab
=
Gebude
OpenFileDialog.select
=
W
\u
00e4
hle CityGML Datei aus
MainWindow.languageChange
=
Um die Spracheinstellung zu
\u
00fc
bernehmen muss CityDoctor2 neugestartet werden.
MainWindow.buildingsTab
=
Geb
\u
00e4
ude
MainWindow.vegetationTab
=
Vegetation
MainWindow.transportationTab
=
Verkehrsobjekte
MainWindow.bridgeTab
=
Brcken
MainWindow.waterTab
=
Gewsser
MainWindow.terrainTab
=
Gelnde
MainWindow.bridgeTab
=
Br
\u
00fc
cken
MainWindow.waterTab
=
Gew
\u
00e4
sser
MainWindow.terrainTab
=
Gel
\u
00e4
nde
MainWindow.viewLabel
=
Ansicht
MainWindow.showLabel
=
Zeige:
MainWindow.searchLabel
=
Suche:
MainWindow.searchBtn
=
Suche
MainWindow.clearBtn
=
Leeren
MainWindow.errorsTab
=
Fehler
MainWindow.polygonsTab
=
Polygone
MainWindow.edgesTab
=
Kanten
MainWindow.verticesTab
=
Punkte
MainWindow.logTab
=
Log
MainWindow.globalErrorsTab
=
Globale Fehler
OpenFileDialog.fileLabel
=
Datei:
OpenFileDialog.selectBtn
=
Auswhlen
\ No newline at end of file
OpenFileDialog.selectBtn
=
Ausw
\u
00e4hlen
OpenFileDialog.loadBtn
=
Laden
OpenFileDialog.settingsPane
=
Parser Einstellungen
OpenFileDialog.roundingPlacesLabel
=
NumberOfRoundingPlaces
OpenFileDialog.xmlValidationLabel
=
F
\u
00fchre XML-Validierung aus
Checker.failXml
=
Konnte XML Fehlerbericht nicht schreiben.
Checker.failPdf
=
Konnte PDF Fehlerbericht nicht schreiben.
Checker.checksFinished
=
Pr
\u
00fcfungen beendet
Checker.schematronValidation
=
Starte Schematron Pr
\u
00fcfung
Checker.finishedSchematron
=
Schematron Pr
\u
00fcfung abgeschlossen
Checker.failReports
=
Konnte Pr
\u
00fcfberichte nicht schreiben.
Checker.checkFeature
=
Pr
\u
00fcfe Feature: {}
Checker.executeCheck
=
F
\u
00fchre Pr
\u
00fcfung aus: {}
ValidationConfiguration.reenable
=
{} ist deaktiviert wird aber von {} ben
\u
00f6tigt, reaktiviere
ValidationConfiguration.missingSchematron
=
{} existiert nicht, deaktiviere Schematron Pr
\u
00fcfung
CheckContainer.error
=
Unerwarteter Fehler bei der Ausf
\u
00fchrung von Pr
\u
00fcfung: {}
Checks.missingCheck
=
Konnte keine Pr
\u
00fcfung f
\u
00fcr id {} finden
OpenFileDialog.cancelBtn
=
Abbrechen
\ No newline at end of file
CityDoctorParent/CityDoctorValidation/src/main/java/de/hft/stuttgart/citydoctor2/check/Checker.java
View file @
3610be70
...
...
@@ -27,9 +27,11 @@ import java.util.ArrayList;
import
java.util.Collections
;
import
java.util.HashMap
;
import
java.util.HashSet
;
import
java.util.Iterator
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map.Entry
;
import
java.util.Set
;
import
java.util.stream.Stream
;
import
javax.xml.XMLConstants
;
...
...
@@ -47,7 +49,7 @@ import org.w3c.dom.Document;
import
de.hft.stuttgart.citydoctor2.check.error.SchematronError
;
import
de.hft.stuttgart.citydoctor2.checkresult.utility.CheckReportWriteException
;
import
de.hft.stuttgart.citydoctor2.checks.Check
Container
;
import
de.hft.stuttgart.citydoctor2.checks.Check
Prototype
;
import
de.hft.stuttgart.citydoctor2.checks.Checks
;
import
de.hft.stuttgart.citydoctor2.checks.SvrlContentHandler
;
import
de.hft.stuttgart.citydoctor2.checks.util.FeatureCheckedListener
;
...
...
@@ -65,6 +67,7 @@ import de.hft.stuttgart.citydoctor2.reporting.XmlStreamReporter;
import
de.hft.stuttgart.citydoctor2.reporting.XmlValidationReporter
;
import
de.hft.stuttgart.citydoctor2.reporting.pdf.PdfReporter
;
import
de.hft.stuttgart.citydoctor2.reporting.pdf.PdfStreamReporter
;
import
de.hft.stuttgart.citydoctor2.utils.Localization
;
import
net.sf.saxon.s9api.DOMDestination
;
import
net.sf.saxon.s9api.Destination
;
import
net.sf.saxon.s9api.Processor
;
...
...
@@ -133,7 +136,7 @@ public class Checker {
try
(
BufferedOutputStream
bos
=
new
BufferedOutputStream
(
new
FileOutputStream
(
xmlFile
.
getAbsolutePath
())))
{
reporter
.
writeReport
(
checkConfig
,
bos
,
model
,
config
);
}
catch
(
CheckReportWriteException
|
IOException
e
)
{
logger
.
error
(
"Failed to write XML Error Report."
,
e
);
logger
.
error
(
Localization
.
getText
(
"Checker.failXml"
)
,
e
);
}
}
...
...
@@ -149,7 +152,7 @@ public class Checker {
try
(
BufferedOutputStream
bos
=
new
BufferedOutputStream
(
new
FileOutputStream
(
pdfFile
.
getAbsolutePath
())))
{
reporter
.
writeReport
(
checkConfig
,
bos
,
model
,
config
);
}
catch
(
IOException
|
CheckReportWriteException
e
)
{
logger
.
error
(
"Failed to write PDF Report."
,
e
);
logger
.
error
(
Localization
.
getText
(
"Checker.failPdf"
)
,
e
);
}
}
...
...
@@ -179,7 +182,7 @@ public class Checker {
config
=
ValidationConfiguration
.
loadStandardValidationConfig
();
}
checkCityModel
(
model
,
l
);
logger
.
info
(
"Finished executing checks"
);
logger
.
info
(
Localization
.
getText
(
"Checker.checksFinished"
)
);
SvrlContentHandler
handler
=
executeSchematronValidationIfAvailable
(
config
,
model
.
getFile
());
if
(
handler
!=
null
)
{
model
.
addGlobalErrors
(
handler
.
getGeneralErrors
());
...
...
@@ -210,7 +213,7 @@ public class Checker {
private
static
SvrlContentHandler
executeSchematronValidationIfAvailable
(
ValidationConfiguration
config
,
File
file
)
{
if
(
config
.
getSchematronFilePath
()
!=
null
&&
!
config
.
getSchematronFilePath
().
isEmpty
())
{
logger
.
info
(
"Starting S
chematron
v
alidation"
);
logger
.
info
(
Localization
.
getText
(
"Checker.s
chematron
V
alidation"
)
)
;
Processor
processor
=
new
Processor
(
false
);
XsltCompiler
xsltCompiler
=
processor
.
newXsltCompiler
();
xsltCompiler
.
setURIResolver
(
new
URIResolver
()
{
...
...
@@ -252,7 +255,7 @@ public class Checker {
Destination
dest
=
new
SAXDestination
(
handler
);
schematronTransformer
.
setDestination
(
dest
);
schematronTransformer
.
transform
();
logger
.
info
(
"F
inished
Schematron
validation
"
);
logger
.
info
(
Localization
.
getText
(
"Checker.f
inishedSchematron"
)
);
return
handler
;
}
catch
(
SaxonApiException
|
ParserConfigurationException
e
)
{
logger
.
catching
(
e
);
...
...
@@ -329,7 +332,6 @@ public class Checker {
ParserConfiguration
parserConfig
=
config
.
getParserConfiguration
();
List
<
Check
>
checks
=
collectEnabledChecksAndInit
(
parserConfig
,
config
);
execLayers
=
buildExecutionLayers
(
checks
);
// model has not been validated against the new configuration
}
private
List
<
Check
>
collectEnabledChecksAndInit
(
ParserConfiguration
parserConfig
,
ValidationConfiguration
config
)
{
...
...
@@ -409,46 +411,56 @@ public class Checker {
public
void
executeChecksForCheckable
(
Checkable
co
)
{
// throw away old results
co
.
clearAllContainedCheckResults
();
logger
.
debug
(
"Checking feature: {}"
,
co
);
if
(
logger
.
isDebugEnabled
())
{
logger
.
debug
(
Localization
.
getText
(
"Checker.checkFeature"
),
co
);
}
for
(
int
i
=
0
;
i
<
execLayers
.
size
();
i
++)
{
for
(
Check
check
:
execLayers
.
get
(
i
))
{
logger
.
trace
(
"Executing check: {}"
,
check
.
getCheckId
());
if
(
logger
.
isTraceEnabled
())
{
logger
.
trace
(
Localization
.
getText
(
"Checker.executeCheck"
),
check
.
getCheckId
());
}
co
.
accept
(
check
);
}
}
}
p
rivate
List
<
List
<
Check
>>
buildExecutionLayers
(
List
<
Check
>
checks
)
{
p
ublic
static
List
<
List
<
Check
>>
buildExecutionLayers
(
List
<
Check
>
checks
)
{
List
<
List
<
Check
>>
result
=
new
ArrayList
<>();
for
(
Check
c
:
checks
)
{
int
layer
=
getLayerDepthForCheck
(
c
);
while
(
layer
>=
result
.
size
())
{
result
.
add
(
new
ArrayList
<
Check
>());
Set
<
Check
>
availableChecks
=
new
HashSet
<>(
checks
);
Set
<
CheckId
>
usedChecks
=
new
HashSet
<>();
while
(!
availableChecks
.
isEmpty
())
{
List
<
Check
>
layer
=
new
ArrayList
<>();
Iterator
<
Check
>
iterator
=
availableChecks
.
iterator
();
while
(
iterator
.
hasNext
())
{
Check
c
=
iterator
.
next
();
boolean
hasUnusedDependency
=
searchForUnusedDependency
(
usedChecks
,
c
);
if
(!
hasUnusedDependency
)
{
iterator
.
remove
();
layer
.
add
(
c
);
}
}
if
(
layer
.
isEmpty
())
{
throw
new
IllegalStateException
(
"There are checks that have dependencies that are not executed or are unknown"
);
}
result
.
add
(
layer
);
for
(
Check
c
:
layer
)
{
usedChecks
.
add
(
c
.
getCheckId
());
}
List
<
Check
>
checkLayer
=
result
.
get
(
layer
);
checkLayer
.
add
(
new
CheckContainer
(
c
));
}
return
result
;
}
private
int
getLayerDepthForCheck
(
Check
c
)
{
if
(
c
.
getDependencies
().
isEmpty
())
{
return
0
;
}
HashSet
<
CheckId
>
checkedChecks
=
new
HashSet
<>();
return
getLayerDepthForCheck
(
c
,
checkedChecks
);
}
private
int
getLayerDepthForCheck
(
Check
c
,
HashSet
<
CheckId
>
checkedChecks
)
{
checkedChecks
.
add
(
c
.
getCheckId
());
if
(
c
.
getDependencies
().
isEmpty
())
{
return
0
;
}
int
maxDepth
=
0
;
for
(
CheckId
dependency
:
c
.
getDependencies
())
{
maxDepth
=
Math
.
max
(
maxDepth
,
getLayerDepthForCheck
(
checkConfig
.
getCheckForId
(
dependency
),
checkedChecks
));
private
static
boolean
searchForUnusedDependency
(
Set
<
CheckId
>
usedChecks
,
Check
c
)
{
boolean
hasUnusedDependency
=
false
;
for
(
CheckId
id
:
c
.
getDependencies
())
{
if
(!
usedChecks
.
contains
(
id
))
{
hasUnusedDependency
=
true
;
break
;
}
}
return
maxDepth
+
1
;
return
hasUnusedDependency
;
}
public
static
void
streamCheck
(
FeatureStream
stream
,
String
xmlOutput
,
String
pdfOutput
,
...
...
@@ -481,7 +493,7 @@ public class Checker {
writeReport
(
xmlReporter
,
handler
);
writeReport
(
pdfReporter
,
handler
);
}
catch
(
CheckReportWriteException
e
)
{
logger
.
error
(
"Failed to write r
eports
.
"
,
e
);
logger
.
error
(
Localization
.
getText
(
"Checker.failR
eports"
)
,
e
);
}
}
...
...
@@ -509,7 +521,9 @@ public class Checker {
}
private
void
checkFeature
(
XmlStreamReporter
xmlReporter
,
PdfStreamReporter
pdfReporter
,
CityObject
co
)
{
logger
.
debug
(
"Checking feature: {}"
,
co
);
if
(
logger
.
isDebugEnabled
())
{
logger
.
debug
(
Localization
.
getText
(
"Checker.checkFeature"
),
co
);
}
executeChecksForCityObject
(
co
);
if
(
xmlReporter
!=
null
)
{
xmlReporter
.
report
(
co
);
...
...
CityDoctorParent/CityDoctorValidation/src/main/java/de/hft/stuttgart/citydoctor2/check/ValidationConfiguration.java
View file @
3610be70
...
...
@@ -39,6 +39,7 @@ import org.yaml.snakeyaml.constructor.Constructor;
import
de.hft.stuttgart.citydoctor2.checks.CheckPrototype
;
import
de.hft.stuttgart.citydoctor2.checks.Checks
;
import
de.hft.stuttgart.citydoctor2.parser.ParserConfiguration
;
import
de.hft.stuttgart.citydoctor2.utils.Localization
;
/**
* The validation configuration class represented in the yaml configuration
...
...
@@ -52,7 +53,7 @@ public class ValidationConfiguration implements Serializable {
private
static
final
long
serialVersionUID
=
-
8020055032177740646L
;
private
static
Logger
logger
=
LogManager
.
getLogger
(
ValidationConfiguration
.
class
);
private
static
final
Logger
logger
=
LogManager
.
getLogger
(
ValidationConfiguration
.
class
);
private
int
numberOfRoundingPlaces
=
8
;
private
String
schematronFilePath
=
null
;
...
...
@@ -163,7 +164,7 @@ public class ValidationConfiguration implements Serializable {
CheckConfiguration
checkConfig
=
checks
.
get
(
dep
);
if
(!
checkConfig
.
isEnabled
())
{
checkConfig
.
setEnabled
(
true
);
logger
.
warn
(
"{} has been disabled but {} depends on it,
reenabl
ing"
,
dep
,
c
.
getCheckId
());
logger
.
warn
(
Localization
.
getText
(
"ValidationConfiguration.
reenabl
e"
)
,
dep
,
c
.
getCheckId
());
}
}
insertMissingParametersWithDefaultParameters
(
e
,
c
);
...
...
@@ -172,7 +173,7 @@ public class ValidationConfiguration implements Serializable {
File
f
=
new
File
(
schematronFilePath
);
if
(!
f
.
exists
()
||
!
f
.
isFile
())
{
schematronFilePath
=
null
;
logger
.
warn
(
"{} is not an existing file, disabl
ing
s
chematron
check
"
,
f
.
getAbsolutePath
());
logger
.
warn
(
Localization
.
getText
(
"ValidationConfiguration.miss
ing
S
chematron"
)
,
f
.
getAbsolutePath
());
}
}
}
...
...
CityDoctorParent/CityDoctorValidation/src/main/java/de/hft/stuttgart/citydoctor2/checks/CheckContainer.java
View file @
3610be70
...
...
@@ -49,6 +49,7 @@ import de.hft.stuttgart.citydoctor2.datastructure.TransportationObject;
import
de.hft.stuttgart.citydoctor2.datastructure.Vegetation
;
import
de.hft.stuttgart.citydoctor2.datastructure.WaterObject
;
import
de.hft.stuttgart.citydoctor2.parser.ParserConfiguration
;
import
de.hft.stuttgart.citydoctor2.utils.Localization
;
/**
* A check according to the decorator pattern for handling unexpected exceptions
...
...
@@ -60,7 +61,7 @@ import de.hft.stuttgart.citydoctor2.parser.ParserConfiguration;
*/
public
class
CheckContainer
extends
Check
{
private
static
Logger
logger
=
LogManager
.
getLogger
(
CheckContainer
.
class
);
private
static
final
Logger
logger
=
LogManager
.
getLogger
(
CheckContainer
.
class
);
private
final
Check
check
;
...
...
@@ -88,9 +89,9 @@ public class CheckContainer extends Check {
public
boolean
canExecute
(
Checkable
c
)
{
return
check
.
canExecute
(
c
);
}
private
void
handleException
(
Exception
e
,
Checkable
c
)
{
logger
.
error
(
"Unexpected exception while executing check: "
+
check
.
getCheckId
(),
e
);
logger
.
error
(
Localization
.
getText
(
"CheckContainer.error"
),
check
.
getCheckId
(),
e
);
CheckError
err
=
new
UnknownCheckError
(
c
,
e
,
this
);
CheckResult
cr
=
new
CheckResult
(
check
.
getCheckId
(),
ResultStatus
.
ERROR
,
err
);
c
.
addCheckResult
(
cr
);
...
...
CityDoctorParent/CityDoctorValidation/src/main/java/de/hft/stuttgart/citydoctor2/checks/Checks.java
View file @
3610be70
...
...
@@ -28,20 +28,20 @@ import org.apache.logging.log4j.Logger;
import
de.hft.stuttgart.citydoctor2.check.Check
;
import
de.hft.stuttgart.citydoctor2.check.CheckId
;
import
de.hft.stuttgart.citydoctor2.checks.geometry.CloseCheck
;
import
de.hft.stuttgart.citydoctor2.checks.geometry.
ConComp
Check
;
import
de.hft.stuttgart.citydoctor2.checks.geometry.
RingNot
Close
d
Check
;
import
de.hft.stuttgart.citydoctor2.checks.geometry.
MultipleConnectedComponent
Check
;
import
de.hft.stuttgart.citydoctor2.checks.geometry.DuplicatePointsCheck
;
import
de.hft.stuttgart.citydoctor2.checks.geometry.
Face
OrientCheck
;
import
de.hft.stuttgart.citydoctor2.checks.geometry.
PolygonWrong
Orient
ation
Check
;
import
de.hft.stuttgart.citydoctor2.checks.geometry.FaceOutCheck
;
import
de.hft.stuttgart.citydoctor2.checks.geometry.HoleOutsideCheck
;
import
de.hft.stuttgart.citydoctor2.checks.geometry.InteriorDisconnectedCheck
;
import
de.hft.stuttgart.citydoctor2.checks.geometry.ManifoldVertexCheck
;
import
de.hft.stuttgart.citydoctor2.checks.geometry.NestedRingsCheck
;
import
de.hft.stuttgart.citydoctor2.checks.geometry.NumPointsCheck
;
import
de.hft.stuttgart.citydoctor2.checks.geometry.
OverUse
dEdgeCheck
;
import
de.hft.stuttgart.citydoctor2.checks.geometry.
NonManifol
dEdgeCheck
;
import
de.hft.stuttgart.citydoctor2.checks.geometry.PlanarCheck
;
import
de.hft.stuttgart.citydoctor2.checks.geometry.PolygonSameOrientationCheck
;
import
de.hft.stuttgart.citydoctor2.checks.geometry.Polygon
SelfInt
Check
;
import
de.hft.stuttgart.citydoctor2.checks.geometry.Polygon
IntersectingRings
Check
;
import
de.hft.stuttgart.citydoctor2.checks.geometry.RingSelfIntCheck
;
import
de.hft.stuttgart.citydoctor2.checks.geometry.SolidNotClosedCheck
;
import
de.hft.stuttgart.citydoctor2.checks.geometry.SolidSelfIntCheck
;
...
...
@@ -51,6 +51,7 @@ import de.hft.stuttgart.citydoctor2.checks.semantics.IsFloorCheck;
import
de.hft.stuttgart.citydoctor2.checks.semantics.IsGroundCheck
;
import
de.hft.stuttgart.citydoctor2.checks.semantics.IsWallCheck
;
import
de.hft.stuttgart.citydoctor2.checks.semantics.RoofSurfaceUnfragmentedCheck
;
import
de.hft.stuttgart.citydoctor2.utils.Localization
;
/**
* Container class for all checks. If new checks are added, they need to be
...
...
@@ -61,7 +62,7 @@ import de.hft.stuttgart.citydoctor2.checks.semantics.RoofSurfaceUnfragmentedChec
*/
public
class
Checks
{
private
static
Logger
logger
=
LogManager
.
getLogger
(
Checks
.
class
);
private
static
final
Logger
logger
=
LogManager
.
getLogger
(
Checks
.
class
);
private
static
List
<
CheckPrototype
>
checkPrototypes
;
private
static
Map
<
CheckId
,
CheckPrototype
>
prototypeMap
;
...
...
@@ -74,19 +75,19 @@ public class Checks {
// add new checks here
publish
(
new
NumPointsCheck
());
publish
(
new
CloseCheck
());
publish
(
new
RingNot
Close
d
Check
());
publish
(
new
DuplicatePointsCheck
());
publish
(
new
RingSelfIntCheck
());
publish
(
new
PlanarCheck
());
publish
(
new
PolygonSameOrientationCheck
());
publish
(
new
HoleOutsideCheck
());
publish
(
new
NestedRingsCheck
());
publish
(
new
Polygon
SelfInt
Check
());
publish
(
new
Polygon
IntersectingRings
Check
());
publish
(
new
InteriorDisconnectedCheck
());
publish
(
new
ConComp
Check
());
publish
(
new
MultipleConnectedComponent
Check
());
publish
(
new
SolidNotClosedCheck
());
publish
(
new
OverUse
dEdgeCheck
());
publish
(
new
Face
OrientCheck
());
publish
(
new
NonManifol
dEdgeCheck
());
publish
(
new
PolygonWrong
Orient
ation
Check
());
publish
(
new
FaceOutCheck
());
publish
(
new
TooFewPolygonsCheck
());
publish
(
new
ManifoldVertexCheck
());
...
...
@@ -144,7 +145,7 @@ public class Checks {
public
Check
getCheckForId
(
CheckId
id
)
{
Check
c
=
checkMap
.
get
(
id
);