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 { ...@@ -538,60 +538,45 @@ public class HealerController {
} }
public void injectSolid(boolean useBs, boolean useBi, boolean useLod2, boolean useLod3, boolean useLod4) { public void injectSolid(boolean useBs, boolean useBi, boolean useLod2, boolean useLod3, boolean useLod4) {
if (model == null || currentFeature == null) { // if (model == null || currentFeature == null) {
return; // return;
} // }
CityObject oldFeature = currentFeature;
currentFeature.prepareForChecking(); for (Building b : model.getBuildings()) {
if (currentFeature instanceof BoundarySurface) { // collect polygons
BoundarySurface surface = (BoundarySurface) currentFeature; Map<Lod, List<Polygon>> availablePolygons = new EnumMap<>(Lod.class);
currentFeature = surface.getParent(); Map<Lod, Set<Polygon>> existingPolygons = new EnumMap<>(Lod.class);
} collectPolygons(useBs, useBi, availablePolygons, existingPolygons, b);
if (!(currentFeature instanceof Building)) { if (useLod2) {
return; insertSolidGeometry(availablePolygons, b, existingPolygons, Lod.LOD2);
} }
// collect polygons if (useLod3) {
Map<Lod, List<Polygon>> availablePolygons = new EnumMap<>(Lod.class); insertSolidGeometry(availablePolygons, b, existingPolygons, Lod.LOD3);
Map<Lod, Set<Polygon>> existingPolygons = new EnumMap<>(Lod.class); }
Building b = (Building) currentFeature; if (useLod4) {
collectPolygons(useBs, useBi, availablePolygons, existingPolygons, b); insertSolidGeometry(availablePolygons, b, existingPolygons, Lod.LOD4);
if (useLod2) { }
insertSolidGeometry(availablePolygons, b, existingPolygons, Lod.LOD2); for (BuildingPart part : b.getBuildingParts()) {
} // collect polygons
if (useLod3) { availablePolygons = new EnumMap<>(Lod.class);
insertSolidGeometry(availablePolygons, b, existingPolygons, Lod.LOD3); existingPolygons = new EnumMap<>(Lod.class);
} collectPolygons(useBs, useBi, availablePolygons, existingPolygons, part);
if (useLod4) { if (useLod2) {
insertSolidGeometry(availablePolygons, b, existingPolygons, Lod.LOD4); 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, 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) { if (useBs) {
collectPolygons(availablePolygons, b.getBoundarySurfaces()); collectPolygons(availablePolygons, b.getBoundarySurfaces());
} }
...@@ -604,13 +589,13 @@ public class HealerController { ...@@ -604,13 +589,13 @@ public class HealerController {
collectPolygons(availablePolygons, bi.getBoundarySurfaces()); collectPolygons(availablePolygons, bi.getBoundarySurfaces());
} }
} }
for (Geometry geom : b.getGeometries()) { // for (Geometry geom : b.getGeometries()) {
Set<Polygon> polygons = existingPolygons.computeIfAbsent(geom.getLod(), l -> new HashSet<>()); // Set<Polygon> polygons = existingPolygons.computeIfAbsent(geom.getLod(), l -> new HashSet<>());
polygons.addAll(geom.getPolygons()); // 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) { Map<Lod, Set<Polygon>> existingPolygons, Lod lod) {
List<Polygon> newPolygons = availablePolygons.get(lod); List<Polygon> newPolygons = availablePolygons.get(lod);
if (newPolygons != null) { if (newPolygons != null) {
...@@ -689,9 +674,7 @@ public class HealerController { ...@@ -689,9 +674,7 @@ public class HealerController {
// triangle area is too small, ignore // triangle area is too small, ignore
return; return;
} }
for (Building b : model.getBuildings()) { model.getBuildings().forEach(building -> MeshGenerator.replaceGeometryWithMeshedGeometry(building, area));
MeshGenerator.replaceGeometryWithMeshedGeometry(b, area);
}
} catch (NumberFormatException e) { } catch (NumberFormatException e) {
// no real number was inserted, do nothing // no real number was inserted, do nothing
} }
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>de.hft.stuttgart</groupId> <groupId>de.hft.stuttgart</groupId>
<artifactId>CityDoctorParent</artifactId> <artifactId>CityDoctorParent</artifactId>
<version>3.17.3</version> <version>3.18.0</version>
<relativePath>../../pom.xml</relativePath> <relativePath>../../pom.xml</relativePath>
</parent> </parent>
<artifactId>CityDoctorHealerGenetic</artifactId> <artifactId>CityDoctorHealerGenetic</artifactId>
......
...@@ -329,7 +329,7 @@ public class GeneticsGUI extends View { ...@@ -329,7 +329,7 @@ public class GeneticsGUI extends View {
parserConfig); parserConfig);
currentChecker = new Checker(model1); currentChecker = new Checker(model1);
currentChecker.runChecks(); currentChecker.runChecks();
Building building = model1.getBuildings().get(0); Building building = model1.getBuildings().toList().getFirst();
currentGeometry = building.getGeometries().get(0); currentGeometry = building.getGeometries().get(0);
currentFeature = building; currentFeature = building;
showCurrentGeometry(); showCurrentGeometry();
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>de.hft.stuttgart</groupId> <groupId>de.hft.stuttgart</groupId>
<artifactId>CityDoctorParent</artifactId> <artifactId>CityDoctorParent</artifactId>
<version>3.17.3</version> <version>3.18.0</version>
<packaging>pom</packaging> <packaging>pom</packaging>
<name>CityDoctorParent</name> <name>CityDoctorParent</name>
<properties> <properties>
...@@ -242,6 +242,21 @@ ...@@ -242,6 +242,21 @@
<artifactId>earcut4j</artifactId> <artifactId>earcut4j</artifactId>
<version>2.2.2</version> <version>2.2.2</version>
</dependency> </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> </dependencies>
</dependencyManagement> </dependencyManagement>
<dependencies> <dependencies>
...@@ -267,6 +282,17 @@ ...@@ -267,6 +282,17 @@
<groupId>info.picocli</groupId> <groupId>info.picocli</groupId>
<artifactId>picocli</artifactId> <artifactId>picocli</artifactId>
</dependency> </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> </dependencies>
<modules> <modules>
<!--CityDoctor2 Core Modules--> <!--CityDoctor2 Core Modules-->
...@@ -277,10 +303,10 @@ ...@@ -277,10 +303,10 @@
<!--CityDoctor2 Extension Modules--> <!--CityDoctor2 Extension Modules-->
<module>Extensions/CityDoctorGUI</module> <module>Extensions/CityDoctorGUI</module>
<module>Extensions/CityDoctorAutoPro</module> <!-- <module>Extensions/CityDoctorAutoPro</module>-->
<module>Extensions/CityDoctorHealer</module> <!-- <module>Extensions/CityDoctorHealer</module>-->
<module>Extensions/CityDoctorHealerGenetic</module> <!-- <module>Extensions/CityDoctorHealerGenetic</module>-->
<module>Extensions/CityDoctorHealerGUI</module> <!-- <module>Extensions/CityDoctorHealerGUI</module>-->
</modules> </modules>
</project> </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