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
fbcd8f92
Commit
fbcd8f92
authored
Sep 20, 2024
by
Riegel
Browse files
Add mapping of Room and Furniture objects
parent
2c171abe
Changes
7
Show whitespace changes
Inline
Side-by-side
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/datastructure/AbstractBuilding.java
View file @
fbcd8f92
...
@@ -57,6 +57,7 @@ public abstract class AbstractBuilding extends CityObject {
...
@@ -57,6 +57,7 @@ public abstract class AbstractBuilding extends CityObject {
private
final
List
<
BoundarySurface
>
boundarySurfaceList
=
new
ArrayList
<>();
private
final
List
<
BoundarySurface
>
boundarySurfaceList
=
new
ArrayList
<>();
private
final
List
<
BuildingRoom
>
buildingRooms
=
new
ArrayList
<>();
private
final
List
<
BuildingRoom
>
buildingRooms
=
new
ArrayList
<>();
private
final
List
<
BuildingRoomFurniture
>
buildingRoomFurnitureList
=
new
ArrayList
<>();
private
org
.
citygml4j
.
core
.
model
.
building
.
AbstractBuilding
ab
;
private
org
.
citygml4j
.
core
.
model
.
building
.
AbstractBuilding
ab
;
/**
/**
...
@@ -286,8 +287,16 @@ public abstract class AbstractBuilding extends CityObject {
...
@@ -286,8 +287,16 @@ public abstract class AbstractBuilding extends CityObject {
public
void
addBuildingRoom
(
BuildingRoom
room
)
{
public
void
addBuildingRoom
(
BuildingRoom
room
)
{
buildingRooms
.
add
(
room
);
buildingRooms
.
add
(
room
);
room
.
setParent
(
this
);
}
}
public
void
addBuildingRoomFurniture
(
BuildingRoomFurniture
roomFurniture
)
{
buildingRoomFurnitureList
.
add
(
roomFurniture
);
roomFurniture
.
setParent
(
this
);
}
public
void
setGmlObject
(
org
.
citygml4j
.
core
.
model
.
building
.
AbstractBuilding
ab
)
{
public
void
setGmlObject
(
org
.
citygml4j
.
core
.
model
.
building
.
AbstractBuilding
ab
)
{
this
.
ab
=
ab
;
this
.
ab
=
ab
;
}
}
...
@@ -300,6 +309,10 @@ public abstract class AbstractBuilding extends CityObject {
...
@@ -300,6 +309,10 @@ public abstract class AbstractBuilding extends CityObject {
return
buildingRooms
;
return
buildingRooms
;
}
}
public
List
<
BuildingRoomFurniture
>
getBuildingRoomFurnitureList
()
{
return
buildingRoomFurnitureList
;
}
@Override
@Override
public
void
prepareForChecking
()
{
public
void
prepareForChecking
()
{
super
.
prepareForChecking
();
super
.
prepareForChecking
();
...
...
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/datastructure/AbstractFurniture.java
View file @
fbcd8f92
...
@@ -11,6 +11,8 @@ import org.xmlobjects.gml.model.geometry.primitives.Solid;
...
@@ -11,6 +11,8 @@ import org.xmlobjects.gml.model.geometry.primitives.Solid;
import
org.xmlobjects.gml.model.geometry.primitives.SolidProperty
;
import
org.xmlobjects.gml.model.geometry.primitives.SolidProperty
;
import
java.io.Serial
;
import
java.io.Serial
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
/**
* Represents all types of furniture used inside Buildings.
* Represents all types of furniture used inside Buildings.
...
@@ -20,7 +22,9 @@ public abstract class AbstractFurniture extends CityObject{
...
@@ -20,7 +22,9 @@ public abstract class AbstractFurniture extends CityObject{
@Serial
@Serial
private
static
final
long
serialVersionUID
=
-
9050689238027190674L
;
private
static
final
long
serialVersionUID
=
-
9050689238027190674L
;
private
AbstractRoom
parent
;
private
final
List
<
BoundarySurface
>
boundarySurfaceList
=
new
ArrayList
<>();
private
CityObject
parent
;
private
org
.
citygml4j
.
core
.
model
.
construction
.
AbstractFurniture
af
;
private
org
.
citygml4j
.
core
.
model
.
construction
.
AbstractFurniture
af
;
...
@@ -29,6 +33,15 @@ public abstract class AbstractFurniture extends CityObject{
...
@@ -29,6 +33,15 @@ public abstract class AbstractFurniture extends CityObject{
return
af
;
return
af
;
}
}
public
void
addBoundarySurface
(
BoundarySurface
boundarySurface
)
{
boundarySurfaceList
.
add
(
boundarySurface
);
boundarySurface
.
setParent
(
this
);
}
public
List
<
BoundarySurface
>
getBoundarySurfaceList
()
{
return
boundarySurfaceList
;
}
@Override
@Override
public
void
reCreateGeometries
(
GeometryFactory
factory
,
ParserConfiguration
config
)
{
public
void
reCreateGeometries
(
GeometryFactory
factory
,
ParserConfiguration
config
)
{
for
(
Geometry
geom
:
getGeometries
())
{
for
(
Geometry
geom
:
getGeometries
())
{
...
@@ -42,14 +55,12 @@ public abstract class AbstractFurniture extends CityObject{
...
@@ -42,14 +55,12 @@ public abstract class AbstractFurniture extends CityObject{
}
}
}
}
public
void
setParent
(
AbstractRoom
room
)
{
protected
void
setGmlObject
(
org
.
citygml4j
.
core
.
model
.
construction
.
AbstractFurniture
af
){
if
(
parent
==
null
)
{
this
.
af
=
af
;
parent
=
room
;
}
else
if
(
parent
!=
room
)
{
parent
.
removeFurniture
(
this
);
room
.
addRoomFurniture
(
this
);
parent
=
room
;
}
}
public
void
setParent
(
CityObject
co
)
{
parent
=
co
;
}
}
...
...
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/datastructure/AbstractRoom.java
View file @
fbcd8f92
...
@@ -7,6 +7,7 @@ import de.hft.stuttgart.citydoctor2.parser.ParserConfiguration;
...
@@ -7,6 +7,7 @@ import de.hft.stuttgart.citydoctor2.parser.ParserConfiguration;
import
de.hft.stuttgart.citydoctor2.utils.CityGmlUtils
;
import
de.hft.stuttgart.citydoctor2.utils.CityGmlUtils
;
import
de.hft.stuttgart.citydoctor2.utils.CopyHandler
;
import
de.hft.stuttgart.citydoctor2.utils.CopyHandler
;
import
de.hft.stuttgart.citydoctor2.utils.Copyable
;
import
de.hft.stuttgart.citydoctor2.utils.Copyable
;
import
org.citygml4j.core.model.construction.AbstractFurnitureProperty
;
import
org.citygml4j.core.model.core.AbstractCityObject
;
import
org.citygml4j.core.model.core.AbstractCityObject
;
import
org.citygml4j.core.util.geometry.GeometryFactory
;
import
org.citygml4j.core.util.geometry.GeometryFactory
;
import
org.xmlobjects.gml.model.geometry.aggregates.MultiSurface
;
import
org.xmlobjects.gml.model.geometry.aggregates.MultiSurface
;
...
@@ -27,11 +28,15 @@ public abstract class AbstractRoom extends CityObject{
...
@@ -27,11 +28,15 @@ public abstract class AbstractRoom extends CityObject{
private
static
final
long
serialVersionUID
=
-
1730625513988944329L
;
private
static
final
long
serialVersionUID
=
-
1730625513988944329L
;
private
final
List
<
Installation
>
roomInstallations
=
new
ArrayList
<>(
2
);
private
final
List
<
Installation
>
roomInstallations
=
new
ArrayList
<>(
2
);
private
final
List
<
AbstractFurniture
>
abstractFurnitureList
=
new
ArrayList
<>(
2
);
// Rooms have a Href list of furniture, the actual object is saved in the Building
private
final
List
<
BoundarySurface
>
boundarySurfaceList
=
new
ArrayList
<>();
private
final
List
<
BoundarySurface
>
boundarySurfaceList
=
new
ArrayList
<>();
protected
org
.
citygml4j
.
core
.
model
.
core
.
AbstractUnoccupiedSpace
cgmlRoom
;
protected
org
.
citygml4j
.
core
.
model
.
core
.
AbstractUnoccupiedSpace
cgmlRoom
;
@Override
@Override
public
void
accept
(
Check
c
)
{
public
void
accept
(
Check
c
)
{
super
.
accept
(
c
);
super
.
accept
(
c
);
...
@@ -41,9 +46,6 @@ public abstract class AbstractRoom extends CityObject{
...
@@ -41,9 +46,6 @@ public abstract class AbstractRoom extends CityObject{
for
(
Installation
roomInstallation
:
roomInstallations
)
{
for
(
Installation
roomInstallation
:
roomInstallations
)
{
roomInstallation
.
accept
(
c
);
roomInstallation
.
accept
(
c
);
}
}
for
(
AbstractFurniture
abstractFurniture
:
abstractFurnitureList
)
{
abstractFurniture
.
accept
(
c
);
}
for
(
BoundarySurface
boundarySurface
:
boundarySurfaceList
)
{
for
(
BoundarySurface
boundarySurface
:
boundarySurfaceList
)
{
boundarySurface
.
accept
(
c
);
boundarySurface
.
accept
(
c
);
}
}
...
@@ -55,9 +57,6 @@ public abstract class AbstractRoom extends CityObject{
...
@@ -55,9 +57,6 @@ public abstract class AbstractRoom extends CityObject{
for
(
Installation
roomInstallation
:
roomInstallations
)
{
for
(
Installation
roomInstallation
:
roomInstallations
)
{
roomInstallation
.
collectContainedErrors
(
errors
);
roomInstallation
.
collectContainedErrors
(
errors
);
}
}
for
(
AbstractFurniture
abstractFurniture
:
abstractFurnitureList
)
{
abstractFurniture
.
collectContainedErrors
(
errors
);
}
for
(
BoundarySurface
boundarySurface
:
boundarySurfaceList
)
{
for
(
BoundarySurface
boundarySurface
:
boundarySurfaceList
)
{
boundarySurface
.
collectContainedErrors
(
errors
);
boundarySurface
.
collectContainedErrors
(
errors
);
}
}
...
@@ -69,9 +68,6 @@ public abstract class AbstractRoom extends CityObject{
...
@@ -69,9 +68,6 @@ public abstract class AbstractRoom extends CityObject{
for
(
Installation
roomInstallation
:
roomInstallations
)
{
for
(
Installation
roomInstallation
:
roomInstallations
)
{
roomInstallation
.
clearAllContainedCheckResults
();
roomInstallation
.
clearAllContainedCheckResults
();
}
}
for
(
AbstractFurniture
abstractFurniture
:
abstractFurnitureList
)
{
abstractFurniture
.
clearAllContainedCheckResults
();
}
for
(
BoundarySurface
boundarySurface
:
boundarySurfaceList
)
{
for
(
BoundarySurface
boundarySurface
:
boundarySurfaceList
)
{
boundarySurface
.
clearAllContainedCheckResults
();
boundarySurface
.
clearAllContainedCheckResults
();
}
}
...
@@ -88,11 +84,6 @@ public abstract class AbstractRoom extends CityObject{
...
@@ -88,11 +84,6 @@ public abstract class AbstractRoom extends CityObject{
return
true
;
return
true
;
}
}
}
}
for
(
AbstractFurniture
abstractFurniture
:
abstractFurnitureList
)
{
if
(
abstractFurniture
.
containsError
(
checkIdentifier
)){
return
true
;
}
}
for
(
BoundarySurface
boundarySurface
:
boundarySurfaceList
)
{
for
(
BoundarySurface
boundarySurface
:
boundarySurfaceList
)
{
if
(
boundarySurface
.
containsError
(
checkIdentifier
)){
if
(
boundarySurface
.
containsError
(
checkIdentifier
)){
return
true
;
return
true
;
...
@@ -112,11 +103,6 @@ public abstract class AbstractRoom extends CityObject{
...
@@ -112,11 +103,6 @@ public abstract class AbstractRoom extends CityObject{
return
true
;
return
true
;
}
}
}
}
for
(
AbstractFurniture
abstractFurniture
:
abstractFurnitureList
)
{
if
(
abstractFurniture
.
containsAnyError
()){
return
true
;
}
}
for
(
BoundarySurface
boundarySurface
:
boundarySurfaceList
)
{
for
(
BoundarySurface
boundarySurface
:
boundarySurfaceList
)
{
if
(
boundarySurface
.
containsAnyError
()){
if
(
boundarySurface
.
containsAnyError
()){
return
true
;
return
true
;
...
@@ -142,9 +128,6 @@ public abstract class AbstractRoom extends CityObject{
...
@@ -142,9 +128,6 @@ public abstract class AbstractRoom extends CityObject{
for
(
Installation
roomInstallation
:
roomInstallations
)
{
for
(
Installation
roomInstallation
:
roomInstallations
)
{
roomInstallation
.
reCreateGeometries
(
factory
,
config
);
roomInstallation
.
reCreateGeometries
(
factory
,
config
);
}
}
for
(
AbstractFurniture
abstractFurniture
:
abstractFurnitureList
)
{
abstractFurniture
.
reCreateGeometries
(
factory
,
config
);
}
}
}
...
@@ -189,9 +172,6 @@ public abstract class AbstractRoom extends CityObject{
...
@@ -189,9 +172,6 @@ public abstract class AbstractRoom extends CityObject{
cgmlRoom
.
setLod1Solid
(
null
);
cgmlRoom
.
setLod1Solid
(
null
);
cgmlRoom
.
setLod2Solid
(
null
);
cgmlRoom
.
setLod2Solid
(
null
);
cgmlRoom
.
setLod3Solid
(
null
);
cgmlRoom
.
setLod3Solid
(
null
);
for
(
AbstractFurniture
abstractFurniture
:
abstractFurnitureList
)
{
abstractFurniture
.
unsetGmlGeometries
();
}
for
(
Installation
roomInstallation
:
roomInstallations
)
{
for
(
Installation
roomInstallation
:
roomInstallations
)
{
roomInstallation
.
unsetGmlGeometries
();
roomInstallation
.
unsetGmlGeometries
();
}
}
...
@@ -203,9 +183,6 @@ public abstract class AbstractRoom extends CityObject{
...
@@ -203,9 +183,6 @@ public abstract class AbstractRoom extends CityObject{
@Override
@Override
public
void
prepareForChecking
(){
public
void
prepareForChecking
(){
super
.
prepareForChecking
();
super
.
prepareForChecking
();
for
(
AbstractFurniture
abstractFurniture
:
abstractFurnitureList
)
{
abstractFurniture
.
prepareForChecking
();
}
for
(
Installation
roomInstallation
:
roomInstallations
)
{
for
(
Installation
roomInstallation
:
roomInstallations
)
{
roomInstallation
.
prepareForChecking
();
roomInstallation
.
prepareForChecking
();
}
}
...
@@ -217,9 +194,6 @@ public abstract class AbstractRoom extends CityObject{
...
@@ -217,9 +194,6 @@ public abstract class AbstractRoom extends CityObject{
@Override
@Override
public
void
clearMetaInformation
()
{
public
void
clearMetaInformation
()
{
super
.
clearMetaInformation
();
super
.
clearMetaInformation
();
for
(
AbstractFurniture
abstractFurniture
:
abstractFurnitureList
)
{
abstractFurniture
.
clearMetaInformation
();
}
for
(
Installation
roomInstallation
:
roomInstallations
)
{
for
(
Installation
roomInstallation
:
roomInstallations
)
{
roomInstallation
.
clearMetaInformation
();
roomInstallation
.
clearMetaInformation
();
}
}
...
@@ -228,22 +202,18 @@ public abstract class AbstractRoom extends CityObject{
...
@@ -228,22 +202,18 @@ public abstract class AbstractRoom extends CityObject{
}
}
}
}
@Override
@Override
public
AbstractCityObject
getGmlObject
()
{
public
AbstractCityObject
getGmlObject
()
{
return
cgmlRoom
;
return
cgmlRoom
;
}
}
public
void
removeFurniture
(
AbstractFurniture
furniture
)
{
abstractFurnitureList
.
remove
(
furniture
);
}
public
List
<
Installation
>
getRoomInstallations
()
{
public
List
<
Installation
>
getRoomInstallations
()
{
return
roomInstallations
;
return
roomInstallations
;
}
}
public
List
<
AbstractFurniture
>
getRoomFurnitureList
()
{
return
abstractFurnitureList
;
}
public
List
<
BoundarySurface
>
getBoundarySurfaceList
()
{
public
List
<
BoundarySurface
>
getBoundarySurfaceList
()
{
return
boundarySurfaceList
;
return
boundarySurfaceList
;
...
@@ -259,9 +229,7 @@ public abstract class AbstractRoom extends CityObject{
...
@@ -259,9 +229,7 @@ public abstract class AbstractRoom extends CityObject{
boundarySurface
.
setParent
(
this
);
boundarySurface
.
setParent
(
this
);
}
}
public
void
addRoomFurniture
(
AbstractFurniture
abstractFurniture
)
{
abstractFurnitureList
.
add
(
abstractFurniture
);
}
@Override
@Override
public
FeatureType
getFeatureType
()
{
public
FeatureType
getFeatureType
()
{
...
@@ -272,7 +240,6 @@ public abstract class AbstractRoom extends CityObject{
...
@@ -272,7 +240,6 @@ public abstract class AbstractRoom extends CityObject{
public
void
collectInstances
(
CopyHandler
handler
){
public
void
collectInstances
(
CopyHandler
handler
){
super
.
collectInstances
(
handler
);
super
.
collectInstances
(
handler
);
handler
.
addInstance
(
roomInstallations
);
handler
.
addInstance
(
roomInstallations
);
handler
.
addInstance
(
abstractFurnitureList
);
handler
.
addInstance
(
boundarySurfaceList
);
handler
.
addInstance
(
boundarySurfaceList
);
}
}
...
@@ -286,9 +253,6 @@ public abstract class AbstractRoom extends CityObject{
...
@@ -286,9 +253,6 @@ public abstract class AbstractRoom extends CityObject{
for
(
Installation
originalRi
:
originalAr
.
roomInstallations
)
{
for
(
Installation
originalRi
:
originalAr
.
roomInstallations
)
{
roomInstallations
.
add
(
handler
.
getCopyInstance
(
originalRi
));
roomInstallations
.
add
(
handler
.
getCopyInstance
(
originalRi
));
}
}
for
(
AbstractFurniture
originalAb
:
originalAr
.
abstractFurnitureList
)
{
abstractFurnitureList
.
add
(
handler
.
getCopyInstance
(
originalAb
));
}
cgmlRoom
=
originalAr
.
cgmlRoom
;
cgmlRoom
=
originalAr
.
cgmlRoom
;
}
}
...
...
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/datastructure/BridgeFurniture.java
→
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/datastructure/Bridge
Room
Furniture.java
View file @
fbcd8f92
package
de.hft.stuttgart.citydoctor2.datastructure
;
package
de.hft.stuttgart.citydoctor2.datastructure
;
import
de.hft.stuttgart.citydoctor2.utils.Copyable
;
import
de.hft.stuttgart.citydoctor2.utils.Copyable
;
import
org.citygml4j.core.model.bridge.BridgeFurniture
;
import
java.io.Serial
;
import
java.io.Serial
;
public
class
BridgeFurniture
extends
AbstractFurniture
{
public
class
Bridge
Room
Furniture
extends
AbstractFurniture
{
@Serial
@Serial
private
static
final
long
serialVersionUID
=
2450802405053172352L
;
private
static
final
long
serialVersionUID
=
2450802405053172352L
;
public
BridgeFurniture
(
BridgeRoom
parent
)
{
public
void
setGmlObject
(
BridgeFurniture
gmlObject
)
{
setParent
(
parent
);
super
.
setGmlObject
(
gmlObject
);
parent
.
addRoomFurniture
(
this
);
}
}
private
BridgeFurniture
(){}
@Override
@Override
public
Copyable
createCopyInstance
(){
public
Copyable
createCopyInstance
(){
return
new
BridgeFurniture
();
return
new
Bridge
Room
Furniture
();
}
}
}
}
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/datastructure/BuildingRoom.java
View file @
fbcd8f92
package
de.hft.stuttgart.citydoctor2.datastructure
;
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.parser.ParserConfiguration
;
import
de.hft.stuttgart.citydoctor2.utils.CopyHandler
;
import
de.hft.stuttgart.citydoctor2.utils.CopyHandler
;
import
de.hft.stuttgart.citydoctor2.utils.Copyable
;
import
de.hft.stuttgart.citydoctor2.utils.Copyable
;
import
org.citygml4j.core.model.building.BuildingFurnitureProperty
;
import
org.citygml4j.core.model.construction.AbstractFurnitureProperty
;
import
org.citygml4j.core.util.geometry.GeometryFactory
;
import
java.io.Serial
;
import
java.io.Serial
;
import
java.util.ArrayList
;
import
java.util.List
;
public
class
BuildingRoom
extends
AbstractRoom
{
public
class
BuildingRoom
extends
AbstractRoom
{
@Serial
@Serial
private
static
final
long
serialVersionUID
=
-
276088332165299253L
;
private
static
final
long
serialVersionUID
=
-
276088332165299253L
;
private
final
List
<
BuildingFurnitureProperty
>
furnitureRefs
=
new
ArrayList
<>(
2
);
private
AbstractBuilding
parent
;
private
AbstractBuilding
parent
;
private
BuildingRoom
(){}
public
void
setGmlObject
(
org
.
citygml4j
.
core
.
model
.
building
.
BuildingRoom
cgmlRoom
){
super
.
cgmlRoom
=
cgmlRoom
;
}
public
BuildingRoom
(
AbstractBuilding
parent
)
{
public
void
setParent
(
AbstractBuilding
parent
){
this
.
parent
=
parent
;
this
.
parent
=
parent
;
parent
.
addBuildingRoom
(
this
);
}
}
public
void
addFurnitureRef
(
BuildingFurnitureProperty
furnitureRef
)
{
public
void
setGmlObject
(
org
.
citygml4j
.
core
.
model
.
building
.
BuildingRoom
cgmlRoom
){
furnitureRefs
.
add
(
furnitureRef
);
super
.
cgmlRoom
=
cgmlRoom
;
}
}
/**
* Returns the list of citygml3 furniture objects registered to this room.
* The reference objects only hold a HRef to the actual furniture object.
* @return
*/
public
List
<
BuildingFurnitureProperty
>
getFurnitureRefs
()
{
return
furnitureRefs
;
}
public
AbstractBuilding
getParent
()
{
public
AbstractBuilding
getParent
()
{
return
parent
;
return
parent
;
...
@@ -32,6 +50,7 @@ public class BuildingRoom extends AbstractRoom{
...
@@ -32,6 +50,7 @@ public class BuildingRoom extends AbstractRoom{
@Override
@Override
public
void
fillValues
(
Copyable
original
,
CopyHandler
handler
){
public
void
fillValues
(
Copyable
original
,
CopyHandler
handler
){
super
.
fillValues
(
original
,
handler
);
super
.
fillValues
(
original
,
handler
);
BuildingRoom
oRoom
=
(
BuildingRoom
)
original
;
BuildingRoom
oRoom
=
(
BuildingRoom
)
original
;
parent
=
handler
.
getCopyInstance
(
oRoom
.
getParent
());
parent
=
handler
.
getCopyInstance
(
oRoom
.
getParent
());
}
}
...
...
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/datastructure/BuildingFurniture.java
→
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/datastructure/Building
Room
Furniture.java
View file @
fbcd8f92
...
@@ -2,25 +2,22 @@ package de.hft.stuttgart.citydoctor2.datastructure;
...
@@ -2,25 +2,22 @@ package de.hft.stuttgart.citydoctor2.datastructure;
import
de.hft.stuttgart.citydoctor2.utils.Copyable
;
import
de.hft.stuttgart.citydoctor2.utils.Copyable
;
import
org.citygml4j.core.model.building.BuildingFurniture
;
import
java.io.Serial
;
import
java.io.Serial
;
public
class
BuildingFurniture
extends
AbstractFurniture
{
public
class
Building
Room
Furniture
extends
AbstractFurniture
{
@Serial
@Serial
private
static
final
long
serialVersionUID
=
-
1046265159354525567L
;
private
static
final
long
serialVersionUID
=
-
1046265159354525567L
;
public
BuildingFurniture
(
BuildingRoom
parent
)
{
public
void
setGmlObject
(
BuildingFurniture
gmlObject
)
{
setParent
(
parent
);
super
.
setGmlObject
(
gmlObject
);
parent
.
addRoomFurniture
(
this
);
}
}
private
BuildingFurniture
(){}
@Override
@Override
public
Copyable
createCopyInstance
(){
public
Copyable
createCopyInstance
(){
return
new
BuildingFurniture
();
return
new
Building
Room
Furniture
();
}
}
}
}
...
...
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/mapper/citygml3/Citygml3FeatureMapper.java
View file @
fbcd8f92
...
@@ -24,6 +24,11 @@ import java.util.HashMap;
...
@@ -24,6 +24,11 @@ import java.util.HashMap;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
de.hft.stuttgart.citydoctor2.datastructure.*
;
import
de.hft.stuttgart.citydoctor2.datastructure.AbstractBuilding
;
import
de.hft.stuttgart.citydoctor2.datastructure.Building
;
import
de.hft.stuttgart.citydoctor2.datastructure.BuildingPart
;
import
de.hft.stuttgart.citydoctor2.datastructure.BuildingRoom
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
import
org.apache.logging.log4j.Logger
;
import
org.citygml4j.core.model.CityGMLVersion
;
import
org.citygml4j.core.model.CityGMLVersion
;
...
@@ -34,8 +39,8 @@ import org.citygml4j.core.model.bridge.BridgeInstallation;
...
@@ -34,8 +39,8 @@ import org.citygml4j.core.model.bridge.BridgeInstallation;
import
org.citygml4j.core.model.bridge.BridgeInstallationProperty
;
import
org.citygml4j.core.model.bridge.BridgeInstallationProperty
;
import
org.citygml4j.core.model.bridge.BridgePart
;
import
org.citygml4j.core.model.bridge.BridgePart
;
import
org.citygml4j.core.model.bridge.BridgePartProperty
;
import
org.citygml4j.core.model.bridge.BridgePartProperty
;
import
org.citygml4j.core.model.building.
BuildingInstallationProperty
;
import
org.citygml4j.core.model.building.
*
;
import
org.citygml4j.core.model.building.Building
PartProperty
;
import
org.citygml4j.core.model.building.Building
Furniture
;
import
org.citygml4j.core.model.construction.AbstractConstruction
;
import
org.citygml4j.core.model.construction.AbstractConstruction
;
import
org.citygml4j.core.model.core.AbstractCityObject
;
import
org.citygml4j.core.model.core.AbstractCityObject
;
import
org.citygml4j.core.model.core.AbstractFeatureWithLifespan
;
import
org.citygml4j.core.model.core.AbstractFeatureWithLifespan
;
...
@@ -79,33 +84,9 @@ import org.xmlobjects.gml.model.geometry.primitives.Solid;
...
@@ -79,33 +84,9 @@ import org.xmlobjects.gml.model.geometry.primitives.Solid;
import
org.xmlobjects.gml.model.geometry.primitives.SolidProperty
;
import
org.xmlobjects.gml.model.geometry.primitives.SolidProperty
;
import
org.xmlobjects.gml.model.geometry.primitives.SurfaceProperty
;
import
org.xmlobjects.gml.model.geometry.primitives.SurfaceProperty
;
import
de.hft.stuttgart.citydoctor2.datastructure.AbstractBuilding
;
import
de.hft.stuttgart.citydoctor2.datastructure.BoundarySurface
;
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.BridgeObject.BridgeType
;
import
de.hft.stuttgart.citydoctor2.datastructure.Building
;
import
de.hft.stuttgart.citydoctor2.datastructure.BuildingPart
;
import
de.hft.stuttgart.citydoctor2.datastructure.CityDoctorModel
;
import
de.hft.stuttgart.citydoctor2.datastructure.CityObject
;
import
de.hft.stuttgart.citydoctor2.datastructure.ConcretePolygon
;
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
;
import
de.hft.stuttgart.citydoctor2.datastructure.Lod
;
import
de.hft.stuttgart.citydoctor2.datastructure.Opening
;
import
de.hft.stuttgart.citydoctor2.datastructure.Polygon
;
import
de.hft.stuttgart.citydoctor2.datastructure.TransportationObject
;
import
de.hft.stuttgart.citydoctor2.datastructure.TransportationObject.TransportationType
;
import
de.hft.stuttgart.citydoctor2.datastructure.TransportationObject.TransportationType
;
import
de.hft.stuttgart.citydoctor2.datastructure.Vegetation
;
import
de.hft.stuttgart.citydoctor2.datastructure.Vegetation.VegetationType
;
import
de.hft.stuttgart.citydoctor2.datastructure.Vegetation.VegetationType
;
import
de.hft.stuttgart.citydoctor2.datastructure.Vertex
;
import
de.hft.stuttgart.citydoctor2.datastructure.WaterObject
;
import
de.hft.stuttgart.citydoctor2.math.graph.KDTree
;
import
de.hft.stuttgart.citydoctor2.math.graph.KDTree
;
import
de.hft.stuttgart.citydoctor2.parser.ParserConfiguration
;
import
de.hft.stuttgart.citydoctor2.parser.ParserConfiguration
;
import
de.hft.stuttgart.citydoctor2.utils.Localization
;
import
de.hft.stuttgart.citydoctor2.utils.Localization
;
...
@@ -498,8 +479,8 @@ public class Citygml3FeatureMapper extends ObjectWalker {
...
@@ -498,8 +479,8 @@ public class Citygml3FeatureMapper extends ObjectWalker {
mapAbstractUnoccupiedSpace
(
ts
,
to
);
mapAbstractUnoccupiedSpace
(
ts
,
to
);
}
}
private
void
mapAbstractUnoccupiedSpace
(
AbstractUnoccupiedSpace
aus
,
Transportation
Object
t
o
)
{
private
void
mapAbstractUnoccupiedSpace
(
AbstractUnoccupiedSpace
aus
,
City
Object
c
o
)
{
mapAbstractPhysicalSpace
(
aus
,
t
o
);
mapAbstractPhysicalSpace
(
aus
,
c
o
);
}
}
private
TransportationObject
parseAuxiliaryTrafficSpace
(
AuxiliaryTrafficSpace
ats
)
{
private
TransportationObject
parseAuxiliaryTrafficSpace
(
AuxiliaryTrafficSpace
ats
)
{
...
@@ -592,6 +573,15 @@ public class Citygml3FeatureMapper extends ObjectWalker {
...
@@ -592,6 +573,15 @@ public class Citygml3FeatureMapper extends ObjectWalker {
cdBuilding
.
addBuildingInstallation
(
bi
);
cdBuilding
.
addBuildingInstallation
(
bi
);
}
}
for
(
BuildingRoomProperty
brProp
:
gmlAb
.
getBuildingRooms
())
{
var
gmlBr
=
brProp
.
getObject
();
if
(
gmlBr
==
null
)
{
continue
;
}
BuildingRoom
br
=
mapBuildingRoom
(
gmlBr
);
cdBuilding
.
addBuildingRoom
(
br
);
}
SurfaceMapper
surfaceMapper
=
new
SurfaceMapper
(
polygonMap
,
references
,
vertexMap
,
config
);
SurfaceMapper
surfaceMapper
=
new
SurfaceMapper
(
polygonMap
,
references
,
vertexMap
,
config
);
for
(
AbstractSpaceBoundaryProperty
surfaceProp
:
gmlAb
.
getBoundaries
())
{
for
(
AbstractSpaceBoundaryProperty
surfaceProp
:
gmlAb
.
getBoundaries
())
{
if
(!
surfaceProp
.
isSetObject
())
{
if
(!
surfaceProp
.
isSetObject
())
{
...
@@ -620,6 +610,82 @@ public class Citygml3FeatureMapper extends ObjectWalker {
...
@@ -620,6 +610,82 @@ public class Citygml3FeatureMapper extends ObjectWalker {
}
}
}
}
}
}
for
(
BuildingFurnitureProperty
bfProp
:
gmlAb
.
getBuildingFurniture
()){
var
gmlBf
=
bfProp
.
getObject
();
if
(
gmlBf
==
null
)
{
continue
;
}
BuildingRoomFurniture
bf
=
mapBuildingFurniture
(
gmlBf
);
cdBuilding
.
addBuildingRoomFurniture
(
bf
);
}
}
private
BuildingRoom
mapBuildingRoom
(
org
.
citygml4j
.
core
.
model
.
building
.
BuildingRoom
gmlBr
)
{
BuildingRoom
br
=
new
BuildingRoom
();
br
.
setGmlObject
(
gmlBr
);
mapAbstractUnoccupiedSpace
(
gmlBr
,
br
);
SurfaceMapper
surfaceMapper
=
new
SurfaceMapper
(
polygonMap
,
references
,
vertexMap
,
config
);
for
(
AbstractSpaceBoundaryProperty
surfaceProp
:
gmlBr
.
getBoundaries
())
{
if
(!
surfaceProp
.
isSetObject
())
{
continue
;
}
AbstractSpaceBoundary
surface
=
surfaceProp
.
getObject
();
surface
.
accept
(
surfaceMapper
);
}
for
(
BoundarySurface
bs
:
surfaceMapper
.
getSurfaces
())
{
br
.
addBoundarySurface
(
bs
);
for
(
Geometry
geom
:
bs
.
getGeometries
())
{
for
(
Polygon
p
:
geom
.
getPolygons
())
{
p
.
setPartOfSurface
(
bs
);
}
}
}
for
(
BuildingInstallationProperty
biProp
:
gmlBr
.
getBuildingInstallations
())
{
var
gmlBi
=
biProp
.
getObject
();
if
(
gmlBi
==
null
)
{
// ignore empty properties
continue
;
}
Installation
bi
=
mapBuildingInstallation
(
gmlBi
);
br
.
addRoomInstallation
(
bi
);
}
for
(
BuildingFurnitureProperty
bfProp
:
gmlBr
.
getBuildingFurniture
()){
var
gmlHref
=
bfProp
.
getHref
();
if
(
gmlHref
==
null
)
{
continue
;
}
br
.
addFurnitureRef
(
bfProp
);
}
return
br
;
}
private
BuildingRoomFurniture
mapBuildingFurniture
(
BuildingFurniture
gmlAF
){
BuildingRoomFurniture
bf
=
new
BuildingRoomFurniture
();
bf
.
setGmlObject
(
gmlAF
);
mapAbstractOccupiedSpace
(
gmlAF
,
bf
);
bf
.
unsetGmlGeometries
();
SurfaceMapper
surfaceMapper
=
new
SurfaceMapper
(
polygonMap
,
references
,
vertexMap
,
config
);
for
(
AbstractSpaceBoundaryProperty
surfaceProp
:
gmlAF
.
getBoundaries
())
{
if
(!
surfaceProp
.
isSetObject
())
{
continue
;
}
AbstractSpaceBoundary
surface
=
surfaceProp
.
getObject
();
surface
.
accept
(
surfaceMapper
);
}
for
(
BoundarySurface
bs
:
surfaceMapper
.
getSurfaces
())
{
bf
.
addBoundarySurface
(
bs
);
for
(
Geometry
geom
:
bs
.
getGeometries
())
{
for
(
Polygon
p
:
geom
.
getPolygons
())
{
p
.
setPartOfSurface
(
bs
);
}
}
}
return
bf
;
}
}
private
void
updatePartOfSurface
(
AbstractBuilding
cdBuilding
,
SurfaceMapper
surfaceMapper
)
{
private
void
updatePartOfSurface
(
AbstractBuilding
cdBuilding
,
SurfaceMapper
surfaceMapper
)
{
...
...
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