Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
CityDoctor
CityDoctor2
Compare Revisions
7ebb95c10f965c4e941e72bac9cda729ae8e6215...fcd48bc190a008af93ba799a54fd2d10ca9f2a1f
Commits (2)
add more bridge elements support
· fcafb694
Matthias Betz
authored
Jun 02, 2023
fcafb694
Merge branch 'dev'
· fcd48bc1
Matthias Betz
authored
Jun 02, 2023
fcd48bc1
Hide whitespace changes
Inline
Side-by-side
CityDoctorParent/CityDoctorCheckResult/pom.xml
View file @
fcd48bc1
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"https://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<?xml version="1.0" encoding="utf-8"?>
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"https://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<modelVersion>
4.0.0
</modelVersion>
<parent>
<groupId>
de.hft.stuttgart
</groupId>
<artifactId>
CityDoctorParent
</artifactId>
<version>
3.13.
0
</version>
<version>
3.13.
1
</version>
</parent>
<artifactId>
CityDoctorCheckResult
</artifactId>
<dependencies>
<!-- https://mvnrepository.com/artifact/junit/junit -->
<dependency>
<groupId>
junit
</groupId>
<artifactId>
junit
</artifactId>
...
...
CityDoctorParent/CityDoctorEdge/pom.xml
View file @
fcd48bc1
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"https://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<?xml version="1.0" encoding="utf-8"?>
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"https://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<modelVersion>
4.0.0
</modelVersion>
<parent>
<groupId>
de.hft.stuttgart
</groupId>
<artifactId>
CityDoctorParent
</artifactId>
<version>
3.13.
0
</version>
<version>
3.13.
1
</version>
</parent>
<artifactId>
CityDoctorEdge
</artifactId>
<dependencies>
<dependency>
<groupId>
org.apache.logging.log4j
</groupId>
...
...
@@ -29,7 +27,6 @@
<scope>
test
</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
...
...
CityDoctorParent/CityDoctorModel/pom.xml
View file @
fcd48bc1
<?xml version="1.0" encoding="utf-8"?>
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"https://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<modelVersion>
4.0.0
</modelVersion>
<parent>
<groupId>
de.hft.stuttgart
</groupId>
<artifactId>
CityDoctorParent
</artifactId>
<version>
3.13.
0
</version>
<version>
3.13.
1
</version>
</parent>
<properties>
<versionString>
${project.version}-${git.commit.id.abbrev}
</versionString>
</properties>
<artifactId>
CityDoctorModel
</artifactId>
<name>
CityDoctorModel
</name>
<dependencies>
...
...
@@ -60,7 +59,6 @@
<artifactId>
proj4j
</artifactId>
</dependency>
</dependencies>
<build>
<resources>
<resource>
...
...
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/check/Check.java
View file @
fcd48bc1
...
...
@@ -30,7 +30,7 @@ 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.
Building
Installation
;
import
de.hft.stuttgart.citydoctor2.datastructure.Installation
;
import
de.hft.stuttgart.citydoctor2.datastructure.BuildingPart
;
import
de.hft.stuttgart.citydoctor2.datastructure.CityObject
;
import
de.hft.stuttgart.citydoctor2.datastructure.Geometry
;
...
...
@@ -211,7 +211,7 @@ public abstract class Check {
*
* @param bi a building installation
*/
public
void
check
(
Building
Installation
bi
)
{
public
void
check
(
Installation
bi
)
{
}
...
...
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/datastructure/AbstractBuilding.java
View file @
fcd48bc1
...
...
@@ -51,7 +51,7 @@ public abstract class AbstractBuilding extends CityObject {
private
static
final
Logger
logger
=
LogManager
.
getLogger
(
AbstractBuilding
.
class
);
private
List
<
Building
Installation
>
buildingInstallations
=
new
ArrayList
<>(
2
);
private
List
<
Installation
>
buildingInstallations
=
new
ArrayList
<>(
2
);
private
List
<
BoundarySurface
>
boundarySurfaceList
=
new
ArrayList
<>();
private
org
.
citygml4j
.
core
.
model
.
building
.
AbstractBuilding
ab
;
...
...
@@ -89,7 +89,7 @@ public abstract class AbstractBuilding extends CityObject {
for
(
BoundarySurface
bs
:
boundarySurfaceList
)
{
bs
.
unsetGmlGeometries
();
}
for
(
Building
Installation
bi
:
buildingInstallations
)
{
for
(
Installation
bi
:
buildingInstallations
)
{
bi
.
unsetGmlGeometries
();
}
}
...
...
@@ -108,7 +108,7 @@ public abstract class AbstractBuilding extends CityObject {
for
(
BoundarySurface
bs
:
boundarySurfaceList
)
{
reCreateBoundarySurface
(
factory
,
config
,
bs
);
}
for
(
Building
Installation
bi
:
buildingInstallations
)
{
for
(
Installation
bi
:
buildingInstallations
)
{
bi
.
reCreateGeometries
(
factory
,
config
);
}
}
...
...
@@ -174,7 +174,7 @@ public abstract class AbstractBuilding extends CityObject {
if
(
c
.
canExecute
(
this
))
{
c
.
check
(
this
);
}
for
(
Building
Installation
bi
:
buildingInstallations
)
{
for
(
Installation
bi
:
buildingInstallations
)
{
bi
.
accept
(
c
);
}
for
(
BoundarySurface
bs
:
boundarySurfaceList
)
{
...
...
@@ -185,7 +185,7 @@ public abstract class AbstractBuilding extends CityObject {
@Override
public
void
collectContainedErrors
(
List
<
CheckError
>
errors
)
{
super
.
collectContainedErrors
(
errors
);
for
(
Building
Installation
bi
:
buildingInstallations
)
{
for
(
Installation
bi
:
buildingInstallations
)
{
bi
.
collectContainedErrors
(
errors
);
}
for
(
BoundarySurface
bs
:
boundarySurfaceList
)
{
...
...
@@ -196,7 +196,7 @@ public abstract class AbstractBuilding extends CityObject {
@Override
public
void
clearAllContainedCheckResults
()
{
super
.
clearAllContainedCheckResults
();
for
(
Building
Installation
bi
:
buildingInstallations
)
{
for
(
Installation
bi
:
buildingInstallations
)
{
bi
.
clearAllContainedCheckResults
();
}
for
(
BoundarySurface
bs
:
boundarySurfaceList
)
{
...
...
@@ -210,7 +210,7 @@ public abstract class AbstractBuilding extends CityObject {
if
(
hasError
)
{
return
true
;
}
for
(
Building
Installation
bi
:
buildingInstallations
)
{
for
(
Installation
bi
:
buildingInstallations
)
{
if
(
bi
.
containsError
(
checkIdentifier
))
{
return
true
;
}
...
...
@@ -229,7 +229,7 @@ public abstract class AbstractBuilding extends CityObject {
if
(
hasError
)
{
return
true
;
}
for
(
Building
Installation
bi
:
buildingInstallations
)
{
for
(
Installation
bi
:
buildingInstallations
)
{
if
(
bi
.
containsAnyError
())
{
return
true
;
}
...
...
@@ -251,7 +251,7 @@ public abstract class AbstractBuilding extends CityObject {
bs
.
setParent
(
this
);
}
public
void
addBuildingInstallation
(
Building
Installation
coBi
)
{
public
void
addBuildingInstallation
(
Installation
coBi
)
{
buildingInstallations
.
add
(
coBi
);
coBi
.
setParent
(
this
);
}
...
...
@@ -260,14 +260,14 @@ public abstract class AbstractBuilding extends CityObject {
this
.
ab
=
ab
;
}
public
List
<
Building
Installation
>
getBuildingInstallations
()
{
public
List
<
Installation
>
getBuildingInstallations
()
{
return
buildingInstallations
;
}
@Override
public
void
prepareForChecking
()
{
super
.
prepareForChecking
();
for
(
Building
Installation
bi
:
buildingInstallations
)
{
for
(
Installation
bi
:
buildingInstallations
)
{
bi
.
prepareForChecking
();
}
for
(
BoundarySurface
bs
:
boundarySurfaceList
)
{
...
...
@@ -278,7 +278,7 @@ public abstract class AbstractBuilding extends CityObject {
@Override
public
void
clearMetaInformation
()
{
super
.
clearMetaInformation
();
for
(
Building
Installation
bi
:
buildingInstallations
)
{
for
(
Installation
bi
:
buildingInstallations
)
{
bi
.
clearMetaInformation
();
}
for
(
BoundarySurface
bs
:
boundarySurfaceList
)
{
...
...
@@ -300,7 +300,7 @@ public abstract class AbstractBuilding extends CityObject {
for
(
BoundarySurface
originalBs
:
originalAb
.
boundarySurfaceList
)
{
boundarySurfaceList
.
add
(
handler
.
getCopyInstance
(
originalBs
));
}
for
(
Building
Installation
originalBi
:
originalAb
.
buildingInstallations
)
{
for
(
Installation
originalBi
:
originalAb
.
buildingInstallations
)
{
buildingInstallations
.
add
(
handler
.
getCopyInstance
(
originalBi
));
}
ab
=
originalAb
.
ab
;
...
...
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/datastructure/BridgeConstructiveElement.java
View file @
fcd48bc1
...
...
@@ -18,6 +18,12 @@
*/
package
de.hft.stuttgart.citydoctor2.datastructure
;
import
java.util.ArrayList
;
import
java.util.List
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
import
org.citygml4j.core.model.core.AbstractSpaceBoundaryProperty
;
import
org.citygml4j.core.model.deprecated.bridge.DeprecatedPropertiesOfBridgeConstructiveElement
;
import
org.citygml4j.core.util.geometry.GeometryFactory
;
import
org.xmlobjects.gml.model.geometry.GeometryProperty
;
...
...
@@ -27,17 +33,25 @@ import org.xmlobjects.gml.model.geometry.complexes.CompositeSurface;
import
org.xmlobjects.gml.model.geometry.primitives.Solid
;
import
org.xmlobjects.gml.model.geometry.primitives.SolidProperty
;
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.parser.ParserConfiguration
;
import
de.hft.stuttgart.citydoctor2.utils.CityGmlUtils
;
import
de.hft.stuttgart.citydoctor2.utils.CopyHandler
;
import
de.hft.stuttgart.citydoctor2.utils.Copyable
;
public
class
BridgeConstructiveElement
extends
CityObject
{
private
static
final
Logger
logger
=
LogManager
.
getLogger
(
BridgeConstructiveElement
.
class
);
private
static
final
String
CANNOT_ADD
=
"Cannot add "
;
private
static
final
long
serialVersionUID
=
7353233899458901155L
;
private
org
.
citygml4j
.
core
.
model
.
bridge
.
BridgeConstructiveElement
gmlBridgeElement
;
private
List
<
BoundarySurface
>
boundarySurfaceList
=
new
ArrayList
<>();
public
BridgeConstructiveElement
(
org
.
citygml4j
.
core
.
model
.
bridge
.
BridgeConstructiveElement
gmlObject
)
{
this
.
gmlBridgeElement
=
gmlObject
;
...
...
@@ -69,6 +83,78 @@ public class BridgeConstructiveElement extends CityObject {
break
;
}
}
for
(
BoundarySurface
bs
:
boundarySurfaceList
)
{
reCreateBoundarySurface
(
factory
,
config
,
bs
);
}
}
@Override
public
void
accept
(
Check
c
)
{
super
.
accept
(
c
);
if
(
c
.
canExecute
(
this
))
{
c
.
check
(
this
);
}
for
(
BoundarySurface
bs
:
boundarySurfaceList
)
{
bs
.
accept
(
c
);
}
}
@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
())
{
if
(
bsp
.
getObject
()
!=
null
&&
bsp
.
getObject
()
==
bs
.
getGmlObject
())
{
logger
.
warn
(
"Found empty boundary surface: {}, removing from BridgeConstructiveElement"
,
bs
.
getGmlId
());
gmlBridgeElement
.
getBoundaries
().
remove
(
bsp
);
break
;
}
}
return
;
}
bs
.
reCreateGeometries
(
factory
,
config
);
}
private
void
setCompositeSurfaceAccordingToLod
(
Geometry
geom
,
CompositeSurface
cs
)
{
...
...
@@ -149,6 +235,9 @@ public class BridgeConstructiveElement extends CityObject {
gmlBridgeElement
.
setLod1Solid
(
null
);
gmlBridgeElement
.
setLod2Solid
(
null
);
gmlBridgeElement
.
setLod3Solid
(
null
);
for
(
BoundarySurface
bs
:
boundarySurfaceList
)
{
bs
.
unsetGmlGeometries
();
}
}
@Override
...
...
@@ -156,4 +245,44 @@ public class BridgeConstructiveElement extends CityObject {
return
FeatureType
.
BRIDGE_CONSTRUCTION_ELEMENT
;
}
public
void
addBoundarySurface
(
BoundarySurface
bs
)
{
boundarySurfaceList
.
add
(
bs
);
bs
.
setParent
(
this
);
}
public
List
<
BoundarySurface
>
getBoundarySurfaces
()
{
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 @
fcd48bc1
...
...
@@ -22,6 +22,9 @@ import java.util.ArrayList;
import
java.util.List
;
import
org.citygml4j.core.model.bridge.AbstractBridge
;
import
org.citygml4j.core.model.bridge.BridgeInstallation
;
import
org.citygml4j.core.model.bridge.BridgeInstallationProperty
;
import
org.citygml4j.core.model.core.AbstractSpaceBoundaryProperty
;
import
org.citygml4j.core.util.geometry.GeometryFactory
;
import
org.xmlobjects.gml.model.geometry.aggregates.MultiSurface
;
import
org.xmlobjects.gml.model.geometry.aggregates.MultiSurfaceProperty
;
...
...
@@ -54,9 +57,10 @@ public class BridgeObject extends CityObject {
private
BridgeType
type
;
private
List
<
BridgeObject
>
parts
=
null
;
private
List
<
BridgeConstructiveElement
>
elements
=
null
;
private
List
<
BoundarySurface
>
boundarySurfaces
=
new
ArrayList
<>(
2
);
private
List
<
Installation
>
bridgeInstallations
=
new
ArrayList
<>(
2
);
public
BridgeObject
(
BridgeType
type
,
AbstractBridge
ab
)
{
this
.
ab
=
ab
;
...
...
@@ -74,6 +78,10 @@ public class BridgeObject extends CityObject {
}
return
elements
;
}
public
List
<
Installation
>
getBridgeInstallations
()
{
return
bridgeInstallations
;
}
@Override
public
void
reCreateGeometries
(
GeometryFactory
factory
,
ParserConfiguration
config
)
{
...
...
@@ -89,6 +97,9 @@ public class BridgeObject extends CityObject {
for
(
BoundarySurface
bs
:
boundarySurfaces
)
{
bs
.
reCreateGeometries
(
factory
,
config
);
}
for
(
Installation
bi
:
bridgeInstallations
)
{
bi
.
reCreateGeometries
(
factory
,
config
);
}
if
(
parts
!=
null
)
{
for
(
BridgeObject
part
:
parts
)
{
part
.
reCreateGeometries
(
factory
,
config
);
...
...
@@ -138,6 +149,11 @@ public class BridgeObject extends CityObject {
throw
new
IllegalStateException
(
"Cannot add "
+
geom
.
getLod
()
+
" solid to bridges"
);
}
}
public
void
addBridgeInstallation
(
Installation
coBi
)
{
bridgeInstallations
.
add
(
coBi
);
coBi
.
setParent
(
this
);
}
@Override
public
void
clearAllContainedCheckResults
()
{
...
...
@@ -145,6 +161,9 @@ public class BridgeObject extends CityObject {
for
(
BoundarySurface
bs
:
boundarySurfaces
)
{
bs
.
clearAllContainedCheckResults
();
}
for
(
Installation
bi
:
bridgeInstallations
)
{
bi
.
clearAllContainedCheckResults
();
}
if
(
parts
!=
null
)
{
for
(
BridgeObject
part
:
parts
)
{
part
.
clearAllContainedCheckResults
();
...
...
@@ -163,6 +182,9 @@ public class BridgeObject extends CityObject {
for
(
BoundarySurface
bs
:
boundarySurfaces
)
{
bs
.
collectContainedErrors
(
errors
);
}
for
(
Installation
bi
:
bridgeInstallations
)
{
bi
.
collectContainedErrors
(
errors
);
}
if
(
parts
!=
null
)
{
for
(
BridgeObject
part
:
parts
)
{
part
.
collectContainedErrors
(
errors
);
...
...
@@ -181,6 +203,11 @@ public class BridgeObject extends CityObject {
if
(
hasError
)
{
return
true
;
}
for
(
Installation
bi
:
bridgeInstallations
)
{
if
(
bi
.
containsAnyError
())
{
return
true
;
}
}
for
(
BoundarySurface
bs
:
boundarySurfaces
)
{
if
(
bs
.
containsAnyError
())
{
return
true
;
...
...
@@ -216,6 +243,11 @@ public class BridgeObject extends CityObject {
if
(
hasError
)
{
return
true
;
}
for
(
Installation
bi
:
bridgeInstallations
)
{
if
(
bi
.
containsError
(
checkIdentifier
))
{
return
true
;
}
}
for
(
BoundarySurface
bs
:
boundarySurfaces
)
{
if
(
bs
.
containsError
(
checkIdentifier
))
{
return
true
;
...
...
@@ -254,6 +286,9 @@ public class BridgeObject extends CityObject {
for
(
BoundarySurface
bs
:
boundarySurfaces
)
{
bs
.
accept
(
c
);
}
for
(
Installation
bi
:
bridgeInstallations
)
{
bi
.
accept
(
c
);
}
if
(
parts
!=
null
)
{
for
(
BridgeObject
part
:
parts
)
{
part
.
accept
(
c
);
...
...
@@ -307,6 +342,9 @@ public class BridgeObject extends CityObject {
for
(
BoundarySurface
bs
:
boundarySurfaces
)
{
bs
.
unsetGmlGeometries
();
}
for
(
Installation
bi
:
bridgeInstallations
)
{
bi
.
unsetGmlGeometries
();
}
if
(
parts
!=
null
)
{
for
(
BridgeObject
part
:
parts
)
{
part
.
unsetGmlGeometries
();
...
...
@@ -331,9 +369,22 @@ public class BridgeObject extends CityObject {
@Override
public
void
prepareForChecking
()
{
super
.
prepareForChecking
();
if
(
elements
!=
null
)
{
for
(
BridgeConstructiveElement
e
:
elements
)
{
e
.
prepareForChecking
();
}
}
if
(
parts
!=
null
)
{
for
(
BridgeObject
part
:
parts
)
{
part
.
prepareForChecking
();
}
}
for
(
BoundarySurface
bs
:
boundarySurfaces
)
{
bs
.
prepareForChecking
();
}
for
(
Installation
bi
:
bridgeInstallations
)
{
bi
.
prepareForChecking
();
}
}
@Override
...
...
@@ -342,6 +393,9 @@ public class BridgeObject extends CityObject {
for
(
BoundarySurface
bs
:
boundarySurfaces
)
{
bs
.
clearMetaInformation
();
}
for
(
Installation
bi
:
bridgeInstallations
)
{
bi
.
clearMetaInformation
();
}
if
(
parts
!=
null
)
{
for
(
BridgeObject
part
:
parts
)
{
part
.
clearMetaInformation
();
...
...
@@ -360,6 +414,9 @@ public class BridgeObject extends CityObject {
for
(
BoundarySurface
bs
:
boundarySurfaces
)
{
handler
.
addInstance
(
bs
);
}
for
(
Installation
bi
:
bridgeInstallations
)
{
handler
.
addInstance
(
bi
);
}
if
(
parts
!=
null
)
{
for
(
BridgeObject
part
:
parts
)
{
handler
.
addInstance
(
part
);
...
...
@@ -372,6 +429,24 @@ public class BridgeObject extends CityObject {
}
}
public
void
anonymize
()
{
for
(
Geometry
geom
:
getGeometries
())
{
geom
.
anonymize
();
}
org
.
citygml4j
.
core
.
model
.
bridge
.
Bridge
gmlB
=
new
org
.
citygml4j
.
core
.
model
.
bridge
.
Bridge
();
gmlB
.
setId
(
GmlId
.
generateId
().
getGmlString
());
for
(
Installation
bi
:
getBridgeInstallations
())
{
bi
.
anonymize
();
gmlB
.
getBridgeInstallations
().
add
(
new
BridgeInstallationProperty
((
BridgeInstallation
)
bi
.
getGmlObject
()));
}
for
(
BoundarySurface
bs
:
getBoundarySurfaces
())
{
bs
.
anonymize
();
gmlB
.
addBoundary
(
new
AbstractSpaceBoundaryProperty
(
bs
.
getGmlObject
()));
}
this
.
ab
=
gmlB
;
}
@Override
public
void
fillValues
(
Copyable
original
,
CopyHandler
handler
)
{
super
.
fillValues
(
original
,
handler
);
...
...
@@ -379,14 +454,17 @@ public class BridgeObject extends CityObject {
for
(
BoundarySurface
originalBs
:
originalBo
.
boundarySurfaces
)
{
boundarySurfaces
.
add
(
handler
.
getCopyInstance
(
originalBs
));
}
if
(
parts
!=
null
)
{
for
(
BridgeObject
part
:
parts
)
{
handler
.
addInstance
(
part
);
for
(
Installation
originalBi
:
originalBo
.
bridgeInstallations
)
{
bridgeInstallations
.
add
(
handler
.
getCopyInstance
(
originalBi
));
}
if
(
originalBo
.
parts
!=
null
)
{
for
(
BridgeObject
part
:
originalBo
.
parts
)
{
getParts
().
add
(
handler
.
getCopyInstance
(
part
));
}
}
if
(
elements
!=
null
)
{
for
(
BridgeConstructiveElement
ele
:
elements
)
{
handler
.
add
Instance
(
ele
);
if
(
originalBo
.
elements
!=
null
)
{
for
(
BridgeConstructiveElement
ele
:
originalBo
.
elements
)
{
getConstructiveElements
().
add
(
handler
.
getCopy
Instance
(
ele
)
)
;
}
}
}
...
...
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/datastructure/Building.java
View file @
fcd48bc1
...
...
@@ -21,6 +21,7 @@ package de.hft.stuttgart.citydoctor2.datastructure;
import
java.util.ArrayList
;
import
java.util.List
;
import
org.citygml4j.core.model.building.BuildingInstallation
;
import
org.citygml4j.core.model.building.BuildingInstallationProperty
;
import
org.citygml4j.core.model.core.AbstractSpaceBoundaryProperty
;
import
org.citygml4j.core.util.geometry.GeometryFactory
;
...
...
@@ -120,9 +121,9 @@ public class Building extends AbstractBuilding {
}
org
.
citygml4j
.
core
.
model
.
building
.
Building
gmlB
=
new
org
.
citygml4j
.
core
.
model
.
building
.
Building
();
gmlB
.
setId
(
GmlId
.
generateId
().
getGmlString
());
for
(
Building
Installation
bi
:
getBuildingInstallations
())
{
for
(
Installation
bi
:
getBuildingInstallations
())
{
bi
.
anonymize
();
gmlB
.
getBuildingInstallations
().
add
(
new
BuildingInstallationProperty
(
bi
.
getGmlObject
()));
gmlB
.
getBuildingInstallations
().
add
(
new
BuildingInstallationProperty
(
(
BuildingInstallation
)
bi
.
getGmlObject
()));
}
for
(
BoundarySurface
bs
:
getBoundarySurfaces
())
{
bs
.
anonymize
();
...
...
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/datastructure/CityDoctorModel.java
View file @
fcd48bc1
...
...
@@ -333,7 +333,7 @@ public class CityDoctorModel {
if
(
index
==
-
1
)
{
throw
new
IllegalStateException
(
COULD_NOT_FIND_FEATURE
+
currentFeature
+
" in land objects"
);
}
land
.
set
(
index
,
(
LandObject
)
nextFeature
);
land
.
set
(
index
,
nextFeature
);
}
private
void
replaceVegetation
(
CityObject
currentFeature
,
CityObject
nextFeature
)
{
...
...
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/datastructure/ConcretePolygon.java
View file @
fcd48bc1
...
...
@@ -46,7 +46,7 @@ public class ConcretePolygon extends Polygon {
private
LinearRing
exterior
;
private
List
<
LinearRing
>
innerRings
;
private
BoundarySurface
partOfSurface
;
private
Building
Installation
partfOfInstallation
;
private
Installation
partfOfInstallation
;
private
Geometry
parent
;
private
LinkedPolygon
linkedFromPolygon
;
...
...
@@ -335,7 +335,7 @@ public class ConcretePolygon extends Polygon {
* hft.stuttgart.citydoctor2.datastructure.BuildingInstallation)
*/
@Override
public
void
setPartOfInstallation
(
Building
Installation
bi
)
{
public
void
setPartOfInstallation
(
Installation
bi
)
{
partfOfInstallation
=
bi
;
}
...
...
@@ -346,7 +346,7 @@ public class ConcretePolygon extends Polygon {
* de.hft.stuttgart.citydoctor2.datastructure.Polygon#getPartOfInstallation()
*/
@Override
public
Building
Installation
getPartOfInstallation
()
{
public
Installation
getPartOfInstallation
()
{
return
partfOfInstallation
;
}
...
...
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/datastructure/FeatureType.java
View file @
fcd48bc1
...
...
@@ -26,7 +26,7 @@ package de.hft.stuttgart.citydoctor2.datastructure;
*/
public
enum
FeatureType
{
BUILDING
,
TRANSPORTATION
,
VEGETATION
,
BRIDGE
,
LAND
,
WATER
,
BOUNDARY_SURFACE
,
BUILDING_
INSTALLATION
,
OPENING
,
BUILDING_PART
,
BRIDGE_CONSTRUCTION_ELEMENT
;
BUILDING
,
TRANSPORTATION
,
VEGETATION
,
BRIDGE
,
LAND
,
WATER
,
BOUNDARY_SURFACE
,
INSTALLATION
,
OPENING
,
BUILDING_PART
,
BRIDGE_CONSTRUCTION_ELEMENT
,
BRIDGE_INSTALLATION
;
}
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/datastructure/Geometry.java
View file @
fcd48bc1
...
...
@@ -97,10 +97,10 @@ public class Geometry extends GmlElement {
// set part of boundary surface or building installation or both
if
(
parent
instanceof
BoundarySurface
bs
)
{
cdPoly
.
setPartOfSurface
(
bs
);
if
(
bs
.
getParent
()
instanceof
Building
Installation
bi
)
{
if
(
bs
.
getParent
()
instanceof
Installation
bi
)
{
cdPoly
.
setPartOfInstallation
(
bi
);
}
}
else
if
(
parent
instanceof
Building
Installation
bi
)
{
}
else
if
(
parent
instanceof
Installation
bi
)
{
cdPoly
.
setPartOfInstallation
(
bi
);
}
}
...
...
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/datastructure/
Building
Installation.java
→
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/datastructure/Installation.java
View file @
fcd48bc1
...
...
@@ -21,6 +21,8 @@ package de.hft.stuttgart.citydoctor2.datastructure;
import
java.util.ArrayList
;
import
java.util.List
;
import
org.citygml4j.core.model.bridge.BridgeInstallation
;
import
org.citygml4j.core.model.construction.AbstractInstallation
;
import
org.citygml4j.core.model.core.AbstractSpaceBoundaryProperty
;
import
org.citygml4j.core.util.geometry.GeometryFactory
;
import
org.xmlobjects.gml.model.geometry.GeometryProperty
;
...
...
@@ -37,15 +39,15 @@ import de.hft.stuttgart.citydoctor2.utils.CityGmlUtils;
import
de.hft.stuttgart.citydoctor2.utils.CopyHandler
;
import
de.hft.stuttgart.citydoctor2.utils.Copyable
;
public
class
Building
Installation
extends
CityObject
{
public
class
Installation
extends
CityObject
{
private
static
final
long
serialVersionUID
=
1576237433322680191L
;
private
List
<
BoundarySurface
>
boundarySurfaces
=
new
ArrayList
<>(
4
);
private
org
.
citygml4j
.
core
.
model
.
building
.
Building
Installation
gmlBi
;
private
Abstract
Installation
gmlBi
;
private
AbstractBuilding
parent
;
private
CityObject
parent
;
public
void
reCreateGeometries
(
GeometryFactory
factory
,
ParserConfiguration
config
)
{
for
(
Geometry
geom
:
getGeometries
())
{
...
...
@@ -69,16 +71,41 @@ public class BuildingInstallation extends CityObject {
}
private
void
setGeometryAccordingToLod
(
Lod
lod
,
GeometryProperty
<?>
ms
)
{
if
(
gmlBi
instanceof
org
.
citygml4j
.
core
.
model
.
building
.
BuildingInstallation
localBi
)
{
addGeometryToBuildingInstallation
(
lod
,
ms
,
localBi
);
}
else
if
(
gmlBi
instanceof
BridgeInstallation
localBi
)
{
addGeometryToBridgeInstallation
(
lod
,
ms
,
localBi
);
}
}
private
void
addGeometryToBuildingInstallation
(
Lod
lod
,
GeometryProperty
<?>
ms
,
org
.
citygml4j
.
core
.
model
.
building
.
BuildingInstallation
localBi
)
{
switch
(
lod
)
{
case
LOD2:
gm
lBi
.
getDeprecatedProperties
().
setLod2Geometry
(
ms
);
loca
lBi
.
getDeprecatedProperties
().
setLod2Geometry
(
ms
);
break
;
case
LOD3:
gm
lBi
.
getDeprecatedProperties
().
setLod3Geometry
(
ms
);
loca
lBi
.
getDeprecatedProperties
().
setLod3Geometry
(
ms
);
break
;
case
LOD4:
gmlBi
.
getDeprecatedProperties
().
setLod4Geometry
(
ms
);
localBi
.
getDeprecatedProperties
().
setLod4Geometry
(
ms
);
break
;
default
:
throw
new
IllegalStateException
(
"Found geometry with LOD other than LOD2,"
+
" LOD3, LOD4, which is illegal for BuildingInstallations: "
+
lod
);
}
}
private
void
addGeometryToBridgeInstallation
(
Lod
lod
,
GeometryProperty
<?>
ms
,
BridgeInstallation
localBi
)
{
switch
(
lod
)
{
case
LOD2:
localBi
.
getDeprecatedProperties
().
setLod2Geometry
(
ms
);
break
;
case
LOD3:
localBi
.
getDeprecatedProperties
().
setLod3Geometry
(
ms
);
break
;
case
LOD4:
localBi
.
getDeprecatedProperties
().
setLod4Geometry
(
ms
);
break
;
default
:
throw
new
IllegalStateException
(
"Found geometry with LOD other than LOD2,"
...
...
@@ -141,11 +168,11 @@ public class BuildingInstallation extends CityObject {
return
false
;
}
public
void
setParent
(
AbstractBuilding
parent
)
{
public
void
setParent
(
CityObject
parent
)
{
this
.
parent
=
parent
;
}
public
AbstractBuilding
getParent
()
{
public
CityObject
getParent
()
{
return
parent
;
}
...
...
@@ -155,15 +182,25 @@ public class BuildingInstallation extends CityObject {
}
public
void
unsetGmlGeometries
()
{
gmlBi
.
getDeprecatedProperties
().
setLod2Geometry
(
null
);
gmlBi
.
getDeprecatedProperties
().
setLod3Geometry
(
null
);
gmlBi
.
getDeprecatedProperties
().
setLod4Geometry
(
null
);
if
(
gmlBi
instanceof
org
.
citygml4j
.
core
.
model
.
building
.
BuildingInstallation
localBi
)
{
localBi
.
getDeprecatedProperties
().
setLod2Geometry
(
null
);
localBi
.
getDeprecatedProperties
().
setLod3Geometry
(
null
);
localBi
.
getDeprecatedProperties
().
setLod4Geometry
(
null
);
}
else
if
(
gmlBi
instanceof
BridgeInstallation
localBi
)
{
removeGeometriesFromBridgeInstallation
(
localBi
);
}
for
(
BoundarySurface
bs
:
boundarySurfaces
)
{
bs
.
unsetGmlGeometries
();
}
}
public
void
setGmlObject
(
org
.
citygml4j
.
core
.
model
.
building
.
BuildingInstallation
gmlBi
)
{
private
void
removeGeometriesFromBridgeInstallation
(
BridgeInstallation
localBi
)
{
localBi
.
getDeprecatedProperties
().
setLod2Geometry
(
null
);
localBi
.
getDeprecatedProperties
().
setLod3Geometry
(
null
);
localBi
.
getDeprecatedProperties
().
setLod4Geometry
(
null
);
}
public
void
setGmlObject
(
AbstractInstallation
gmlBi
)
{
this
.
gmlBi
=
gmlBi
;
}
...
...
@@ -184,13 +221,13 @@ public class BuildingInstallation extends CityObject {
@Override
public
org
.
citygml4j
.
core
.
model
.
building
.
Building
Installation
getGmlObject
()
{
public
Abstract
Installation
getGmlObject
()
{
return
gmlBi
;
}
@Override
public
FeatureType
getFeatureType
()
{
return
FeatureType
.
BUILDING_
INSTALLATION
;
return
FeatureType
.
INSTALLATION
;
}
public
List
<
BoundarySurface
>
getBoundarySurfaces
()
{
...
...
@@ -219,7 +256,7 @@ public class BuildingInstallation extends CityObject {
@Override
public
void
fillValues
(
Copyable
original
,
CopyHandler
handler
)
{
super
.
fillValues
(
original
,
handler
);
Building
Installation
originalBi
=
(
Building
Installation
)
original
;
Installation
originalBi
=
(
Installation
)
original
;
for
(
BoundarySurface
originalBs
:
originalBi
.
boundarySurfaces
)
{
boundarySurfaces
.
add
(
handler
.
getCopyInstance
(
originalBs
));
}
...
...
@@ -238,7 +275,7 @@ public class BuildingInstallation extends CityObject {
@Override
public
Copyable
createCopyInstance
()
{
return
new
Building
Installation
();
return
new
Installation
();
}
}
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/datastructure/LinkedPolygon.java
View file @
fcd48bc1
...
...
@@ -213,12 +213,12 @@ public class LinkedPolygon extends Polygon {
}
@Override
public
void
setPartOfInstallation
(
Building
Installation
bi
)
{
public
void
setPartOfInstallation
(
Installation
bi
)
{
poly
.
setPartOfInstallation
(
bi
);
}
@Override
public
Building
Installation
getPartOfInstallation
()
{
public
Installation
getPartOfInstallation
()
{
return
poly
.
getPartOfInstallation
();
}
...
...
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/datastructure/Polygon.java
View file @
fcd48bc1
...
...
@@ -60,9 +60,9 @@ public abstract class Polygon extends GmlElement {
public
abstract
void
removeInnerRing
(
LinearRing
ring
);
public
abstract
void
setPartOfInstallation
(
Building
Installation
bi
);
public
abstract
void
setPartOfInstallation
(
Installation
bi
);
public
abstract
Building
Installation
getPartOfInstallation
();
public
abstract
Installation
getPartOfInstallation
();
public
abstract
boolean
hasPointAsCorner
(
Vertex
v
);
...
...
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/datastructure/WaterObject.java
View file @
fcd48bc1
...
...
@@ -64,7 +64,7 @@ public class WaterObject extends CityObject {
}
}
}
/**
* Getter for all boundary surfaces contained in this building.
*
...
...
@@ -73,7 +73,7 @@ public class WaterObject extends CityObject {
public
List
<
BoundarySurface
>
getBoundarySurfaces
()
{
return
boundarySurfaceList
;
}
public
void
addBoundarySurface
(
BoundarySurface
bs
)
{
boundarySurfaceList
.
add
(
bs
);
bs
.
setParent
(
this
);
...
...
@@ -90,6 +90,9 @@ public class WaterObject extends CityObject {
if
(
c
.
canExecute
(
this
))
{
c
.
check
(
this
);
}
for
(
BoundarySurface
bs
:
boundarySurfaceList
)
{
bs
.
accept
(
c
);
}
}
@Override
...
...
@@ -120,7 +123,48 @@ public class WaterObject extends CityObject {
@Override
public
void
fillValues
(
Copyable
original
,
CopyHandler
handler
)
{
WaterObject
wo
=
(
WaterObject
)
original
;
WaterObject
originalWaterObject
=
(
WaterObject
)
original
;
for
(
BoundarySurface
originalBs
:
originalWaterObject
.
boundarySurfaceList
)
{
boundarySurfaceList
.
add
(
handler
.
getCopyInstance
(
originalBs
));
}
gmlWater
=
wo
.
gmlWater
;
}
@Override
public
boolean
containsAnyError
()
{
boolean
hasError
=
super
.
containsAnyError
();
if
(
hasError
)
{
return
true
;
}
for
(
BoundarySurface
bs
:
boundarySurfaceList
)
{
if
(
bs
.
containsAnyError
())
{
return
true
;
}
}
return
false
;
}
@Override
public
void
collectInstances
(
CopyHandler
handler
)
{
super
.
collectInstances
(
handler
);
handler
.
addInstance
(
boundarySurfaceList
);
}
@Override
public
void
clearMetaInformation
()
{
super
.
clearMetaInformation
();
for
(
BoundarySurface
bs
:
boundarySurfaceList
)
{
bs
.
clearMetaInformation
();
}
}
@Override
public
void
prepareForChecking
()
{
super
.
prepareForChecking
();
for
(
BoundarySurface
bs
:
boundarySurfaceList
)
{
bs
.
prepareForChecking
();
}
}
}
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/mapper/citygml3/Citygml3FeatureMapper.java
View file @
fcd48bc1
...
...
@@ -30,6 +30,8 @@ import org.citygml4j.core.model.CityGMLVersion;
import
org.citygml4j.core.model.bridge.AbstractBridge
;
import
org.citygml4j.core.model.bridge.Bridge
;
import
org.citygml4j.core.model.bridge.BridgeConstructiveElementProperty
;
import
org.citygml4j.core.model.bridge.BridgeInstallation
;
import
org.citygml4j.core.model.bridge.BridgeInstallationProperty
;
import
org.citygml4j.core.model.bridge.BridgePart
;
import
org.citygml4j.core.model.bridge.BridgePartProperty
;
import
org.citygml4j.core.model.building.BuildingInstallationProperty
;
...
...
@@ -83,7 +85,6 @@ import de.hft.stuttgart.citydoctor2.datastructure.BridgeConstructiveElement;
import
de.hft.stuttgart.citydoctor2.datastructure.BridgeObject
;
import
de.hft.stuttgart.citydoctor2.datastructure.BridgeObject.BridgeType
;
import
de.hft.stuttgart.citydoctor2.datastructure.Building
;
import
de.hft.stuttgart.citydoctor2.datastructure.BuildingInstallation
;
import
de.hft.stuttgart.citydoctor2.datastructure.BuildingPart
;
import
de.hft.stuttgart.citydoctor2.datastructure.CityDoctorModel
;
import
de.hft.stuttgart.citydoctor2.datastructure.CityObject
;
...
...
@@ -92,6 +93,7 @@ import de.hft.stuttgart.citydoctor2.datastructure.Geometry;
import
de.hft.stuttgart.citydoctor2.datastructure.GeometryType
;
import
de.hft.stuttgart.citydoctor2.datastructure.GmlElement
;
import
de.hft.stuttgart.citydoctor2.datastructure.GmlId
;
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.LinkedPolygon
;
...
...
@@ -256,6 +258,15 @@ public class Citygml3FeatureMapper extends ObjectWalker {
}
for
(
BridgeConstructiveElement
ele
:
bo
.
getConstructiveElements
())
{
updateEdgesAndVertices
(
ele
);
for
(
BoundarySurface
bs
:
ele
.
getBoundarySurfaces
())
{
updateEdgesAndVertices
(
bs
);
}
}
for
(
Installation
bi
:
bo
.
getBridgeInstallations
())
{
updateEdgesAndVertices
(
bi
);
for
(
BoundarySurface
bs
:
bi
.
getBoundarySurfaces
())
{
updateEdgesAndVertices
(
bs
);
}
}
model
.
addBridge
(
bo
);
}
...
...
@@ -272,6 +283,16 @@ public class Citygml3FeatureMapper extends ObjectWalker {
bo
.
addConstructiveElement
(
cdEle
);
}
List
<
BridgeInstallationProperty
>
bridgeInstallations
=
ab
.
getBridgeInstallations
();
for
(
BridgeInstallationProperty
installationProp
:
bridgeInstallations
)
{
var
gmlBi
=
installationProp
.
getObject
();
if
(
gmlBi
==
null
)
{
// ignore empty properties
continue
;
}
Installation
bi
=
mapBridgeInstallation
(
gmlBi
);
bo
.
addBridgeInstallation
(
bi
);
}
SurfaceMapper
surfaceMapper
=
new
SurfaceMapper
(
polygonMap
,
references
,
vertexMap
,
config
);
for
(
AbstractSpaceBoundaryProperty
surfaceProp
:
ab
.
getBoundaries
())
{
...
...
@@ -290,6 +311,44 @@ public class Citygml3FeatureMapper extends ObjectWalker {
bo
.
unsetGmlGeometries
();
}
private
Installation
mapBridgeInstallation
(
BridgeInstallation
gmlBi
)
{
Installation
bi
=
new
Installation
();
bi
.
setGmlObject
(
gmlBi
);
mapAbstractOccupiedSpace
(
gmlBi
,
bi
);
GeometryProperty
<?>
lod2Prop
=
gmlBi
.
getDeprecatedProperties
().
getLod2Geometry
();
parseAndAddAbstractGeometry
(
lod2Prop
,
Lod
.
LOD2
,
bi
);
GeometryProperty
<?>
lod3Prop
=
gmlBi
.
getDeprecatedProperties
().
getLod3Geometry
();
parseAndAddAbstractGeometry
(
lod3Prop
,
Lod
.
LOD3
,
bi
);
GeometryProperty
<?>
lod4Prop
=
gmlBi
.
getDeprecatedProperties
().
getLod4Geometry
();
parseAndAddAbstractGeometry
(
lod4Prop
,
Lod
.
LOD4
,
bi
);
bi
.
unsetGmlGeometries
();
SurfaceMapper
surfaceMapper
=
new
SurfaceMapper
(
polygonMap
,
references
,
vertexMap
,
config
);
for
(
AbstractSpaceBoundaryProperty
surfaceProp
:
gmlBi
.
getBoundaries
())
{
if
(!
surfaceProp
.
isSetObject
())
{
continue
;
}
AbstractSpaceBoundary
surface
=
surfaceProp
.
getObject
();
surface
.
accept
(
surfaceMapper
);
}
for
(
BoundarySurface
bs
:
surfaceMapper
.
getSurfaces
())
{
bi
.
addBoundarySurface
(
bs
);
for
(
Geometry
geom
:
bs
.
getGeometries
())
{
for
(
Polygon
p
:
geom
.
getPolygons
())
{
p
.
setPartOfSurface
(
bs
);
p
.
setPartOfInstallation
(
bi
);
}
}
}
for
(
Geometry
geom
:
bi
.
getGeometries
())
{
for
(
Polygon
p
:
geom
.
getPolygons
())
{
p
.
setPartOfInstallation
(
bi
);
}
}
return
bi
;
}
private
void
updatePartOfSurface
(
BridgeObject
bo
,
SurfaceMapper
surfaceMapper
)
{
for
(
BoundarySurface
bs
:
surfaceMapper
.
getSurfaces
())
{
bo
.
addBoundarySurface
(
bs
);
...
...
@@ -303,6 +362,18 @@ public class Citygml3FeatureMapper extends ObjectWalker {
private
void
mapConstructiveElement
(
org
.
citygml4j
.
core
.
model
.
bridge
.
BridgeConstructiveElement
ele
,
BridgeConstructiveElement
bce
)
{
mapAbstractConstructiveElement
(
ele
,
bce
);
SurfaceMapper
surfaceMapper
=
new
SurfaceMapper
(
polygonMap
,
references
,
vertexMap
,
config
);
for
(
AbstractSpaceBoundaryProperty
surfaceProp
:
ele
.
getBoundaries
())
{
if
(!
surfaceProp
.
isSetObject
())
{
continue
;
}
AbstractSpaceBoundary
surface
=
surfaceProp
.
getObject
();
surface
.
accept
(
surfaceMapper
);
}
for
(
BoundarySurface
bs
:
surfaceMapper
.
getSurfaces
())
{
bce
.
addBoundarySurface
(
bs
);
}
}
private
void
mapAbstractConstructiveElement
(
org
.
citygml4j
.
core
.
model
.
bridge
.
BridgeConstructiveElement
ele
,
BridgeConstructiveElement
bce
)
{
...
...
@@ -486,7 +557,7 @@ public class Citygml3FeatureMapper extends ObjectWalker {
LinkedPolygon
lPoly
=
new
LinkedPolygon
(
concPoly
,
geom
);
if
(
geom
.
getParent
()
instanceof
BoundarySurface
bs
)
{
lPoly
.
setPartOfSurface
(
bs
);
if
(
bs
.
getParent
()
instanceof
Building
Installation
bi
)
{
if
(
bs
.
getParent
()
instanceof
Installation
bi
)
{
lPoly
.
setPartOfInstallation
(
bi
);
}
}
...
...
@@ -516,7 +587,7 @@ public class Citygml3FeatureMapper extends ObjectWalker {
// ignore empty properties
continue
;
}
Building
Installation
bi
=
mapBuildingInstallation
(
gmlBi
);
Installation
bi
=
mapBuildingInstallation
(
gmlBi
);
cdBuilding
.
addBuildingInstallation
(
bi
);
}
...
...
@@ -536,7 +607,7 @@ public class Citygml3FeatureMapper extends ObjectWalker {
for
(
BoundarySurface
bs
:
surfaceMapper
.
getSurfaces
())
{
updateEdgesAndVertices
(
bs
);
}
for
(
Building
Installation
bi
:
cdBuilding
.
getBuildingInstallations
())
{
for
(
Installation
bi
:
cdBuilding
.
getBuildingInstallations
())
{
updateEdgesAndVertices
(
bi
);
for
(
BoundarySurface
bs
:
bi
.
getBoundarySurfaces
())
{
updateEdgesAndVertices
(
bs
);
...
...
@@ -562,8 +633,8 @@ public class Citygml3FeatureMapper extends ObjectWalker {
}
}
private
Building
Installation
mapBuildingInstallation
(
org
.
citygml4j
.
core
.
model
.
building
.
BuildingInstallation
gmlBi
)
{
Building
Installation
bi
=
new
Building
Installation
();
private
Installation
mapBuildingInstallation
(
org
.
citygml4j
.
core
.
model
.
building
.
BuildingInstallation
gmlBi
)
{
Installation
bi
=
new
Installation
();
bi
.
setGmlObject
(
gmlBi
);
mapAbstractOccupiedSpace
(
gmlBi
,
bi
);
GeometryProperty
<?>
lod2Prop
=
gmlBi
.
getDeprecatedProperties
().
getLod2Geometry
();
...
...
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/writer/CityGMLWriterUtils.java
View file @
fcd48bc1
...
...
@@ -21,6 +21,7 @@ package de.hft.stuttgart.citydoctor2.writer;
import
java.io.File
;
import
java.time.ZonedDateTime
;
import
java.util.HashMap
;
import
java.util.Iterator
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map.Entry
;
...
...
@@ -93,6 +94,17 @@ public class CityGMLWriterUtils {
storeCityObjects
(
model
.
getWater
(),
gmlFactory
,
model
,
cModel
,
val
);
writer
.
write
(
cModel
);
cModel
.
getCityObjectMembers
().
clear
();
if
(
model
.
isValidated
())
{
// remove validation plan again to not re-add it on recurring save
Iterator
<
AbstractFeatureProperty
>
it
=
cModel
.
getFeatureMembers
().
iterator
();
while
(
it
.
hasNext
())
{
AbstractFeatureProperty
afp
=
it
.
next
();
if
(
afp
.
getObject
()
==
val
||
afp
.
getObject
()
==
model
.
getValidationPlan
())
{
it
.
remove
();
}
}
}
}
catch
(
CityGMLWriteException
e
)
{
throw
new
CityDoctorWriteException
(
e
);
}
...
...
CityDoctorParent/CityDoctorModel/src/test/java/de/hft/stuttgart/citydoctor2/check/error/AttributeInvalidErrorTest.java
View file @
fcd48bc1
...
...
@@ -55,5 +55,4 @@ public class AttributeInvalidErrorTest {
assertEquals
(
"attr"
,
adeErr
.
getAttributeName
());
}
}
CityDoctorParent/CityDoctorModel/src/test/java/de/hft/stuttgart/citydoctor2/datastructure/AbstractBuildingTest.java
View file @
fcd48bc1
...
...
@@ -57,8 +57,8 @@ public class AbstractBuildingTest {
public
void
testAccept
()
{
AbstractBuilding
ab
=
createAbstractBuilding
();
ab
.
addBoundarySurface
(
new
BoundarySurface
(
null
));
ab
.
addBuildingInstallation
(
new
Building
Installation
());
ab
.
addBuildingInstallation
(
new
Building
Installation
());
ab
.
addBuildingInstallation
(
new
Installation
());
ab
.
addBuildingInstallation
(
new
Installation
());
AtomicInteger
abCounter
=
new
AtomicInteger
(
0
);
AtomicInteger
bsCounter
=
new
AtomicInteger
(
0
);
AtomicInteger
biCounter
=
new
AtomicInteger
(
0
);
...
...
@@ -82,7 +82,7 @@ public class AbstractBuildingTest {
AbstractCheck
c2
=
new
AbstractCheck
()
{
@Override
public
void
check
(
Building
Installation
bi
)
{
public
void
check
(
Installation
bi
)
{
biCounter
.
incrementAndGet
();
}
};
...
...
@@ -92,7 +92,7 @@ public class AbstractBuildingTest {
@Test
public
void
testPrepareForChecking
()
{
Building
Installation
biMock
=
mock
(
Building
Installation
.
class
);
Installation
biMock
=
mock
(
Installation
.
class
);
BoundarySurface
bsMock
=
mock
(
BoundarySurface
.
class
);
AbstractBuilding
ab
=
createAbstractBuilding
();
...
...
@@ -105,7 +105,7 @@ public class AbstractBuildingTest {
@Test
public
void
testClearMetaInformation
()
{
Building
Installation
biMock
=
mock
(
Building
Installation
.
class
);
Installation
biMock
=
mock
(
Installation
.
class
);
BoundarySurface
bsMock
=
mock
(
BoundarySurface
.
class
);
AbstractBuilding
ab
=
createAbstractBuilding
();
...
...
@@ -137,7 +137,7 @@ public class AbstractBuildingTest {
@Test
public
void
testContainsErrorInBi
()
{
AbstractBuilding
ab
=
createAbstractBuilding
();
Building
Installation
biMock
=
mock
(
Building
Installation
.
class
);
Installation
biMock
=
mock
(
Installation
.
class
);
ab
.
addBuildingInstallation
(
biMock
);
assertFalse
(
ab
.
containsError
(
CheckId
.
C_GE_P_HOLE_OUTSIDE
));
Mockito
.
when
(
biMock
.
containsError
(
CheckId
.
C_GE_P_HOLE_OUTSIDE
)).
thenReturn
(
true
);
...
...
@@ -146,7 +146,7 @@ public class AbstractBuildingTest {
@Test
public
void
testClearAllContainedCheckResults
()
{
Building
Installation
biMock
=
mock
(
Building
Installation
.
class
);
Installation
biMock
=
mock
(
Installation
.
class
);
BoundarySurface
bsMock
=
mock
(
BoundarySurface
.
class
);
AbstractBuilding
ab
=
createAbstractBuilding
();
...
...
@@ -185,7 +185,7 @@ public class AbstractBuildingTest {
@Test
public
void
testContainsAnyErrorInBi
()
{
AbstractBuilding
ab
=
createAbstractBuilding
();
Building
Installation
biMock
=
mock
(
Building
Installation
.
class
);
Installation
biMock
=
mock
(
Installation
.
class
);
ab
.
addBuildingInstallation
(
biMock
);
assertFalse
(
ab
.
containsAnyError
());
Mockito
.
when
(
biMock
.
containsAnyError
()).
thenReturn
(
true
);
...
...
@@ -194,7 +194,7 @@ public class AbstractBuildingTest {
@Test
public
void
testCollectContainedErrors
()
{
Building
Installation
biMock
=
mock
(
Building
Installation
.
class
);
Installation
biMock
=
mock
(
Installation
.
class
);
BoundarySurface
bsMock
=
mock
(
BoundarySurface
.
class
);
AbstractBuilding
ab
=
createAbstractBuilding
();
...
...
@@ -291,7 +291,7 @@ public class AbstractBuildingTest {
@Test
public
void
testReCreateGeometriesEmptyBi
()
{
Building
Installation
biMock
=
mock
(
Building
Installation
.
class
);
Installation
biMock
=
mock
(
Installation
.
class
);
AbstractBuilding
ab
=
createAbstractBuilding
();
ab
.
addBuildingInstallation
(
biMock
);
GeometryFactory
factory
=
GeometryFactory
.
newInstance
();
...
...
@@ -304,7 +304,7 @@ public class AbstractBuildingTest {
@Test
public
void
testUnsetGmlGeometries
()
{
Building
Installation
biMock
=
mock
(
Building
Installation
.
class
);
Installation
biMock
=
mock
(
Installation
.
class
);
BoundarySurface
bsMock
=
mock
(
BoundarySurface
.
class
);
AbstractBuilding
ab
=
createAbstractBuilding
();
...
...
Prev
1
2
Next