Commit 5571f382 authored by Luna Riegel's avatar Luna Riegel
Browse files

Merge branch 'dev' into 'master'

CityDoctor Version 3.18.0

See merge request !37
parents 87dba3fa 61859d4f
Pipeline #12247 passed with stage
in 2 minutes and 31 seconds
......@@ -538,60 +538,45 @@ public class HealerController {
}
public void injectSolid(boolean useBs, boolean useBi, boolean useLod2, boolean useLod3, boolean useLod4) {
if (model == null || currentFeature == null) {
return;
}
CityObject oldFeature = currentFeature;
currentFeature.prepareForChecking();
if (currentFeature instanceof BoundarySurface) {
BoundarySurface surface = (BoundarySurface) currentFeature;
currentFeature = surface.getParent();
}
if (!(currentFeature instanceof Building)) {
return;
}
// collect polygons
Map<Lod, List<Polygon>> availablePolygons = new EnumMap<>(Lod.class);
Map<Lod, Set<Polygon>> existingPolygons = new EnumMap<>(Lod.class);
Building b = (Building) currentFeature;
collectPolygons(useBs, useBi, availablePolygons, existingPolygons, b);
if (useLod2) {
insertSolidGeometry(availablePolygons, b, existingPolygons, Lod.LOD2);
}
if (useLod3) {
insertSolidGeometry(availablePolygons, b, existingPolygons, Lod.LOD3);
}
if (useLod4) {
insertSolidGeometry(availablePolygons, b, existingPolygons, Lod.LOD4);
// if (model == null || currentFeature == null) {
// return;
// }
for (Building b : model.getBuildings()) {
// collect polygons
Map<Lod, List<Polygon>> availablePolygons = new EnumMap<>(Lod.class);
Map<Lod, Set<Polygon>> existingPolygons = new EnumMap<>(Lod.class);
collectPolygons(useBs, useBi, availablePolygons, existingPolygons, b);
if (useLod2) {
insertSolidGeometry(availablePolygons, b, existingPolygons, Lod.LOD2);
}
if (useLod3) {
insertSolidGeometry(availablePolygons, b, existingPolygons, Lod.LOD3);
}
if (useLod4) {
insertSolidGeometry(availablePolygons, b, existingPolygons, Lod.LOD4);
}
for (BuildingPart part : b.getBuildingParts()) {
// collect polygons
availablePolygons = new EnumMap<>(Lod.class);
existingPolygons = new EnumMap<>(Lod.class);
collectPolygons(useBs, useBi, availablePolygons, existingPolygons, part);
if (useLod2) {
insertSolidGeometry(availablePolygons, part, existingPolygons, Lod.LOD2);
}
if (useLod3) {
insertSolidGeometry(availablePolygons, part, existingPolygons, Lod.LOD3);
}
if (useLod4) {
insertSolidGeometry(availablePolygons, part, existingPolygons, Lod.LOD4);
}
}
}
nextFeature = null;
nextGeometry = null;
Lod lod = currentGeometry.getLod();
GeometryType type = GeometryType.SOLID;
currentGeometry = Objects.requireNonNull(currentFeature.getGeometry(type, lod));
checker.executeChecksForCheckable(currentFeature);
healerView.getNextErrorList().getItems().clear();
healerView.getNextMeshGroup().getChildren().clear();
updateCurrentErrors();
currentTriangulatedGeometry = TriangulatedGeometry.of(currentGeometry);
currentErrorVisitor.setGeometry(currentTriangulatedGeometry);
currentTriangulatedGeometry.setCullFace(culling);
currentTriangulatedGeometry.setDrawMode(drawMode);
healerView.zoomOutForBoundingBox(currentGeometry.calculateBoundingBox());
healerView.getCurrentMeshGroup().getChildren().clear();
healerView.getCurrentMeshGroup().getChildren().addAll(currentTriangulatedGeometry.getMeshes());
healerView.getNextStepBtn().setDisable(false);
healerView.getHealCompleteBtn().setDisable(false);
healerView.getAcceptBtn().setDisable(true);
healerView.getCancelBtn().setDisable(true);
healerView.getSolidInjectorBtn().setDisable(true);
currentFeature = oldFeature;
}
private void collectPolygons(boolean useBs, boolean useBi, Map<Lod, List<Polygon>> availablePolygons,
Map<Lod, Set<Polygon>> existingPolygons, Building b) {
Map<Lod, Set<Polygon>> existingPolygons, AbstractBuilding b) {
if (useBs) {
collectPolygons(availablePolygons, b.getBoundarySurfaces());
}
......@@ -604,13 +589,13 @@ public class HealerController {
collectPolygons(availablePolygons, bi.getBoundarySurfaces());
}
}
for (Geometry geom : b.getGeometries()) {
Set<Polygon> polygons = existingPolygons.computeIfAbsent(geom.getLod(), l -> new HashSet<>());
polygons.addAll(geom.getPolygons());
}
// for (Geometry geom : b.getGeometries()) {
// Set<Polygon> polygons = existingPolygons.computeIfAbsent(geom.getLod(), l -> new HashSet<>());
// polygons.addAll(geom.getPolygons());
// }
}
private void insertSolidGeometry(Map<Lod, List<Polygon>> availablePolygons, Building b,
private void insertSolidGeometry(Map<Lod, List<Polygon>> availablePolygons, AbstractBuilding b,
Map<Lod, Set<Polygon>> existingPolygons, Lod lod) {
List<Polygon> newPolygons = availablePolygons.get(lod);
if (newPolygons != null) {
......@@ -689,9 +674,7 @@ public class HealerController {
// triangle area is too small, ignore
return;
}
for (Building b : model.getBuildings()) {
MeshGenerator.replaceGeometryWithMeshedGeometry(b, area);
}
model.getBuildings().forEach(building -> MeshGenerator.replaceGeometryWithMeshedGeometry(building, area));
} catch (NumberFormatException e) {
// no real number was inserted, do nothing
}
......
......@@ -4,7 +4,7 @@
<parent>
<groupId>de.hft.stuttgart</groupId>
<artifactId>CityDoctorParent</artifactId>
<version>3.17.3</version>
<version>3.18.0</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<artifactId>CityDoctorHealerGenetic</artifactId>
......
......@@ -329,7 +329,7 @@ public class GeneticsGUI extends View {
parserConfig);
currentChecker = new Checker(model1);
currentChecker.runChecks();
Building building = model1.getBuildings().get(0);
Building building = model1.getBuildings().toList().getFirst();
currentGeometry = building.getGeometries().get(0);
currentFeature = building;
showCurrentGeometry();
......
......@@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>de.hft.stuttgart</groupId>
<artifactId>CityDoctorParent</artifactId>
<version>3.17.3</version>
<version>3.18.0</version>
<packaging>pom</packaging>
<name>CityDoctorParent</name>
<properties>
......@@ -242,6 +242,21 @@
<artifactId>earcut4j</artifactId>
<version>2.2.2</version>
</dependency>
<dependency>
<groupId>org.orbisgis</groupId>
<artifactId>h2gis</artifactId>
<version>2.2.3</version>
</dependency>
<dependency>
<groupId>com.github.ben-manes.caffeine</groupId>
<artifactId>caffeine</artifactId>
<version>3.2.2</version>
</dependency>
<dependency>
<groupId>com.zaxxer</groupId>
<artifactId>HikariCP</artifactId>
<version>7.0.2</version>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
......@@ -267,6 +282,17 @@
<groupId>info.picocli</groupId>
<artifactId>picocli</artifactId>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j18-impl</artifactId>
<version>2.18.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<modules>
<!--CityDoctor2 Core Modules-->
......@@ -277,10 +303,10 @@
<!--CityDoctor2 Extension Modules-->
<module>Extensions/CityDoctorGUI</module>
<module>Extensions/CityDoctorAutoPro</module>
<module>Extensions/CityDoctorHealer</module>
<module>Extensions/CityDoctorHealerGenetic</module>
<module>Extensions/CityDoctorHealerGUI</module>
<!-- <module>Extensions/CityDoctorAutoPro</module>-->
<!-- <module>Extensions/CityDoctorHealer</module>-->
<!-- <module>Extensions/CityDoctorHealerGenetic</module>-->
<!-- <module>Extensions/CityDoctorHealerGUI</module>-->
</modules>
</project>
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment