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
d1ff5020
Commit
d1ff5020
authored
May 24, 2025
by
Beuster
Browse files
Merge remote-tracking branch 'origin/dev' into dev_cpp_code_conversion
parents
06ad5a8e
b50c5f13
Pipeline
#11130
passed with stage
in 1 minute and 28 seconds
Changes
179
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
CHANGELOG.md
View file @
d1ff5020
...
...
@@ -5,6 +5,21 @@ All notable changes to this project will be documented in this file.
The format is based on
[
Keep a Changelog
](
https://keepachangelog.com/en/1.1.0/
)
,
and this project adheres to
[
Semantic Versioning
](
https://semver.org/spec/v2.0.0.html
)
.
## [3.17.2] (2025-06-05)
-
Rework of AbstractCheck, allowing the implementation of Visitors that use the CheckEngine to traverse the internal
data model (#108)
-
Reimplemented parsing of TINReliefs
-
Fixed Tunnel features missing from the ErrorCollector and BBox calculatio
## [3.17.1] (2025-04-14)
### Fixes
-
Fixed an oversight causing the CityDoctor CLI to ignore .xml files
## [3.17.0] (2025-03-13)
### Added
...
...
CityDoctorParent/CityDoctorCheckResult/pom.xml
View file @
d1ff5020
...
...
@@ -6,7 +6,7 @@
<parent>
<groupId>
de.hft.stuttgart
</groupId>
<artifactId>
CityDoctorParent
</artifactId>
<version>
3.17.
0
</version>
<version>
3.17.
2
</version>
</parent>
<artifactId>
CityDoctorCheckResult
</artifactId>
<dependencies>
...
...
CityDoctorParent/CityDoctorEdge/pom.xml
View file @
d1ff5020
...
...
@@ -6,7 +6,7 @@
<parent>
<groupId>
de.hft.stuttgart
</groupId>
<artifactId>
CityDoctorParent
</artifactId>
<version>
3.17.
0
</version>
<version>
3.17.
2
</version>
</parent>
<artifactId>
CityDoctorEdge
</artifactId>
<dependencies>
...
...
CityDoctorParent/CityDoctorModel/pom.xml
View file @
d1ff5020
...
...
@@ -6,7 +6,7 @@
<parent>
<groupId>
de.hft.stuttgart
</groupId>
<artifactId>
CityDoctorParent
</artifactId>
<version>
3.17.
0
</version>
<version>
3.17.
2
</version>
</parent>
<properties>
<versionString>
${project.version}-${git.commit.id.abbrev}
</versionString>
...
...
@@ -67,7 +67,6 @@
<dependency>
<groupId>
commons-io
</groupId>
<artifactId>
commons-io
</artifactId>
<version>
2.16.1
</version>
<scope>
compile
</scope>
</dependency>
<dependency>
...
...
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/check/AbstractCheck.java
deleted
100644 → 0
View file @
06ad5a8e
/*-
* 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
java.util.Collections
;
import
java.util.Set
;
/**
* This is an empty implementation for a check. Can be used as a normal visitor
* for the city doctor data model
*
* @author Matthias Betz
*
*/
public
class
AbstractCheck
extends
Check
{
@Override
public
Set
<
Requirement
>
appliesToRequirements
()
{
return
Collections
.
emptySet
();
}
@Override
public
CheckId
getCheckId
()
{
return
null
;
}
@Override
public
RequirementType
getType
()
{
return
null
;
}
@Override
public
Check
createNewInstance
()
{
return
null
;
}
}
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/check/Check.java
View file @
d1ff5020
...
...
@@ -49,10 +49,11 @@ import de.hft.stuttgart.citydoctor2.parser.ParserConfiguration;
* @author Matthias Betz
*
*/
public
abstract
class
Check
{
public
abstract
non
-
sealed
class
Check
implements
CheckableVisitor
{
private
final
List
<
Class
<
Checkable
>>
applicableToClasses
=
new
ArrayList
<>(
2
);
@SuppressWarnings
(
"unchecked"
)
protected
Check
()
{
Method
[]
declaredMethods
=
getClass
().
getDeclaredMethods
();
...
...
@@ -66,11 +67,6 @@ public abstract class Check {
}
}
/**
* Returns all classes for which the check needs to be executed
*
* @return a list of classes which the check applies to
*/
public
List
<
Class
<
Checkable
>>
getApplicableToClasses
()
{
return
applicableToClasses
;
}
...
...
@@ -103,17 +99,25 @@ public abstract class Check {
public
abstract
RequirementType
getType
();
/**
* Checks whether the check can be executed on this checkable, meaning the
* checkable or its content can not have any error of any check dependent on
* this check. <br>
* If the check cannot be executed a CheckResult will be created with the
* Returns whether this check validates a feature.
*
* @return true if it validates, false otherwise
*/
@Override
public
boolean
isValidator
()
{
return
true
;
}
/**
* Checks whether this Check can execute on the Checkable, meaning the Checkable contains no error from
* this Check's dependencies and is applicable to this Check. <br/>
* If the check cannot be executed due to not fulfilling the dependencies a CheckResult will be created with the
* ResultStatus = DEPENDENCIES_NOT_MET.
*
*
* @param c the checkable
* @param crc container for all check results
* @return true if the check can be executed, false if the checkable itself or
* one of its containing checkables have an error.
* @return true if the check can be executed, false otherwise
*/
@Override
public
boolean
canExecute
(
Checkable
c
)
{
// ignore objects where this check doesn't apply to
if
(!
canBeApplied
(
c
))
{
...
...
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/check/CheckId.java
View file @
d1ff5020
...
...
@@ -57,7 +57,6 @@ public record CheckId(String name) implements Serializable {
public
static
final
CheckId
C_GE_P_ORIENTATION_RINGS_SAME
=
new
CheckId
(
"C_GE_P_ORIENTATION_RINGS_SAME"
);
public
static
final
CheckId
C_SE_POLYGON_WITHOUT_SURFACE
=
new
CheckId
(
"C_SE_POLYGON_WITHOUT_SURFACE"
);
@Override
public
boolean
equals
(
Object
obj
)
{
if
(
this
==
obj
)
...
...
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/check/Checkable.java
View file @
d1ff5020
...
...
@@ -24,6 +24,13 @@ import java.util.HashMap;
import
java.util.List
;
import
java.util.Map
;
import
de.hft.stuttgart.citydoctor2.utils.CheckErrorFound
;
import
de.hft.stuttgart.citydoctor2.utils.visitors.CheckableErrorCollector
;
import
de.hft.stuttgart.citydoctor2.utils.visitors.ClearVisitorResultsVisitor
;
import
de.hft.stuttgart.citydoctor2.utils.visitors.ClearMetaInformationVisitor
;
import
de.hft.stuttgart.citydoctor2.utils.visitors.ContainsAnyErrorVisitor
;
import
de.hft.stuttgart.citydoctor2.utils.visitors.ContainsErrorVisitor
;
import
de.hft.stuttgart.citydoctor2.utils.visitors.PrepareForCheckingVisitor
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
...
...
@@ -67,11 +74,13 @@ public abstract class Checkable implements Serializable {
* @param c the check from which the check method is called with the Checkable
* instance as parameter.
*/
public
void
accept
(
Check
c
)
{
public
void
accept
(
Check
ableVisitor
c
)
{
if
(
c
.
canExecute
(
this
))
{
c
.
check
(
this
);
}
setValidated
(
true
);
if
(
c
.
isValidator
())
{
setValidated
(
true
);
}
}
/**
...
...
@@ -81,29 +90,47 @@ public abstract class Checkable implements Serializable {
* @return the GML-ID
*/
public
abstract
GmlId
getGmlId
();
/**
* This should be called before executing a check if low memory consumption
* method has been enabled.
This should c
reate edges and additional meta
* method has been enabled.
C
reate
s
edges and additional meta
* information necessary to perform checks.
*/
public
abstract
void
prepareForChecking
();
public
void
prepareForChecking
()
{
this
.
accept
(
new
PrepareForCheckingVisitor
());
}
/**
* This should be called after checking has been done.
This should r
emove any
* created meta information like edges to free up
additional memory space
* This should be called after checking has been done.
R
emove
s
any
* created meta information like edges to free up
memory.
*/
public
abstract
void
clearMetaInformation
();
public
void
clearMetaInformation
()
{
this
.
accept
(
new
ClearMetaInformationVisitor
());
}
/**
* This method checks if the object or any object contained within this
* checkable has an error. It counts as an error if the result status if the
* given check is <code>DEPENDENCIES_NOT_MET<code>.
*
* @param checkIdentifier the name of the check for which an error is searched
* @return true if an error has been found with the given check
* Checks if the object, or any object in its datastructure, has a specific error or is not fulfilling the dependencies
* of it.
*
* @param checkIdentifier the associated CheckID of this error
* @return true if the error was found, false otherwise
*/
public
boolean
containsError
(
CheckId
checkIdentifier
)
{
try
{
ContainsErrorVisitor
.
checkObject
(
this
,
checkIdentifier
);
}
catch
(
CheckErrorFound
c
)
{
return
true
;
}
return
false
;
}
/**
* Checks if this checkable has an error or is not meeting the dependencies for it.
*
* @param checkIdentifier the associated CheckID of this error
* @return true if the error was found, false otherwise
*/
public
boolean
hasError
(
CheckId
checkIdentifier
)
{
CheckResult
cs
=
getCheckResult
(
checkIdentifier
);
if
(
cs
==
null
)
{
return
false
;
...
...
@@ -133,8 +160,8 @@ public abstract class Checkable implements Serializable {
}
/**
*
* @return all check results f
or
this checkable.
*
* @return all check results
o
f this checkable.
*/
public
Map
<
CheckId
,
CheckResult
>
getAllCheckResults
()
{
return
checkResults
;
...
...
@@ -157,13 +184,11 @@ public abstract class Checkable implements Serializable {
}
/**
* Checks whether this checkable has an error. Dependency errors are not
* considered for this function. This will only check this checkable and not
* traverse any checkables contained in this instance.
* Checks whether this checkable has any error, barring dependency errors.
*
* @return true if it has an error, otherwise false
*/
public
boolean
hasAnyError
()
{
public
boolean
hasAnyError
WithoutDependencies
()
{
for
(
CheckResult
cr
:
checkResults
.
values
())
{
if
(
cr
.
getResultStatus
()
==
ResultStatus
.
ERROR
)
{
return
true
;
...
...
@@ -196,7 +221,7 @@ public abstract class Checkable implements Serializable {
}
/**
* Clears
all errors from
this checkable
* Clears
the checkResults list of
this checkable
.
*/
public
void
clearCheckResults
()
{
setValidated
(
false
);
...
...
@@ -204,16 +229,31 @@ public abstract class Checkable implements Serializable {
}
/**
* Removes all errors from this instance and all contained checkables.
* Clears the checkResults list of this checkable and all child objects in its datastructure.
*/
public
final
void
clearAllContainedCheckResults
()
{
this
.
accept
(
new
ClearVisitorResultsVisitor
());
}
/**
* Checks if this checkable contains any error within its datastructure.
*
* @return true if any checkable of this datastructure contains an error, false otherwise
*/
public
abstract
void
clearAllContainedCheckResults
();
public
final
boolean
containsAnyError
()
{
try
{
ContainsAnyErrorVisitor
.
checkObject
(
this
);
}
catch
(
CheckErrorFound
c
)
{
return
true
;
}
return
false
;
}
/**
*
* @return false if the checkable or all checkables contained in this one don't
* have any error.
* Checks if this checkable has any error
* @return true if this checkable has any error, false otherwise
*/
public
boolean
contain
sAnyError
()
{
public
boolean
ha
sAnyError
()
{
for
(
CheckResult
cr
:
checkResults
.
values
())
{
if
(
cr
.
getResultStatus
()
==
ResultStatus
.
ERROR
||
cr
.
getResultStatus
()
==
ResultStatus
.
DEPENDENCIES_NOT_MET
)
{
...
...
@@ -230,6 +270,16 @@ public abstract class Checkable implements Serializable {
* @param errors the collection in which the errors are added.
*/
public
void
collectContainedErrors
(
List
<
CheckError
>
errors
)
{
this
.
accept
(
new
CheckableErrorCollector
(
errors
));
}
/**
* Collects all errors from this checkable and adds
* them to the given list. DEPENDENCY_NOT_MET errors are excluded from this.
*
* @param errors the collection in which the errors are added.
*/
public
void
collectErrors
(
List
<
CheckError
>
errors
)
{
for
(
CheckResult
cr
:
checkResults
.
values
())
{
if
(
cr
.
getResultStatus
()
==
ResultStatus
.
ERROR
)
{
errors
.
add
(
cr
.
getError
());
...
...
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/check/CheckableUtilsVisitor.java
0 → 100644
View file @
d1ff5020
/*-
* 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.datastructure.AbstractBuilding
;
import
de.hft.stuttgart.citydoctor2.datastructure.BoundarySurface
;
import
de.hft.stuttgart.citydoctor2.datastructure.BridgeObject
;
import
de.hft.stuttgart.citydoctor2.datastructure.Building
;
import
de.hft.stuttgart.citydoctor2.datastructure.BuildingPart
;
import
de.hft.stuttgart.citydoctor2.datastructure.CityFurniture
;
import
de.hft.stuttgart.citydoctor2.datastructure.CityObject
;
import
de.hft.stuttgart.citydoctor2.datastructure.GenericCityObject
;
import
de.hft.stuttgart.citydoctor2.datastructure.Geometry
;
import
de.hft.stuttgart.citydoctor2.datastructure.Installation
;
import
de.hft.stuttgart.citydoctor2.datastructure.LandObject
;
import
de.hft.stuttgart.citydoctor2.datastructure.LinearRing
;
import
de.hft.stuttgart.citydoctor2.datastructure.Opening
;
import
de.hft.stuttgart.citydoctor2.datastructure.Polygon
;
import
de.hft.stuttgart.citydoctor2.datastructure.ReliefObject
;
import
de.hft.stuttgart.citydoctor2.datastructure.TinObject
;
import
de.hft.stuttgart.citydoctor2.datastructure.TransportationObject
;
import
de.hft.stuttgart.citydoctor2.datastructure.Vegetation
;
import
de.hft.stuttgart.citydoctor2.datastructure.WaterObject
;
/**
*
* This class serves as the base for CheckableVisitors which fulfill utility functions, like e.g. collecting all
* sub-CityObjects in the datastructure of a CityObject.
* </p>
* Visitors extending from this class will not change the validated-flag of the visited Checkables.
*
*/
public
abstract
non
-
sealed
class
CheckableUtilsVisitor
implements
CheckableVisitor
{
/**
* This function is used for checking of dependencies in {@link Check}. Since UtilsVisitors do not have
* dependencies this function will always return true.
*
* @param c a Checkable
* @return true
*/
@Override
public
boolean
canExecute
(
Checkable
c
)
{
return
true
;
}
@Override
public
final
boolean
isValidator
()
{
return
false
;
}
@Override
public
void
check
(
Checkable
checkable
)
{
}
@Override
public
void
check
(
AbstractBuilding
ab
)
{
}
@Override
public
void
check
(
BoundarySurface
bs
)
{
}
@Override
public
void
check
(
BridgeObject
bo
)
{
}
@Override
public
void
check
(
Building
b
)
{
}
@Override
public
void
check
(
Installation
bi
)
{
}
@Override
public
void
check
(
BuildingPart
bp
)
{
}
@Override
public
void
check
(
CityObject
co
)
{
}
@Override
public
void
check
(
LandObject
lo
)
{
}
@Override
public
void
check
(
Opening
o
)
{
}
@Override
public
void
check
(
TransportationObject
to
)
{
}
@Override
public
void
check
(
Vegetation
veg
)
{
}
@Override
public
void
check
(
WaterObject
wo
)
{
}
@Override
public
void
check
(
Geometry
geom
)
{
}
@Override
public
void
check
(
Polygon
poly
)
{
}
@Override
public
void
check
(
LinearRing
ring
)
{
}
@Override
public
void
check
(
TinObject
tin
)
{
}
@Override
public
void
check
(
ReliefObject
relief
)
{
}
@Override
public
void
check
(
CityFurniture
cf
)
{
}
@Override
public
void
check
(
GenericCityObject
gco
)
{
}
}
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/check/CheckableVisitor.java
0 → 100644
View file @
d1ff5020
package
de.hft.stuttgart.citydoctor2.check
;
import
de.hft.stuttgart.citydoctor2.datastructure.AbstractBuilding
;
import
de.hft.stuttgart.citydoctor2.datastructure.BoundarySurface
;
import
de.hft.stuttgart.citydoctor2.datastructure.BridgeObject
;
import
de.hft.stuttgart.citydoctor2.datastructure.Building
;
import
de.hft.stuttgart.citydoctor2.datastructure.BuildingPart
;
import
de.hft.stuttgart.citydoctor2.datastructure.CityFurniture
;
import
de.hft.stuttgart.citydoctor2.datastructure.CityObject
;
import
de.hft.stuttgart.citydoctor2.datastructure.GenericCityObject
;
import
de.hft.stuttgart.citydoctor2.datastructure.Geometry
;
import
de.hft.stuttgart.citydoctor2.datastructure.Installation
;
import
de.hft.stuttgart.citydoctor2.datastructure.LandObject
;
import
de.hft.stuttgart.citydoctor2.datastructure.LinearRing
;
import
de.hft.stuttgart.citydoctor2.datastructure.Opening
;
import
de.hft.stuttgart.citydoctor2.datastructure.Polygon
;
import
de.hft.stuttgart.citydoctor2.datastructure.ReliefObject
;
import
de.hft.stuttgart.citydoctor2.datastructure.TinObject
;
import
de.hft.stuttgart.citydoctor2.datastructure.TransportationObject
;
import
de.hft.stuttgart.citydoctor2.datastructure.Vegetation
;
import
de.hft.stuttgart.citydoctor2.datastructure.WaterObject
;
public
sealed
interface
CheckableVisitor
permits
Check
,
CheckableUtilsVisitor
{
/**
* Returns whether a Checkable should be flagged as validated after accepting this Visitor.
*/
boolean
isValidator
();
boolean
canExecute
(
Checkable
c
);
void
check
(
Checkable
checkable
);
void
check
(
AbstractBuilding
ab
);
void
check
(
BoundarySurface
bs
);
void
check
(
BridgeObject
bo
);
void
check
(
Building
b
);
void
check
(
Installation
bi
);
void
check
(
BuildingPart
bp
);
void
check
(
CityObject
co
);
void
check
(
LandObject
lo
);
void
check
(
Opening
o
);
void
check
(
TransportationObject
to
);
void
check
(
Vegetation
veg
);
void
check
(
WaterObject
wo
);
void
check
(
Geometry
geom
);
void
check
(
Polygon
poly
);
void
check
(
LinearRing
ring
);
void
check
(
TinObject
tin
);
void
check
(
ReliefObject
relief
);
void
check
(
CityFurniture
cf
);
void
check
(
GenericCityObject
gco
);
}
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/datastructure/AbstractBuilding.java
View file @
d1ff5020
...
...
@@ -18,13 +18,9 @@
*/
package
de.hft.stuttgart.citydoctor2.datastructure
;
import
de.hft.stuttgart.citydoctor2.check.Check
;
import
de.hft.stuttgart.citydoctor2.check.CheckError
;
import
de.hft.stuttgart.citydoctor2.check.CheckId
;
import
de.hft.stuttgart.citydoctor2.check.CheckableVisitor
;
import
de.hft.stuttgart.citydoctor2.parser.ParserConfiguration
;
import
de.hft.stuttgart.citydoctor2.utils.CityGmlUtils
;
import
de.hft.stuttgart.citydoctor2.utils.CopyHandler
;
import
de.hft.stuttgart.citydoctor2.utils.Copyable
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
import
org.citygml4j.core.model.core.AbstractSpaceBoundaryProperty
;
...
...
@@ -83,34 +79,16 @@ public abstract class AbstractBuilding extends CityObject {
ab
.
setLod1Solid
(
null
);
ab
.
setLod2Solid
(
null
);
ab
.
setLod3Solid
(
null
);
ab
.
getDeprecatedProperties
().
setLod4Solid
(
null
);
ab
.
setLod0MultiSurface
(
null
);
ab
.
getDeprecatedProperties
().
setLod1MultiSurface
(
null
);
ab
.
setLod2MultiSurface
(
null
);
ab
.
setLod3MultiSurface
(
null
);
ab
.
getDeprecatedProperties
().
setLod1MultiSurface
(
null
);
ab
.
getDeprecatedProperties
().
setLod4MultiSurface
(
null
);
ab
.
getDeprecatedProperties
().
setLod4Solid
(
null
);
for
(
BoundarySurface
bs
:
boundarySurfaceList
)
{
bs
.
unsetGmlGeometries
();
}
for
(
Installation
bi
:
buildingInstallations
)
{
bi
.
unsetGmlGeometries
();
}
for
(
BuildingRoom
br
:
buildingRooms
)
{
br
.
unsetGmlGeometries
();
}
for
(
BuildingRoomFurniture
bfr
:
buildingRoomFurnitureList
)
{
bfr
.
unsetGmlGeometries
();
}
for
(
Storey
storey
:
buildingStoreys
)
{
storey
.
unsetGmlGeometries
();
}
for
(
BuildingUnit
bu
:
buildingUnits
)
{
bu
.
unsetGmlGeometries
();
}
}
@Override
public
void
re
Create
Geometries
(
GeometryFactory
factory
,
ParserConfiguration
config
)
{
public
void
re
build
Geometries
(
GeometryFactory
factory
,
ParserConfiguration
config
)
{
for
(
Geometry
geom
:
getGeometries
())
{
if
(
geom
instanceof
ImplicitGeometryHolder
)
{
continue
;
...
...
@@ -123,38 +101,21 @@ public abstract class AbstractBuilding extends CityObject {
setSolidAccordingToLod
(
geom
,
solid
);
}
}
for
(
BoundarySurface
bs
:
boundarySurfaceList
)
{
reCreateBoundarySurface
(
factory
,
config
,
bs
);
}
for
(
Installation
bi
:
buildingInstallations
)
{
bi
.
reCreateGeometries
(
factory
,
config
);
}
for
(
BuildingRoom
br
:
buildingRooms
)
{
br
.
reCreateGeometries
(
factory
,
config
);
}
for
(
BuildingRoomFurniture
bfr
:
buildingRoomFurnitureList
)
{
bfr
.
reCreateGeometries
(
factory
,
config
);
}
for
(
Storey
storey
:
buildingStoreys
)
{
storey
.
reCreateGeometries
(
factory
,
config
);
}
for
(
BuildingUnit
bu
:
buildingUnits
)
{
bu
.
reCreateGeometries
(
factory
,
config
);
}
removeEmptyBoundarySurfaces
();
}
private
void
reCreateBoundarySurface
(
GeometryFactory
factory
,
ParserConfiguration
config
,
BoundarySurface
bs
)
{
if
(
bs
.
getGeometries
().
isEmpty
())
{
for
(
AbstractSpaceBoundaryProperty
bsp
:
ab
.
getBoundaries
())
{
if
(
bsp
.
getObject
()
!=
null
&&
bsp
.
getObject
()
==
bs
.
getGmlObject
())
{
logger
.
warn
(
"Found empty boundary surface: {}, removing from building"
,
bs
.
getGmlId
());
ab
.
getBoundaries
().
remove
(
bsp
);
break
;
private
void
removeEmptyBoundarySurfaces
()
{
for
(
BoundarySurface
bs
:
boundarySurfaceList
)
{
if
(
bs
.
getGeometries
().
isEmpty
())
{
for
(
AbstractSpaceBoundaryProperty
bsp
:
ab
.
getBoundaries
())
{
if
(
bsp
.
getObject
()
!=
null
&&
bsp
.
getObject
()
==
bs
.
getGmlObject
())
{
logger
.
warn
(
"Found empty boundary surface: {}, removing from building"
,
bs
.
getGmlId
());
ab
.
getBoundaries
().
remove
(
bsp
);
break
;
}
}
}
return
;
}
bs
.
reCreateGeometries
(
factory
,
config
);
}
private
void
setMultiSurfaceAccordingToLod
(
Geometry
geom
,
MultiSurface
ms
)
{
...
...
@@ -199,7 +160,7 @@ public abstract class AbstractBuilding extends CityObject {
}
@Override
public
void
accept
(
Check
c
)
{
public
void
accept
(
Check
ableVisitor
c
)
{
super
.
accept
(
c
);
if
(
c
.
canExecute
(
this
))
{
c
.
check
(
this
);
...
...
@@ -224,130 +185,6 @@ public abstract class AbstractBuilding extends CityObject {
}
}
@Override
public
void
collectContainedErrors
(
List
<
CheckError
>
errors
)
{
super
.
collectContainedErrors
(
errors
);
for
(
Installation
bi
:
buildingInstallations
)
{
bi
.
collectContainedErrors
(
errors
);
}
for
(
BoundarySurface
bs
:
boundarySurfaceList
)
{
bs
.
collectContainedErrors
(
errors
);
}
for
(
BuildingRoom
br
:
buildingRooms
)
{
br
.
collectContainedErrors
(
errors
);
}
for
(
BuildingRoomFurniture
bfr
:
buildingRoomFurnitureList
)
{
bfr
.
collectContainedErrors
(
errors
);
}
for
(
Storey
storey
:
buildingStoreys
)
{
storey
.
collectContainedErrors
(
errors
);
}
for
(
BuildingUnit
bu
:
buildingUnits
)
{
bu
.
collectContainedErrors
(
errors
);
}
}
@Override
public
void
clearAllContainedCheckResults
()
{
super
.
clearAllContainedCheckResults
();
for
(
Installation
bi
:
buildingInstallations
)
{
bi
.
clearAllContainedCheckResults
();
}
for
(
BoundarySurface
bs
:
boundarySurfaceList
)
{
bs
.
clearAllContainedCheckResults
();
}
for
(
BuildingRoom
br
:
buildingRooms
)
{
br
.
clearAllContainedCheckResults
();
}
for
(
BuildingRoomFurniture
bfr
:
buildingRoomFurnitureList
)
{
bfr
.
clearAllContainedCheckResults
();
}
for
(
Storey
storey
:
buildingStoreys
)
{
storey
.
clearAllContainedCheckResults
();
}
for
(
BuildingUnit
bu
:
buildingUnits
)
{
bu
.
clearAllContainedCheckResults
();
}
}
@Override
public
boolean
containsError
(
CheckId
checkIdentifier
)
{
boolean
hasError
=
super
.
containsError
(
checkIdentifier
);
if
(
hasError
)
{
return
true
;
}
for
(
Installation
bi
:
buildingInstallations
)
{
if
(
bi
.
containsError
(
checkIdentifier
))
{
return
true
;
}
}
for
(
BoundarySurface
bs
:
boundarySurfaceList
)
{
if
(
bs
.
containsError
(
checkIdentifier
))
{
return
true
;
}
}
for
(
BuildingRoom
br
:
buildingRooms
)
{
if
(
br
.
containsError
(
checkIdentifier
))
{
return
true
;
}
}
for
(
BuildingRoomFurniture
bfr
:
buildingRoomFurnitureList
)
{
if
(
bfr
.
containsError
(
checkIdentifier
))
{
return
true
;
}
}
for
(
Storey
storey
:
buildingStoreys
)
{
if
(
storey
.
containsError
(
checkIdentifier
))
{
return
true
;
}
}
for
(
BuildingUnit
bu
:
buildingUnits
)
{
if
(
bu
.
containsError
(
checkIdentifier
))
{
return
true
;
}
}
return
false
;
}
@Override
public
boolean
containsAnyError
()
{
boolean
hasError
=
super
.
containsAnyError
();
if
(
hasError
)
{
return
true
;
}
for
(
Installation
bi
:
buildingInstallations
)
{
if
(
bi
.
containsAnyError
())
{
return
true
;
}
}
for
(
BoundarySurface
bs
:
boundarySurfaceList
)
{
if
(
bs
.
containsAnyError
())
{
return
true
;
}
}
for
(
BuildingRoom
br
:
buildingRooms
)
{
if
(
br
.
containsAnyError
())
{
return
true
;
}
}
for
(
BuildingRoomFurniture
bfr
:
buildingRoomFurnitureList
)
{
if
(
bfr
.
containsAnyError
())
{
return
true
;
}
}
for
(
Storey
storey
:
buildingStoreys
)
{
if
(
storey
.
containsAnyError
())
{
return
true
;
}
}
for
(
BuildingUnit
bu
:
buildingUnits
)
{
if
(
bu
.
containsAnyError
())
{
return
true
;
}
}
return
false
;
}
void
setCityGmlBuilding
(
org
.
citygml4j
.
core
.
model
.
building
.
AbstractBuilding
ab
)
{
this
.
ab
=
ab
;
}
...
...
@@ -406,86 +243,4 @@ public abstract class AbstractBuilding extends CityObject {
return
buildingUnits
;
}
@Override
public
void
prepareForChecking
()
{
super
.
prepareForChecking
();
for
(
Installation
bi
:
buildingInstallations
)
{
bi
.
prepareForChecking
();
}
for
(
BoundarySurface
bs
:
boundarySurfaceList
)
{
bs
.
prepareForChecking
();
}
for
(
BuildingRoom
br
:
buildingRooms
)
{
br
.
prepareForChecking
();
}
for
(
BuildingRoomFurniture
bfr
:
buildingRoomFurnitureList
)
{
bfr
.
prepareForChecking
();
}
for
(
Storey
storey
:
buildingStoreys
)
{
storey
.
prepareForChecking
();
}
for
(
BuildingUnit
bu
:
buildingUnits
)
{
bu
.
prepareForChecking
();
}
}
@Override
public
void
clearMetaInformation
()
{
super
.
clearMetaInformation
();
for
(
Installation
bi
:
buildingInstallations
)
{
bi
.
clearMetaInformation
();
}
for
(
BoundarySurface
bs
:
boundarySurfaceList
)
{
bs
.
clearMetaInformation
();
}
for
(
BuildingRoom
br
:
buildingRooms
)
{
br
.
clearMetaInformation
();
}
for
(
BuildingRoomFurniture
bfr
:
buildingRoomFurnitureList
)
{
bfr
.
clearMetaInformation
();
}
for
(
Storey
storey
:
buildingStoreys
)
{
storey
.
clearMetaInformation
();
}
for
(
BuildingUnit
bu
:
buildingUnits
)
{
bu
.
clearMetaInformation
();
}
}
@Override
public
void
collectInstances
(
CopyHandler
handler
)
{
super
.
collectInstances
(
handler
);
handler
.
addInstance
(
boundarySurfaceList
);
handler
.
addInstance
(
buildingInstallations
);
handler
.
addInstance
(
buildingRooms
);
handler
.
addInstance
(
buildingRoomFurnitureList
);
handler
.
addInstance
(
buildingStoreys
);
handler
.
addInstance
(
buildingUnits
);
}
@Override
public
void
fillValues
(
Copyable
original
,
CopyHandler
handler
)
{
super
.
fillValues
(
original
,
handler
);
AbstractBuilding
originalAb
=
(
AbstractBuilding
)
original
;
for
(
BoundarySurface
originalBs
:
originalAb
.
boundarySurfaceList
)
{
boundarySurfaceList
.
add
(
handler
.
getCopyInstance
(
originalBs
));
}
for
(
Installation
originalBi
:
originalAb
.
buildingInstallations
)
{
buildingInstallations
.
add
(
handler
.
getCopyInstance
(
originalBi
));
}
for
(
BuildingRoom
originalBr
:
originalAb
.
buildingRooms
)
{
buildingRooms
.
add
(
handler
.
getCopyInstance
(
originalBr
));
}
for
(
BuildingRoomFurniture
originalBFR
:
originalAb
.
buildingRoomFurnitureList
)
{
buildingRoomFurnitureList
.
add
(
handler
.
getCopyInstance
(
originalBFR
));
}
for
(
Storey
originalBStoreys
:
originalAb
.
buildingStoreys
)
{
buildingStoreys
.
add
(
handler
.
getCopyInstance
(
originalBStoreys
));
}
for
(
BuildingUnit
originalBun
:
originalAb
.
buildingUnits
)
{
buildingUnits
.
add
(
handler
.
getCopyInstance
(
originalBun
));
}
ab
=
originalAb
.
ab
;
}
}
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/datastructure/AbstractBuildingSubdivision.java
View file @
d1ff5020
package
de.hft.stuttgart.citydoctor2.datastructure
;
import
de.hft.stuttgart.citydoctor2.check.Check
;
import
de.hft.stuttgart.citydoctor2.check.CheckError
;
import
de.hft.stuttgart.citydoctor2.check.CheckId
;
import
de.hft.stuttgart.citydoctor2.check.CheckableVisitor
;
import
de.hft.stuttgart.citydoctor2.parser.ParserConfiguration
;
import
de.hft.stuttgart.citydoctor2.utils.CityGmlUtils
;
import
de.hft.stuttgart.citydoctor2.utils.CopyHandler
;
import
de.hft.stuttgart.citydoctor2.utils.Copyable
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
import
org.citygml4j.core.model.core.AbstractSpaceBoundaryProperty
;
...
...
@@ -71,25 +67,13 @@ public abstract class AbstractBuildingSubdivision extends CityObject {
abs
.
setLod1Solid
(
null
);
abs
.
setLod2Solid
(
null
);
abs
.
setLod3Solid
(
null
);
abs
.
setLod0MultiSurface
(
null
);
abs
.
setLod2MultiSurface
(
null
);
abs
.
setLod3MultiSurface
(
null
);
for
(
BoundarySurface
bs
:
boundarySurfaceList
)
{
bs
.
unsetGmlGeometries
();
}
for
(
Installation
bi
:
buildingInstallations
)
{
bi
.
unsetGmlGeometries
();
}
for
(
BuildingRoom
br
:
buildingRooms
)
{
br
.
unsetGmlGeometries
();
}
for
(
BuildingRoomFurniture
bfr
:
buildingRoomFurnitureList
)
{
bfr
.
unsetGmlGeometries
();
}
}
@Override
public
void
re
Create
Geometries
(
GeometryFactory
factory
,
ParserConfiguration
config
)
{
public
void
re
build
Geometries
(
GeometryFactory
factory
,
ParserConfiguration
config
)
{
for
(
Geometry
geom
:
getGeometries
())
{
if
(
geom
instanceof
ImplicitGeometryHolder
)
{
continue
;
...
...
@@ -102,32 +86,21 @@ public abstract class AbstractBuildingSubdivision extends CityObject {
setSolidAccordingToLod
(
geom
,
solid
);
}
}
for
(
BoundarySurface
bs
:
boundarySurfaceList
)
{
reCreateBoundarySurface
(
factory
,
config
,
bs
);
}
for
(
Installation
bi
:
buildingInstallations
)
{
bi
.
reCreateGeometries
(
factory
,
config
);
}
for
(
BuildingRoom
br
:
buildingRooms
)
{
br
.
reCreateGeometries
(
factory
,
config
);
}
for
(
BuildingRoomFurniture
bfr
:
buildingRoomFurnitureList
)
{
bfr
.
reCreateGeometries
(
factory
,
config
);
}
removeEmptyBoundarySurfaces
();
}
private
void
reCreateBoundarySurface
(
GeometryFactory
factory
,
ParserConfiguration
config
,
BoundarySurface
bs
)
{
if
(
bs
.
getGeometries
().
isEmpty
())
{
for
(
AbstractSpaceBoundaryProperty
bsp
:
abs
.
getBoundaries
())
{
if
(
bsp
.
getObject
()
!=
null
&&
bsp
.
getObject
()
==
bs
.
getGmlObject
())
{
logger
.
warn
(
"Found empty boundary surface: {}, removing from building"
,
bs
.
getGmlId
());
abs
.
getBoundaries
().
remove
(
bsp
);
break
;
private
void
removeEmptyBoundarySurfaces
()
{
for
(
BoundarySurface
bs
:
boundarySurfaceList
)
{
if
(
bs
.
getGeometries
().
isEmpty
())
{
for
(
AbstractSpaceBoundaryProperty
bsp
:
abs
.
getBoundaries
())
{
if
(
bsp
.
getObject
()
!=
null
&&
bsp
.
getObject
()
==
bs
.
getGmlObject
())
{
logger
.
warn
(
"Found empty boundary surface: {}, removing from building-subdivision"
,
bs
.
getGmlId
());
abs
.
getBoundaries
().
remove
(
bsp
);
break
;
}
}
}
return
;
}
bs
.
reCreateGeometries
(
factory
,
config
);
}
private
void
setMultiSurfaceAccordingToLod
(
Geometry
geom
,
MultiSurface
ms
)
{
...
...
@@ -163,7 +136,7 @@ public abstract class AbstractBuildingSubdivision extends CityObject {
}
@Override
public
void
accept
(
Check
c
)
{
public
void
accept
(
Check
ableVisitor
c
)
{
super
.
accept
(
c
);
if
(
c
.
canExecute
(
this
))
{
c
.
check
(
this
);
...
...
@@ -182,98 +155,6 @@ public abstract class AbstractBuildingSubdivision extends CityObject {
}
}
@Override
public
void
collectContainedErrors
(
List
<
CheckError
>
errors
)
{
super
.
collectContainedErrors
(
errors
);
for
(
Installation
bi
:
buildingInstallations
)
{
bi
.
collectContainedErrors
(
errors
);
}
for
(
BoundarySurface
bs
:
boundarySurfaceList
)
{
bs
.
collectContainedErrors
(
errors
);
}
for
(
BuildingRoom
br
:
buildingRooms
)
{
br
.
collectContainedErrors
(
errors
);
}
for
(
BuildingRoomFurniture
bfr
:
buildingRoomFurnitureList
)
{
bfr
.
collectContainedErrors
(
errors
);
}
}
@Override
public
void
clearAllContainedCheckResults
()
{
super
.
clearAllContainedCheckResults
();
for
(
Installation
bi
:
buildingInstallations
)
{
bi
.
clearAllContainedCheckResults
();
}
for
(
BoundarySurface
bs
:
boundarySurfaceList
)
{
bs
.
clearAllContainedCheckResults
();
}
for
(
BuildingRoom
br
:
buildingRooms
)
{
br
.
clearAllContainedCheckResults
();
}
for
(
BuildingRoomFurniture
bfr
:
buildingRoomFurnitureList
)
{
bfr
.
clearAllContainedCheckResults
();
}
}
@Override
public
boolean
containsError
(
CheckId
checkIdentifier
)
{
boolean
hasError
=
super
.
containsError
(
checkIdentifier
);
if
(
hasError
)
{
return
true
;
}
for
(
Installation
bi
:
buildingInstallations
)
{
if
(
bi
.
containsError
(
checkIdentifier
))
{
return
true
;
}
}
for
(
BoundarySurface
bs
:
boundarySurfaceList
)
{
if
(
bs
.
containsError
(
checkIdentifier
))
{
return
true
;
}
}
for
(
BuildingRoom
br
:
buildingRooms
)
{
if
(
br
.
containsError
(
checkIdentifier
))
{
return
true
;
}
}
for
(
BuildingRoomFurniture
bfr
:
buildingRoomFurnitureList
)
{
if
(
bfr
.
containsError
(
checkIdentifier
))
{
return
true
;
}
}
return
false
;
}
@Override
public
boolean
containsAnyError
()
{
boolean
hasError
=
super
.
containsAnyError
();
if
(
hasError
)
{
return
true
;
}
for
(
Installation
bi
:
buildingInstallations
)
{
if
(
bi
.
containsAnyError
())
{
return
true
;
}
}
for
(
BoundarySurface
bs
:
boundarySurfaceList
)
{
if
(
bs
.
containsAnyError
())
{
return
true
;
}
}
for
(
BuildingRoom
br
:
buildingRooms
)
{
if
(
br
.
containsAnyError
())
{
return
true
;
}
}
for
(
BuildingRoomFurniture
bfr
:
buildingRoomFurnitureList
)
{
if
(
bfr
.
containsAnyError
())
{
return
true
;
}
}
return
false
;
}
void
setCityGmlBuilding
(
org
.
citygml4j
.
core
.
model
.
building
.
AbstractBuildingSubdivision
abs
)
{
this
.
abs
=
abs
;
}
...
...
@@ -315,68 +196,6 @@ public abstract class AbstractBuildingSubdivision extends CityObject {
return
buildingRoomFurnitureList
;
}
@Override
public
void
prepareForChecking
()
{
super
.
prepareForChecking
();
for
(
Installation
bi
:
buildingInstallations
)
{
bi
.
prepareForChecking
();
}
for
(
BoundarySurface
bs
:
boundarySurfaceList
)
{
bs
.
prepareForChecking
();
}
for
(
BuildingRoom
br
:
buildingRooms
)
{
br
.
prepareForChecking
();
}
for
(
BuildingRoomFurniture
bfr
:
buildingRoomFurnitureList
)
{
bfr
.
prepareForChecking
();
}
}
@Override
public
void
clearMetaInformation
()
{
super
.
clearMetaInformation
();
for
(
Installation
bi
:
buildingInstallations
)
{
bi
.
clearMetaInformation
();
}
for
(
BoundarySurface
bs
:
boundarySurfaceList
)
{
bs
.
clearMetaInformation
();
}
for
(
BuildingRoom
br
:
buildingRooms
)
{
br
.
clearMetaInformation
();
}
for
(
BuildingRoomFurniture
bfr
:
buildingRoomFurnitureList
)
{
bfr
.
clearMetaInformation
();
}
}
@Override
public
void
collectInstances
(
CopyHandler
handler
)
{
super
.
collectInstances
(
handler
);
handler
.
addInstance
(
boundarySurfaceList
);
handler
.
addInstance
(
buildingInstallations
);
handler
.
addInstance
(
buildingRooms
);
handler
.
addInstance
(
buildingRoomFurnitureList
);
}
@Override
public
void
fillValues
(
Copyable
original
,
CopyHandler
handler
)
{
super
.
fillValues
(
original
,
handler
);
AbstractBuildingSubdivision
originalAbs
=
(
AbstractBuildingSubdivision
)
original
;
for
(
BoundarySurface
originalBs
:
originalAbs
.
boundarySurfaceList
)
{
boundarySurfaceList
.
add
(
handler
.
getCopyInstance
(
originalBs
));
}
for
(
Installation
originalBi
:
originalAbs
.
buildingInstallations
)
{
buildingInstallations
.
add
(
handler
.
getCopyInstance
(
originalBi
));
}
for
(
BuildingRoom
originalBr
:
originalAbs
.
buildingRooms
)
{
buildingRooms
.
add
(
handler
.
getCopyInstance
(
originalBr
));
}
for
(
BuildingRoomFurniture
originalBFR
:
originalAbs
.
buildingRoomFurnitureList
)
{
buildingRoomFurnitureList
.
add
(
handler
.
getCopyInstance
(
originalBFR
));
}
abs
=
originalAbs
.
abs
;
}
}
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/datastructure/AbstractFurniture.java
View file @
d1ff5020
package
de.hft.stuttgart.citydoctor2.datastructure
;
import
de.hft.stuttgart.citydoctor2.check.Check
;
import
de.hft.stuttgart.citydoctor2.check.CheckError
;
import
de.hft.stuttgart.citydoctor2.check.CheckId
;
import
de.hft.stuttgart.citydoctor2.check.CheckableVisitor
;
import
de.hft.stuttgart.citydoctor2.parser.ParserConfiguration
;
import
de.hft.stuttgart.citydoctor2.utils.CityGmlUtils
;
import
de.hft.stuttgart.citydoctor2.utils.CopyHandler
;
import
de.hft.stuttgart.citydoctor2.utils.Copyable
;
import
javafx.scene.paint.Color
;
import
org.citygml4j.core.util.geometry.GeometryFactory
;
import
org.xmlobjects.gml.model.geometry.aggregates.MultiSurface
;
import
org.xmlobjects.gml.model.geometry.aggregates.MultiSurfaceProperty
;
...
...
@@ -32,7 +29,7 @@ public abstract class AbstractFurniture extends CityObject {
private
org
.
citygml4j
.
core
.
model
.
construction
.
AbstractFurniture
af
;
@Override
public
void
accept
(
Check
c
)
{
public
void
accept
(
Check
ableVisitor
c
)
{
super
.
accept
(
c
);
if
(
c
.
canExecute
(
this
))
{
c
.
check
(
this
);
...
...
@@ -42,51 +39,6 @@ public abstract class AbstractFurniture extends CityObject {
}
}
@Override
public
void
collectContainedErrors
(
List
<
CheckError
>
errors
)
{
super
.
collectContainedErrors
(
errors
);
for
(
BoundarySurface
boundarySurface
:
boundarySurfaceList
)
{
boundarySurface
.
collectContainedErrors
(
errors
);
}
}
@Override
public
void
clearAllContainedCheckResults
()
{
super
.
clearAllContainedCheckResults
();
for
(
BoundarySurface
boundarySurface
:
boundarySurfaceList
)
{
boundarySurface
.
clearAllContainedCheckResults
();
}
}
@Override
public
boolean
containsError
(
CheckId
checkIdentifier
)
{
boolean
hasError
=
super
.
containsError
(
checkIdentifier
);
if
(
hasError
)
{
return
true
;
}
for
(
BoundarySurface
boundarySurface
:
boundarySurfaceList
)
{
if
(
boundarySurface
.
containsError
(
checkIdentifier
))
{
return
true
;
}
}
return
false
;
}
@Override
public
boolean
containsAnyError
()
{
boolean
hasError
=
super
.
containsAnyError
();
if
(
hasError
)
{
return
true
;
}
for
(
BoundarySurface
boundarySurface
:
boundarySurfaceList
)
{
if
(
boundarySurface
.
containsAnyError
())
{
return
true
;
}
}
return
false
;
}
@Override
public
org
.
citygml4j
.
core
.
model
.
construction
.
AbstractFurniture
getGmlObject
()
{
return
af
;
...
...
@@ -94,7 +46,7 @@ public abstract class AbstractFurniture extends CityObject {
@Override
public
CityObject
getTopLevelCityObject
(){
return
parent
;
return
parent
.
getTopLevelCityObject
()
;
}
public
void
addBoundarySurface
(
BoundarySurface
boundarySurface
)
{
...
...
@@ -102,12 +54,12 @@ public abstract class AbstractFurniture extends CityObject {
boundarySurface
.
setParent
(
this
);
}
public
List
<
BoundarySurface
>
getBoundarySurface
List
()
{
public
List
<
BoundarySurface
>
getBoundarySurface
s
()
{
return
boundarySurfaceList
;
}
@Override
public
void
re
Create
Geometries
(
GeometryFactory
factory
,
ParserConfiguration
config
)
{
public
void
re
build
Geometries
(
GeometryFactory
factory
,
ParserConfiguration
config
)
{
for
(
Geometry
geom
:
getGeometries
())
{
if
(
geom
instanceof
ImplicitGeometryHolder
)
{
continue
;
...
...
@@ -134,6 +86,11 @@ public abstract class AbstractFurniture extends CityObject {
return
parent
;
}
@Override
public
Color
getRenderColor
()
{
return
parent
.
getRenderColor
();
}
@Override
public
void
unsetGmlGeometries
()
{
af
.
setLod0MultiSurface
(
null
);
...
...
@@ -177,32 +134,9 @@ public abstract class AbstractFurniture extends CityObject {
}
@Override
public
void
prepareForChecking
()
{
super
.
prepareForChecking
();
for
(
BoundarySurface
boundarySurface
:
boundarySurfaceList
)
{
boundarySurface
.
prepareForChecking
();
}
}
@Override
public
void
clearMetaInformation
()
{
super
.
clearMetaInformation
();
for
(
BoundarySurface
boundarySurface
:
boundarySurfaceList
)
{
boundarySurface
.
clearMetaInformation
();
}
}
@Override
public
FeatureType
getFeatureType
()
{
return
FeatureType
.
FURNITURE
;
}
@Override
public
void
fillValues
(
Copyable
original
,
CopyHandler
handler
)
{
super
.
fillValues
(
original
,
handler
);
AbstractFurniture
originalAf
=
(
AbstractFurniture
)
original
;
af
=
originalAf
.
af
;
}
}
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/datastructure/AbstractRoom.java
View file @
d1ff5020
package
de.hft.stuttgart.citydoctor2.datastructure
;
import
de.hft.stuttgart.citydoctor2.check.Check
;
import
de.hft.stuttgart.citydoctor2.check.CheckError
;
import
de.hft.stuttgart.citydoctor2.check.CheckId
;
import
de.hft.stuttgart.citydoctor2.check.CheckableVisitor
;
import
de.hft.stuttgart.citydoctor2.parser.ParserConfiguration
;
import
de.hft.stuttgart.citydoctor2.utils.CityGmlUtils
;
import
de.hft.stuttgart.citydoctor2.utils.CopyHandler
;
import
de.hft.stuttgart.citydoctor2.utils.Copyable
;
import
org.citygml4j.core.model.core.AbstractCityObject
;
import
org.citygml4j.core.util.geometry.GeometryFactory
;
import
org.xmlobjects.gml.model.geometry.aggregates.MultiSurface
;
...
...
@@ -27,7 +23,7 @@ public abstract class AbstractRoom extends CityObject {
private
static
final
long
serialVersionUID
=
-
1730625513988944329L
;
private
final
List
<
Installation
>
roomInstallations
=
new
ArrayList
<>(
2
);
// Rooms have a Href list of furniture, the
actual
object
is
saved in the
Building
// Rooms have a Href list of furniture, the
furniture-
object
s are
saved in the
TopLevelFeature
private
final
List
<
BoundarySurface
>
boundarySurfaceList
=
new
ArrayList
<>();
...
...
@@ -36,7 +32,7 @@ public abstract class AbstractRoom extends CityObject {
@Override
public
void
accept
(
Check
c
)
{
public
void
accept
(
Check
ableVisitor
c
)
{
super
.
accept
(
c
);
if
(
c
.
canExecute
(
this
))
{
c
.
check
(
this
);
...
...
@@ -50,67 +46,7 @@ public abstract class AbstractRoom extends CityObject {
}
@Override
public
void
collectContainedErrors
(
List
<
CheckError
>
errors
)
{
super
.
collectContainedErrors
(
errors
);
for
(
Installation
roomInstallation
:
roomInstallations
)
{
roomInstallation
.
collectContainedErrors
(
errors
);
}
for
(
BoundarySurface
boundarySurface
:
boundarySurfaceList
)
{
boundarySurface
.
collectContainedErrors
(
errors
);
}
}
@Override
public
void
clearAllContainedCheckResults
()
{
super
.
clearAllContainedCheckResults
();
for
(
Installation
roomInstallation
:
roomInstallations
)
{
roomInstallation
.
clearAllContainedCheckResults
();
}
for
(
BoundarySurface
boundarySurface
:
boundarySurfaceList
)
{
boundarySurface
.
clearAllContainedCheckResults
();
}
}
@Override
public
boolean
containsError
(
CheckId
checkIdentifier
)
{
boolean
hasError
=
super
.
containsError
(
checkIdentifier
);
if
(
hasError
)
{
return
true
;
}
for
(
Installation
roomInstallation
:
roomInstallations
)
{
if
(
roomInstallation
.
containsError
(
checkIdentifier
))
{
return
true
;
}
}
for
(
BoundarySurface
boundarySurface
:
boundarySurfaceList
)
{
if
(
boundarySurface
.
containsError
(
checkIdentifier
))
{
return
true
;
}
}
return
false
;
}
@Override
public
boolean
containsAnyError
()
{
boolean
hasError
=
super
.
containsAnyError
();
if
(
hasError
)
{
return
true
;
}
for
(
Installation
roomInstallation
:
roomInstallations
)
{
if
(
roomInstallation
.
containsAnyError
())
{
return
true
;
}
}
for
(
BoundarySurface
boundarySurface
:
boundarySurfaceList
)
{
if
(
boundarySurface
.
containsAnyError
())
{
return
true
;
}
}
return
false
;
}
@Override
public
void
reCreateGeometries
(
GeometryFactory
factory
,
ParserConfiguration
config
)
{
public
void
rebuildGeometries
(
GeometryFactory
factory
,
ParserConfiguration
config
)
{
for
(
Geometry
geom
:
getGeometries
())
{
if
(
geom
instanceof
ImplicitGeometryHolder
)
{
continue
;
...
...
@@ -123,12 +59,6 @@ public abstract class AbstractRoom extends CityObject {
setSolidAccordingToLod
(
geom
,
solid
);
}
}
for
(
BoundarySurface
boundarySurface
:
boundarySurfaceList
)
{
boundarySurface
.
reCreateGeometries
(
factory
,
config
);
}
for
(
Installation
roomInstallation
:
roomInstallations
)
{
roomInstallation
.
reCreateGeometries
(
factory
,
config
);
}
}
...
...
@@ -173,37 +103,8 @@ public abstract class AbstractRoom extends CityObject {
cgmlRoom
.
setLod1Solid
(
null
);
cgmlRoom
.
setLod2Solid
(
null
);
cgmlRoom
.
setLod3Solid
(
null
);
for
(
Installation
roomInstallation
:
roomInstallations
)
{
roomInstallation
.
unsetGmlGeometries
();
}
for
(
BoundarySurface
boundarySurface
:
boundarySurfaceList
)
{
boundarySurface
.
unsetGmlGeometries
();
}
}
@Override
public
void
prepareForChecking
()
{
super
.
prepareForChecking
();
for
(
Installation
roomInstallation
:
roomInstallations
)
{
roomInstallation
.
prepareForChecking
();
}
for
(
BoundarySurface
boundarySurface
:
boundarySurfaceList
)
{
boundarySurface
.
prepareForChecking
();
}
}
@Override
public
void
clearMetaInformation
()
{
super
.
clearMetaInformation
();
for
(
Installation
roomInstallation
:
roomInstallations
)
{
roomInstallation
.
clearMetaInformation
();
}
for
(
BoundarySurface
boundarySurface
:
boundarySurfaceList
)
{
boundarySurface
.
clearMetaInformation
();
}
}
@Override
public
AbstractCityObject
getGmlObject
()
{
return
cgmlRoom
;
...
...
@@ -235,24 +136,4 @@ public abstract class AbstractRoom extends CityObject {
return
FeatureType
.
ROOM
;
}
@Override
public
void
collectInstances
(
CopyHandler
handler
)
{
super
.
collectInstances
(
handler
);
handler
.
addInstance
(
roomInstallations
);
handler
.
addInstance
(
boundarySurfaceList
);
}
@Override
public
void
fillValues
(
Copyable
original
,
CopyHandler
handler
)
{
super
.
fillValues
(
original
,
handler
);
AbstractRoom
originalAr
=
(
AbstractRoom
)
original
;
for
(
BoundarySurface
originalBs
:
originalAr
.
boundarySurfaceList
)
{
boundarySurfaceList
.
add
(
handler
.
getCopyInstance
(
originalBs
));
}
for
(
Installation
originalRi
:
originalAr
.
roomInstallations
)
{
roomInstallations
.
add
(
handler
.
getCopyInstance
(
originalRi
));
}
cgmlRoom
=
originalAr
.
cgmlRoom
;
}
}
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/datastructure/AbstractTunnel.java
View file @
d1ff5020
package
de.hft.stuttgart.citydoctor2.datastructure
;
import
de.hft.stuttgart.citydoctor2.check.Check
;
import
de.hft.stuttgart.citydoctor2.check.CheckError
;
import
de.hft.stuttgart.citydoctor2.check.CheckId
;
import
de.hft.stuttgart.citydoctor2.check.CheckableVisitor
;
import
de.hft.stuttgart.citydoctor2.parser.ParserConfiguration
;
import
de.hft.stuttgart.citydoctor2.utils.CityGmlUtils
;
import
de.hft.stuttgart.citydoctor2.utils.CopyHandler
;
import
de.hft.stuttgart.citydoctor2.utils.Copyable
;
import
javafx.scene.paint.Color
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
import
org.citygml4j.core.model.core.AbstractSpaceBoundaryProperty
;
...
...
@@ -54,39 +51,27 @@ public abstract class AbstractTunnel extends CityObject {
return
FeatureType
.
TUNNEL
;
}
@Override
public
Color
getRenderColor
()
{
return
Color
.
SLATEGRAY
;
}
@Override
public
void
unsetGmlGeometries
()
{
at
.
setLod1Solid
(
null
);
at
.
setLod2Solid
(
null
);
at
.
setLod3Solid
(
null
);
at
.
getDeprecatedProperties
().
setLod4Solid
(
null
);
at
.
setLod0MultiSurface
(
null
);
at
.
getDeprecatedProperties
().
setLod1MultiSurface
(
null
);
at
.
setLod2MultiSurface
(
null
);
at
.
setLod3MultiSurface
(
null
);
at
.
getDeprecatedProperties
().
setLod1MultiSurface
(
null
);
at
.
getDeprecatedProperties
().
setLod4MultiSurface
(
null
);
at
.
getDeprecatedProperties
().
setLod4Solid
(
null
);
for
(
BoundarySurface
bs
:
boundarySurfaceList
)
{
bs
.
unsetGmlGeometries
();
}
for
(
Installation
bi
:
tunnelInstallations
)
{
bi
.
unsetGmlGeometries
();
}
for
(
TunnelHollow
th
:
tunnelHollows
)
{
th
.
unsetGmlGeometries
();
}
for
(
TunnelFurniture
tfr
:
tunnelFurnitureList
)
{
tfr
.
unsetGmlGeometries
();
}
for
(
TunnelConstructiveElement
te
:
tunnelConstructiveElements
)
{
te
.
unsetGmlGeometries
();
}
for
(
TunnelPart
tp
:
tunnelParts
)
{
tp
.
unsetGmlGeometries
();
}
}
@Override
public
void
re
Create
Geometries
(
GeometryFactory
factory
,
ParserConfiguration
config
)
{
public
void
re
build
Geometries
(
GeometryFactory
factory
,
ParserConfiguration
config
)
{
for
(
Geometry
geom
:
getGeometries
())
{
if
(
geom
instanceof
ImplicitGeometryHolder
)
{
continue
;
...
...
@@ -99,38 +84,21 @@ public abstract class AbstractTunnel extends CityObject {
setSolidAccordingToLod
(
geom
,
solid
);
}
}
for
(
BoundarySurface
bs
:
boundarySurfaceList
)
{
reCreateBoundarySurface
(
factory
,
config
,
bs
);
}
for
(
Installation
bi
:
tunnelInstallations
)
{
bi
.
reCreateGeometries
(
factory
,
config
);
}
for
(
TunnelHollow
th
:
tunnelHollows
)
{
th
.
reCreateGeometries
(
factory
,
config
);
}
for
(
TunnelFurniture
tfr
:
tunnelFurnitureList
)
{
tfr
.
reCreateGeometries
(
factory
,
config
);
}
for
(
TunnelConstructiveElement
te
:
tunnelConstructiveElements
)
{
te
.
reCreateGeometries
(
factory
,
config
);
}
for
(
TunnelPart
tp
:
tunnelParts
)
{
tp
.
reCreateGeometries
(
factory
,
config
);
}
removeEmptyBoundarySurfaces
();
}
private
void
reCreateBoundarySurface
(
GeometryFactory
factory
,
ParserConfiguration
config
,
BoundarySurface
bs
)
{
if
(
bs
.
getGeometries
().
isEmpty
())
{
for
(
AbstractSpaceBoundaryProperty
bsp
:
at
.
getBoundaries
())
{
if
(
bsp
.
getObject
()
!=
null
&&
bsp
.
getObject
()
==
bs
.
getGmlObject
())
{
logger
.
warn
(
"Found empty boundary surface: {}, removing from building"
,
bs
.
getGmlId
());
at
.
getBoundaries
().
remove
(
bsp
);
break
;
private
void
removeEmptyBoundarySurfaces
()
{
for
(
BoundarySurface
bs
:
boundarySurfaceList
)
{
if
(
bs
.
getGeometries
().
isEmpty
())
{
for
(
AbstractSpaceBoundaryProperty
bsp
:
at
.
getBoundaries
())
{
if
(
bsp
.
getObject
()
!=
null
&&
bsp
.
getObject
()
==
bs
.
getGmlObject
())
{
logger
.
warn
(
"Found empty boundary surface: {}, removing from tunnel"
,
bs
.
getGmlId
());
at
.
getBoundaries
().
remove
(
bsp
);
break
;
}
}
}
return
;
}
bs
.
reCreateGeometries
(
factory
,
config
);
}
private
void
setMultiSurfaceAccordingToLod
(
Geometry
geom
,
MultiSurface
ms
)
{
...
...
@@ -175,7 +143,7 @@ public abstract class AbstractTunnel extends CityObject {
}
@Override
public
void
accept
(
Check
c
)
{
public
void
accept
(
Check
ableVisitor
c
)
{
super
.
accept
(
c
);
if
(
c
.
canExecute
(
this
))
{
c
.
check
(
this
);
...
...
@@ -200,129 +168,6 @@ public abstract class AbstractTunnel extends CityObject {
}
}
@Override
public
void
collectContainedErrors
(
List
<
CheckError
>
errors
)
{
super
.
collectContainedErrors
(
errors
);
for
(
Installation
bi
:
tunnelInstallations
)
{
bi
.
collectContainedErrors
(
errors
);
}
for
(
BoundarySurface
bs
:
boundarySurfaceList
)
{
bs
.
collectContainedErrors
(
errors
);
}
for
(
TunnelHollow
th
:
tunnelHollows
)
{
th
.
collectContainedErrors
(
errors
);
}
for
(
TunnelFurniture
tfr
:
tunnelFurnitureList
)
{
tfr
.
collectContainedErrors
(
errors
);
}
for
(
TunnelConstructiveElement
te
:
tunnelConstructiveElements
)
{
te
.
collectContainedErrors
(
errors
);
}
for
(
TunnelPart
tp
:
tunnelParts
)
{
tp
.
collectContainedErrors
(
errors
);
}
}
@Override
public
void
clearAllContainedCheckResults
()
{
super
.
clearAllContainedCheckResults
();
for
(
Installation
bi
:
tunnelInstallations
)
{
bi
.
clearAllContainedCheckResults
();
}
for
(
BoundarySurface
bs
:
boundarySurfaceList
)
{
bs
.
clearAllContainedCheckResults
();
}
for
(
TunnelHollow
th
:
tunnelHollows
)
{
th
.
clearAllContainedCheckResults
();
}
for
(
TunnelFurniture
tfr
:
tunnelFurnitureList
)
{
tfr
.
clearAllContainedCheckResults
();
}
for
(
TunnelConstructiveElement
te
:
tunnelConstructiveElements
)
{
te
.
clearAllContainedCheckResults
();
}
for
(
TunnelPart
tp
:
tunnelParts
)
{
tp
.
clearAllContainedCheckResults
();
}
}
@Override
public
boolean
containsError
(
CheckId
checkIdentifier
)
{
boolean
hasError
=
super
.
containsError
(
checkIdentifier
);
if
(
hasError
)
{
return
true
;
}
for
(
Installation
bi
:
tunnelInstallations
)
{
if
(
bi
.
containsError
(
checkIdentifier
))
{
return
true
;
}
}
for
(
BoundarySurface
bs
:
boundarySurfaceList
)
{
if
(
bs
.
containsError
(
checkIdentifier
))
{
return
true
;
}
}
for
(
TunnelHollow
th
:
tunnelHollows
)
{
if
(
th
.
containsError
(
checkIdentifier
))
{
return
true
;
}
}
for
(
TunnelFurniture
tfr
:
tunnelFurnitureList
)
{
if
(
tfr
.
containsError
(
checkIdentifier
))
{
return
true
;
}
}
for
(
TunnelConstructiveElement
te
:
tunnelConstructiveElements
)
{
if
(
te
.
containsError
(
checkIdentifier
))
{
return
true
;
}
}
for
(
TunnelPart
tp
:
tunnelParts
)
{
if
(
tp
.
containsError
(
checkIdentifier
))
{
return
true
;
}
}
return
false
;
}
@Override
public
boolean
containsAnyError
()
{
boolean
hasError
=
super
.
containsAnyError
();
if
(
hasError
)
{
return
true
;
}
for
(
Installation
bi
:
tunnelInstallations
)
{
if
(
bi
.
containsAnyError
())
{
return
true
;
}
}
for
(
BoundarySurface
bs
:
boundarySurfaceList
)
{
if
(
bs
.
containsAnyError
())
{
return
true
;
}
}
for
(
TunnelHollow
th
:
tunnelHollows
)
{
if
(
th
.
containsAnyError
())
{
return
true
;
}
}
for
(
TunnelFurniture
tfr
:
tunnelFurnitureList
)
{
if
(
tfr
.
containsAnyError
())
{
return
true
;
}
}
for
(
TunnelConstructiveElement
te
:
tunnelConstructiveElements
)
{
if
(
te
.
containsAnyError
())
{
return
true
;
}
}
for
(
TunnelPart
tp
:
tunnelParts
)
{
if
(
tp
.
containsAnyError
())
{
return
true
;
}
}
return
false
;
}
void
setCityGmlBuilding
(
org
.
citygml4j
.
core
.
model
.
tunnel
.
AbstractTunnel
at
)
{
this
.
at
=
at
;
...
...
@@ -381,85 +226,4 @@ public abstract class AbstractTunnel extends CityObject {
return
tunnelConstructiveElements
;
}
@Override
public
void
prepareForChecking
()
{
super
.
prepareForChecking
();
for
(
Installation
bi
:
tunnelInstallations
)
{
bi
.
prepareForChecking
();
}
for
(
BoundarySurface
bs
:
boundarySurfaceList
)
{
bs
.
prepareForChecking
();
}
for
(
TunnelHollow
th
:
tunnelHollows
)
{
th
.
prepareForChecking
();
}
for
(
TunnelFurniture
tfr
:
tunnelFurnitureList
)
{
tfr
.
prepareForChecking
();
}
for
(
TunnelConstructiveElement
te
:
tunnelConstructiveElements
)
{
te
.
prepareForChecking
();
}
for
(
TunnelPart
tp
:
tunnelParts
)
{
tp
.
prepareForChecking
();
}
}
@Override
public
void
clearMetaInformation
()
{
super
.
clearMetaInformation
();
for
(
Installation
bi
:
tunnelInstallations
)
{
bi
.
clearMetaInformation
();
}
for
(
BoundarySurface
bs
:
boundarySurfaceList
)
{
bs
.
clearMetaInformation
();
}
for
(
TunnelHollow
th
:
tunnelHollows
)
{
th
.
clearMetaInformation
();
}
for
(
TunnelFurniture
tfr
:
tunnelFurnitureList
)
{
tfr
.
clearMetaInformation
();
}
for
(
TunnelConstructiveElement
te
:
tunnelConstructiveElements
)
{
te
.
clearMetaInformation
();
}
for
(
TunnelPart
tp
:
tunnelParts
)
{
tp
.
clearMetaInformation
();
}
}
@Override
public
void
collectInstances
(
CopyHandler
handler
)
{
super
.
collectInstances
(
handler
);
handler
.
addInstance
(
boundarySurfaceList
);
handler
.
addInstance
(
tunnelInstallations
);
handler
.
addInstance
(
tunnelHollows
);
handler
.
addInstance
(
tunnelFurnitureList
);
handler
.
addInstance
(
tunnelConstructiveElements
);
handler
.
addInstance
(
tunnelParts
);
}
@Override
public
void
fillValues
(
Copyable
original
,
CopyHandler
handler
)
{
super
.
fillValues
(
original
,
handler
);
AbstractTunnel
originalAt
=
(
AbstractTunnel
)
original
;
for
(
BoundarySurface
originalBs
:
originalAt
.
boundarySurfaceList
)
{
boundarySurfaceList
.
add
(
handler
.
getCopyInstance
(
originalBs
));
}
for
(
Installation
originalTi
:
originalAt
.
tunnelInstallations
)
{
tunnelInstallations
.
add
(
handler
.
getCopyInstance
(
originalTi
));
}
for
(
TunnelHollow
originalTh
:
originalAt
.
tunnelHollows
)
{
tunnelHollows
.
add
(
handler
.
getCopyInstance
(
originalTh
));
}
for
(
TunnelFurniture
originalTFR
:
originalAt
.
tunnelFurnitureList
)
{
tunnelFurnitureList
.
add
(
handler
.
getCopyInstance
(
originalTFR
));
}
for
(
TunnelConstructiveElement
originalTE
:
originalAt
.
tunnelConstructiveElements
)
{
tunnelConstructiveElements
.
add
(
handler
.
getCopyInstance
(
originalTE
));
}
for
(
TunnelPart
originalTp
:
originalAt
.
tunnelParts
)
{
tunnelParts
.
add
(
handler
.
getCopyInstance
(
originalTp
));
}
at
=
originalAt
.
at
;
}
}
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/datastructure/BoundarySurface.java
View file @
d1ff5020
...
...
@@ -18,18 +18,14 @@
*/
package
de.hft.stuttgart.citydoctor2.datastructure
;
import
de.hft.stuttgart.citydoctor2.check.Check
;
import
de.hft.stuttgart.citydoctor2.check.CheckError
;
import
de.hft.stuttgart.citydoctor2.check.CheckId
;
import
de.hft.stuttgart.citydoctor2.check.CheckableVisitor
;
import
de.hft.stuttgart.citydoctor2.parser.ParserConfiguration
;
import
de.hft.stuttgart.citydoctor2.utils.CityGmlUtils
;
import
de.hft.stuttgart.citydoctor2.utils.CopyHandler
;
import
de.hft.stuttgart.citydoctor2.utils.Copyable
;
import
javafx.scene.paint.Color
;
import
org.citygml4j.core.model.core.AbstractThematicSurface
;
import
org.citygml4j.core.util.geometry.GeometryFactory
;
import
org.xmlobjects.gml.model.geometry.aggregates.MultiSurface
;
import
org.xmlobjects.gml.model.geometry.aggregates.MultiSurfaceProperty
;
import
java.io.Serial
;
import
java.util.ArrayList
;
import
java.util.List
;
...
...
@@ -87,7 +83,27 @@ public class BoundarySurface extends CityObject {
}
@Override
public
void
reCreateGeometries
(
GeometryFactory
factory
,
ParserConfiguration
config
)
{
public
String
getDisplayText
()
{
return
String
.
format
(
"[%s] %s"
,
this
.
type
.
name
(),
this
.
getGmlId
().
toString
());
}
@Override
public
Color
getRenderColor
()
{
return
switch
(
type
)
{
case
ROOF
->
Color
.
RED
;
case
GROUND
->
Color
.
KHAKI
;
default
->
{
if
(
parent
!=
null
)
{
yield
parent
.
getRenderColor
();
}
else
{
yield
Color
.
WHITE
;
}
}
};
}
@Override
public
void
rebuildGeometries
(
GeometryFactory
factory
,
ParserConfiguration
config
)
{
if
(
gmlObject
.
getId
()
==
null
)
{
gmlObject
.
setId
(
getGmlId
().
getGmlString
());
}
...
...
@@ -104,9 +120,6 @@ public class BoundarySurface extends CityObject {
throw
new
IllegalStateException
(
"BoundarySurfaces can only have MultiSurface geometries"
);
}
}
for
(
Opening
o
:
openings
)
{
o
.
reCreateGeometries
(
factory
,
config
);
}
}
private
void
setGeometryAccordingToLod
(
Lod
lod
,
MultiSurfaceProperty
ms
)
{
...
...
@@ -132,51 +145,7 @@ public class BoundarySurface extends CityObject {
}
@Override
public
void
clearAllContainedCheckResults
()
{
super
.
clearAllContainedCheckResults
();
for
(
Opening
o
:
openings
)
{
o
.
clearAllContainedCheckResults
();
}
}
@Override
public
void
collectContainedErrors
(
List
<
CheckError
>
errors
)
{
super
.
collectContainedErrors
(
errors
);
for
(
Opening
o
:
openings
)
{
o
.
collectContainedErrors
(
errors
);
}
}
@Override
public
boolean
containsAnyError
()
{
boolean
hasError
=
super
.
containsAnyError
();
if
(
hasError
)
{
return
true
;
}
for
(
Opening
o
:
openings
)
{
if
(
o
.
containsAnyError
())
{
return
true
;
}
}
return
false
;
}
@Override
public
boolean
containsError
(
CheckId
checkIdentifier
)
{
boolean
hasError
=
super
.
containsError
(
checkIdentifier
);
if
(
hasError
)
{
return
true
;
}
for
(
Opening
o
:
openings
)
{
if
(
o
.
containsError
(
checkIdentifier
))
{
return
true
;
}
}
return
false
;
}
@Override
public
void
accept
(
Check
c
)
{
public
void
accept
(
CheckableVisitor
c
)
{
super
.
accept
(
c
);
if
(
c
.
canExecute
(
this
))
{
c
.
check
(
this
);
...
...
@@ -201,10 +170,6 @@ public class BoundarySurface extends CityObject {
gmlObject
.
setLod2MultiSurface
(
null
);
gmlObject
.
setLod3MultiSurface
(
null
);
gmlObject
.
getDeprecatedProperties
().
setLod4MultiSurface
(
null
);
for
(
Opening
o
:
openings
)
{
o
.
unsetGmlGeometries
();
}
}
@Override
...
...
@@ -244,48 +209,4 @@ public class BoundarySurface extends CityObject {
openings
.
add
(
opening
);
opening
.
setPartOfSurface
(
this
);
}
@Override
public
void
prepareForChecking
()
{
super
.
prepareForChecking
();
for
(
Opening
o
:
openings
)
{
o
.
prepareForChecking
();
}
}
@Override
public
void
clearMetaInformation
()
{
super
.
clearMetaInformation
();
for
(
Opening
o
:
openings
)
{
o
.
clearMetaInformation
();
}
}
@Override
public
Copyable
createCopyInstance
()
{
return
new
BoundarySurface
(
gmlObject
);
}
@Override
public
void
collectInstances
(
CopyHandler
handler
)
{
super
.
collectInstances
(
handler
);
for
(
Opening
o
:
openings
)
{
handler
.
addInstance
(
o
);
}
handler
.
addInstance
(
parent
);
}
@Override
public
void
fillValues
(
Copyable
original
,
CopyHandler
handler
)
{
super
.
fillValues
(
original
,
handler
);
BoundarySurface
originalBs
=
(
BoundarySurface
)
original
;
featureType
=
originalBs
.
featureType
;
type
=
originalBs
.
type
;
for
(
Opening
originalOpening
:
originalBs
.
openings
)
{
openings
.
add
(
handler
.
getCopyInstance
(
originalOpening
));
}
parent
=
handler
.
getCopyInstance
(
originalBs
.
parent
);
gmlObject
=
originalBs
.
gmlObject
;
}
}
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/datastructure/BridgeConstructiveElement.java
View file @
d1ff5020
...
...
@@ -18,13 +18,10 @@
*/
package
de.hft.stuttgart.citydoctor2.datastructure
;
import
de.hft.stuttgart.citydoctor2.check.Check
;
import
de.hft.stuttgart.citydoctor2.check.CheckError
;
import
de.hft.stuttgart.citydoctor2.check.CheckId
;
import
de.hft.stuttgart.citydoctor2.check.CheckableVisitor
;
import
de.hft.stuttgart.citydoctor2.parser.ParserConfiguration
;
import
de.hft.stuttgart.citydoctor2.utils.CityGmlUtils
;
import
de.hft.stuttgart.citydoctor2.utils.CopyHandler
;
import
de.hft.stuttgart.citydoctor2.utils.Copyable
;
import
javafx.scene.paint.Color
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
import
org.citygml4j.core.model.core.AbstractSpaceBoundaryProperty
;
...
...
@@ -66,14 +63,13 @@ public class BridgeConstructiveElement extends CityObject {
return
parent
;
}
@Override
public
Co
pyable
createCopyInstance
()
{
return
new
BridgeConstructiveElement
(
gmlBridgeElement
);
public
Co
lor
getRenderColor
()
{
return
parent
.
getRenderColor
().
brighter
(
);
}
@Override
public
void
re
Create
Geometries
(
GeometryFactory
factory
,
ParserConfiguration
config
)
{
public
void
re
build
Geometries
(
GeometryFactory
factory
,
ParserConfiguration
config
)
{
// only handles CityGML2 for now
// unknown which CityGML is handled here
// need context information to decide
...
...
@@ -96,13 +92,10 @@ public class BridgeConstructiveElement extends CityObject {
break
;
}
}
for
(
BoundarySurface
bs
:
boundarySurfaceList
)
{
reCreateBoundarySurface
(
factory
,
config
,
bs
);
}
}
@Override
public
void
accept
(
Check
c
)
{
public
void
accept
(
Check
ableVisitor
c
)
{
super
.
accept
(
c
);
if
(
c
.
canExecute
(
this
))
{
c
.
check
(
this
);
...
...
@@ -112,50 +105,6 @@ public class BridgeConstructiveElement extends CityObject {
}
}
@Override
public
void
collectContainedErrors
(
List
<
CheckError
>
errors
)
{
super
.
collectContainedErrors
(
errors
);
for
(
BoundarySurface
bs
:
boundarySurfaceList
)
{
bs
.
collectContainedErrors
(
errors
);
}
}
@Override
public
void
clearAllContainedCheckResults
()
{
super
.
clearAllContainedCheckResults
();
for
(
BoundarySurface
bs
:
boundarySurfaceList
)
{
bs
.
clearAllContainedCheckResults
();
}
}
@Override
public
boolean
containsError
(
CheckId
checkIdentifier
)
{
boolean
hasError
=
super
.
containsError
(
checkIdentifier
);
if
(
hasError
)
{
return
true
;
}
for
(
BoundarySurface
bs
:
boundarySurfaceList
)
{
if
(
bs
.
containsError
(
checkIdentifier
))
{
return
true
;
}
}
return
false
;
}
@Override
public
boolean
containsAnyError
()
{
boolean
hasError
=
super
.
containsAnyError
();
if
(
hasError
)
{
return
true
;
}
for
(
BoundarySurface
bs
:
boundarySurfaceList
)
{
if
(
bs
.
containsAnyError
())
{
return
true
;
}
}
return
false
;
}
private
void
reCreateBoundarySurface
(
GeometryFactory
factory
,
ParserConfiguration
config
,
BoundarySurface
bs
)
{
if
(
bs
.
getGeometries
().
isEmpty
())
{
for
(
AbstractSpaceBoundaryProperty
bsp
:
gmlBridgeElement
.
getBoundaries
())
{
...
...
@@ -248,9 +197,6 @@ public class BridgeConstructiveElement extends CityObject {
gmlBridgeElement
.
setLod1Solid
(
null
);
gmlBridgeElement
.
setLod2Solid
(
null
);
gmlBridgeElement
.
setLod3Solid
(
null
);
for
(
BoundarySurface
bs
:
boundarySurfaceList
)
{
bs
.
unsetGmlGeometries
();
}
}
@Override
...
...
@@ -272,35 +218,4 @@ public class BridgeConstructiveElement extends CityObject {
return
boundarySurfaceList
;
}
@Override
public
void
prepareForChecking
()
{
super
.
prepareForChecking
();
for
(
BoundarySurface
bs
:
boundarySurfaceList
)
{
bs
.
prepareForChecking
();
}
}
@Override
public
void
clearMetaInformation
()
{
super
.
clearMetaInformation
();
for
(
BoundarySurface
bs
:
boundarySurfaceList
)
{
bs
.
clearMetaInformation
();
}
}
@Override
public
void
collectInstances
(
CopyHandler
handler
)
{
super
.
collectInstances
(
handler
);
handler
.
addInstance
(
boundarySurfaceList
);
}
@Override
public
void
fillValues
(
Copyable
original
,
CopyHandler
handler
)
{
super
.
fillValues
(
original
,
handler
);
BridgeConstructiveElement
originalBce
=
(
BridgeConstructiveElement
)
original
;
for
(
BoundarySurface
originalBs
:
originalBce
.
boundarySurfaceList
)
{
boundarySurfaceList
.
add
(
handler
.
getCopyInstance
(
originalBs
));
}
}
}
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/datastructure/BridgeObject.java
View file @
d1ff5020
...
...
@@ -18,13 +18,12 @@
*/
package
de.hft.stuttgart.citydoctor2.datastructure
;
import
de.hft.stuttgart.citydoctor2.check.Check
;
import
de.hft.stuttgart.citydoctor2.check.CheckError
;
import
de.hft.stuttgart.citydoctor2.check.CheckId
;
import
de.hft.stuttgart.citydoctor2.check.CheckableVisitor
;
import
de.hft.stuttgart.citydoctor2.parser.ParserConfiguration
;
import
de.hft.stuttgart.citydoctor2.utils.CityGmlUtils
;
import
de.hft.stuttgart.citydoctor2.utils.CopyHandler
;
import
de.hft.stuttgart.citydoctor2.utils.Copyable
;
import
javafx.scene.paint.Color
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
import
org.citygml4j.core.model.bridge.AbstractBridge
;
import
org.citygml4j.core.model.bridge.BridgeInstallation
;
import
org.citygml4j.core.model.bridge.BridgeInstallationProperty
;
...
...
@@ -48,6 +47,9 @@ public class BridgeObject extends CityObject {
@Serial
private
static
final
long
serialVersionUID
=
6301112640328373842L
;
private
static
final
Logger
logger
=
LogManager
.
getLogger
(
BridgeObject
.
class
);
private
final
List
<
BridgeObject
>
parts
=
new
ArrayList
<>(
2
);
private
final
List
<
BridgeConstructiveElement
>
elements
=
new
ArrayList
<>(
2
);
private
final
List
<
BoundarySurface
>
boundarySurfaces
=
new
ArrayList
<>(
2
);
...
...
@@ -98,7 +100,12 @@ public class BridgeObject extends CityObject {
}
@Override
public
void
reCreateGeometries
(
GeometryFactory
factory
,
ParserConfiguration
config
)
{
public
Color
getRenderColor
()
{
return
Color
.
LIGHTSTEELBLUE
;
}
@Override
public
void
rebuildGeometries
(
GeometryFactory
factory
,
ParserConfiguration
config
)
{
for
(
Geometry
geom
:
getGeometries
())
{
if
(
geom
instanceof
ImplicitGeometryHolder
)
{
continue
;
...
...
@@ -111,29 +118,28 @@ public class BridgeObject extends CityObject {
setSolidAccordingToLod
(
geom
,
solid
);
}
}
removeEmptyBoundarySurfaces
();
}
private
void
removeEmptyBoundarySurfaces
()
{
for
(
BoundarySurface
bs
:
boundarySurfaces
)
{
bs
.
reCreateGeometries
(
factory
,
config
);
}
for
(
Installation
bi
:
bridgeInstallations
)
{
bi
.
reCreateGeometries
(
factory
,
config
);
}
for
(
BridgeObject
part
:
parts
)
{
part
.
reCreateGeometries
(
factory
,
config
);
}
for
(
BridgeConstructiveElement
ele
:
elements
)
{
ele
.
reCreateGeometries
(
factory
,
config
);
}
for
(
BridgeRoom
br
:
bridgeRooms
)
{
br
.
reCreateGeometries
(
factory
,
config
);
}
for
(
BridgeRoomFurniture
bri
:
bridgeFurniture
)
{
bri
.
reCreateGeometries
(
factory
,
config
);
if
(
bs
.
getGeometries
().
isEmpty
())
{
for
(
AbstractSpaceBoundaryProperty
bsp
:
ab
.
getBoundaries
())
{
if
(
bsp
.
getObject
()
!=
null
&&
bsp
.
getObject
()
==
bs
.
getGmlObject
())
{
logger
.
warn
(
"Found empty boundary surface: {}, removing from bridge"
,
bs
.
getGmlId
());
ab
.
getBoundaries
().
remove
(
bsp
);
break
;
}
}
}
}
}
private
void
setMultiSurfaceAccordingToLod
(
Geometry
geom
,
MultiSurface
ms
)
{
switch
(
geom
.
getLod
())
{
case
LOD0:
ab
.
setLod0MultiSurface
(
new
MultiSurfaceProperty
(
ms
));
break
;
case
LOD1:
ab
.
getDeprecatedProperties
().
setLod1MultiSurface
(
new
MultiSurfaceProperty
(
ms
));
break
;
...
...
@@ -185,148 +191,7 @@ public class BridgeObject extends CityObject {
}
@Override
public
void
clearAllContainedCheckResults
()
{
super
.
clearAllContainedCheckResults
();
for
(
BoundarySurface
bs
:
boundarySurfaces
)
{
bs
.
clearAllContainedCheckResults
();
}
for
(
Installation
bi
:
bridgeInstallations
)
{
bi
.
clearAllContainedCheckResults
();
}
for
(
BridgeObject
part
:
parts
)
{
part
.
clearAllContainedCheckResults
();
}
for
(
BridgeConstructiveElement
ele
:
elements
)
{
ele
.
clearAllContainedCheckResults
();
}
for
(
BridgeRoom
br
:
bridgeRooms
)
{
br
.
clearAllContainedCheckResults
();
}
for
(
BridgeRoomFurniture
bri
:
bridgeFurniture
)
{
bri
.
clearAllContainedCheckResults
();
}
}
@Override
public
void
collectContainedErrors
(
List
<
CheckError
>
errors
)
{
super
.
collectContainedErrors
(
errors
);
for
(
BoundarySurface
bs
:
boundarySurfaces
)
{
bs
.
collectContainedErrors
(
errors
);
}
for
(
Installation
bi
:
bridgeInstallations
)
{
bi
.
collectContainedErrors
(
errors
);
}
for
(
BridgeObject
part
:
parts
)
{
part
.
collectContainedErrors
(
errors
);
}
for
(
BridgeConstructiveElement
ele
:
elements
)
{
ele
.
collectContainedErrors
(
errors
);
}
for
(
BridgeRoom
br
:
bridgeRooms
)
{
br
.
collectContainedErrors
(
errors
);
}
for
(
BridgeRoomFurniture
bri
:
bridgeFurniture
)
{
bri
.
collectContainedErrors
(
errors
);
}
}
@Override
public
boolean
containsAnyError
()
{
boolean
hasError
=
super
.
containsAnyError
();
if
(
hasError
)
{
return
true
;
}
for
(
Installation
bi
:
bridgeInstallations
)
{
if
(
bi
.
containsAnyError
())
{
return
true
;
}
}
for
(
BoundarySurface
bs
:
boundarySurfaces
)
{
if
(
bs
.
containsAnyError
())
{
return
true
;
}
}
if
(
doPartsContainAnyError
())
{
return
true
;
}
for
(
BridgeConstructiveElement
ele
:
elements
)
{
if
(
ele
.
containsAnyError
())
{
return
true
;
}
}
for
(
BridgeRoom
br
:
bridgeRooms
)
{
if
(
br
.
containsAnyError
())
{
return
true
;
}
}
for
(
BridgeRoomFurniture
bri
:
bridgeFurniture
)
{
if
(
bri
.
containsAnyError
())
{
return
true
;
}
}
return
false
;
}
private
boolean
doPartsContainAnyError
()
{
for
(
BridgeObject
part
:
parts
)
{
if
(
part
.
containsAnyError
())
{
return
true
;
}
}
return
false
;
}
@Override
public
boolean
containsError
(
CheckId
checkIdentifier
)
{
boolean
hasError
=
super
.
containsError
(
checkIdentifier
);
if
(
hasError
)
{
return
true
;
}
for
(
Installation
bi
:
bridgeInstallations
)
{
if
(
bi
.
containsError
(
checkIdentifier
))
{
return
true
;
}
}
for
(
BoundarySurface
bs
:
boundarySurfaces
)
{
if
(
bs
.
containsError
(
checkIdentifier
))
{
return
true
;
}
}
if
(
doPartsContainError
(
checkIdentifier
))
{
return
true
;
}
for
(
BridgeConstructiveElement
ele
:
elements
)
{
if
(
ele
.
containsError
(
checkIdentifier
))
{
return
true
;
}
}
for
(
BridgeRoom
br
:
bridgeRooms
)
{
if
(
br
.
containsError
(
checkIdentifier
))
{
return
true
;
}
}
for
(
BridgeRoomFurniture
bri
:
bridgeFurniture
)
{
if
(
bri
.
containsError
(
checkIdentifier
))
{
return
true
;
}
}
return
false
;
}
private
boolean
doPartsContainError
(
CheckId
checkIdentifier
)
{
for
(
BridgeObject
part
:
parts
)
{
if
(
part
.
containsError
(
checkIdentifier
))
{
return
true
;
}
}
return
false
;
}
@Override
public
void
accept
(
Check
c
)
{
public
void
accept
(
CheckableVisitor
c
)
{
super
.
accept
(
c
);
if
(
c
.
canExecute
(
this
))
{
c
.
check
(
this
);
...
...
@@ -389,29 +254,12 @@ public class BridgeObject extends CityObject {
ab
.
setLod1Solid
(
null
);
ab
.
setLod2Solid
(
null
);
ab
.
setLod3Solid
(
null
);
ab
.
getDeprecatedProperties
().
setLod4Solid
(
null
);
ab
.
setLod0MultiSurface
(
null
);
ab
.
getDeprecatedProperties
().
setLod1MultiSurface
(
null
);
ab
.
setLod2MultiSurface
(
null
);
ab
.
setLod3MultiSurface
(
null
);
ab
.
getDeprecatedProperties
().
setLod1MultiSurface
(
null
);
ab
.
getDeprecatedProperties
().
setLod4MultiSurface
(
null
);
ab
.
getDeprecatedProperties
().
setLod4Solid
(
null
);
for
(
BoundarySurface
bs
:
boundarySurfaces
)
{
bs
.
unsetGmlGeometries
();
}
for
(
Installation
bi
:
bridgeInstallations
)
{
bi
.
unsetGmlGeometries
();
}
for
(
BridgeObject
part
:
parts
)
{
part
.
unsetGmlGeometries
();
}
for
(
BridgeConstructiveElement
ele
:
elements
)
{
ele
.
unsetGmlGeometries
();
}
for
(
BridgeRoom
br
:
bridgeRooms
)
{
br
.
unsetGmlGeometries
();
}
for
(
BridgeRoomFurniture
bri
:
bridgeFurniture
)
{
bri
.
unsetGmlGeometries
();
}
}
...
...
@@ -428,89 +276,6 @@ public class BridgeObject extends CityObject {
return
"BridgeObject [type="
+
type
+
", id="
+
getGmlId
()
+
"]"
;
}
@Override
public
void
prepareForChecking
()
{
super
.
prepareForChecking
();
for
(
BridgeConstructiveElement
e
:
elements
)
{
e
.
prepareForChecking
();
}
for
(
BridgeObject
part
:
parts
)
{
part
.
prepareForChecking
();
}
for
(
BoundarySurface
bs
:
boundarySurfaces
)
{
bs
.
prepareForChecking
();
}
for
(
Installation
bi
:
bridgeInstallations
)
{
bi
.
prepareForChecking
();
}
for
(
BridgeObject
part
:
parts
)
{
part
.
prepareForChecking
();
}
for
(
BridgeRoom
br
:
bridgeRooms
)
{
br
.
prepareForChecking
();
}
for
(
BridgeRoomFurniture
bri
:
bridgeFurniture
)
{
bri
.
prepareForChecking
();
}
}
@Override
public
void
clearMetaInformation
()
{
super
.
clearMetaInformation
();
for
(
BoundarySurface
bs
:
boundarySurfaces
)
{
bs
.
clearMetaInformation
();
}
for
(
Installation
bi
:
bridgeInstallations
)
{
bi
.
clearMetaInformation
();
}
for
(
BridgeObject
part
:
parts
)
{
part
.
clearMetaInformation
();
}
for
(
BridgeConstructiveElement
ele
:
elements
)
{
ele
.
clearMetaInformation
();
}
for
(
BridgeRoom
br
:
bridgeRooms
)
{
br
.
clearMetaInformation
();
}
for
(
BridgeRoomFurniture
bri
:
bridgeFurniture
)
{
bri
.
clearMetaInformation
();
}
}
@Override
public
void
collectInstances
(
CopyHandler
handler
)
{
super
.
collectInstances
(
handler
);
for
(
BoundarySurface
bs
:
boundarySurfaces
)
{
handler
.
addInstance
(
bs
);
}
for
(
Installation
bi
:
bridgeInstallations
)
{
handler
.
addInstance
(
bi
);
}
for
(
BridgeObject
part
:
parts
)
{
handler
.
addInstance
(
part
);
}
for
(
BridgeConstructiveElement
ele
:
elements
)
{
handler
.
addInstance
(
ele
);
}
for
(
BridgeRoom
br
:
bridgeRooms
)
{
handler
.
addInstance
(
br
);
}
for
(
BridgeRoomFurniture
bri
:
bridgeFurniture
)
{
handler
.
addInstance
(
bri
);
}
}
public
void
anonymize
()
{
for
(
Geometry
geom
:
getGeometries
())
{
...
...
@@ -529,36 +294,6 @@ public class BridgeObject extends CityObject {
this
.
ab
=
gmlB
;
}
@Override
public
void
fillValues
(
Copyable
original
,
CopyHandler
handler
)
{
super
.
fillValues
(
original
,
handler
);
BridgeObject
originalBo
=
(
BridgeObject
)
original
;
for
(
BoundarySurface
originalBs
:
originalBo
.
boundarySurfaces
)
{
boundarySurfaces
.
add
(
handler
.
getCopyInstance
(
originalBs
));
}
for
(
Installation
originalBi
:
originalBo
.
bridgeInstallations
)
{
bridgeInstallations
.
add
(
handler
.
getCopyInstance
(
originalBi
));
}
for
(
BridgeObject
part
:
originalBo
.
parts
)
{
getParts
().
add
(
handler
.
getCopyInstance
(
part
));
}
for
(
BridgeConstructiveElement
ele
:
originalBo
.
elements
)
{
getConstructiveElements
().
add
(
handler
.
getCopyInstance
(
ele
));
}
for
(
BridgeRoom
br
:
originalBo
.
bridgeRooms
)
{
getBridgeRooms
().
add
(
handler
.
getCopyInstance
(
br
));
}
for
(
BridgeRoomFurniture
bri
:
originalBo
.
bridgeFurniture
)
{
getBridgeFurniture
().
add
(
handler
.
getCopyInstance
(
bri
));
}
}
public
List
<
BoundarySurface
>
getBoundarySurfaces
()
{
return
boundarySurfaces
;
}
...
...
@@ -568,11 +303,6 @@ public class BridgeObject extends CityObject {
element
.
setParent
(
this
);
}
@Override
public
Copyable
createCopyInstance
()
{
return
new
BridgeObject
(
type
,
ab
,
parent
);
}
public
List
<
BridgeObject
>
getParts
()
{
return
parts
;
}
...
...
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/datastructure/BridgeRoom.java
View file @
d1ff5020
package
de.hft.stuttgart.citydoctor2.datastructure
;
import
de.hft.stuttgart.citydoctor2.utils.CopyHandler
;
import
de.hft.stuttgart.citydoctor2.utils.Copyable
;
import
javafx.scene.paint.Color
;
import
java.io.Serial
;
...
...
@@ -30,26 +29,14 @@ public class BridgeRoom extends AbstractRoom {
return
parent
;
}
@Override
public
void
fillValues
(
Copyable
original
,
CopyHandler
handler
)
{
super
.
fillValues
(
original
,
handler
);
BridgeRoom
oRoom
=
(
BridgeRoom
)
original
;
parent
=
handler
.
getCopyInstance
(
oRoom
.
getParent
());
}
@Override
public
CityObject
getTopLevelCityObject
()
{
return
getParen
t
();
return
parent
.
getTopLevelCityObjec
t
();
}
@Override
public
void
collectInstances
(
CopyHandler
handler
)
{
super
.
collectInstances
(
handler
);
handler
.
addInstance
(
parent
);
public
Color
getRenderColor
()
{
return
parent
.
getRenderColor
();
}
@Override
public
Copyable
createCopyInstance
()
{
return
new
BridgeRoom
();
}
}
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/datastructure/BridgeRoomFurniture.java
View file @
d1ff5020
package
de.hft.stuttgart.citydoctor2.datastructure
;
import
de.hft.stuttgart.citydoctor2.utils.Copyable
;
import
org.citygml4j.core.model.bridge.BridgeFurniture
;
import
java.io.Serial
;
...
...
@@ -13,9 +12,4 @@ public class BridgeRoomFurniture extends AbstractFurniture {
public
void
setGmlObject
(
BridgeFurniture
gmlObject
)
{
super
.
setGmlObject
(
gmlObject
);
}
@Override
public
Copyable
createCopyInstance
()
{
return
new
BridgeRoomFurniture
();
}
}
Prev
1
2
3
4
5
…
9
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment