Commit 0e9da374 authored by Matthias Betz's avatar Matthias Betz
Browse files

create missing links to boundary surface and building installation if polygon is linked from solid

parent f5bc6be3
Pipeline #4373 passed with stage
in 2 minutes and 25 seconds
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
*/ */
package de.hft.stuttgart.citydoctor2.datastructure; package de.hft.stuttgart.citydoctor2.datastructure;
import java.util.Collection;
import java.util.List; import java.util.List;
import de.hft.stuttgart.citydoctor2.math.Vector3d; import de.hft.stuttgart.citydoctor2.math.Vector3d;
...@@ -39,7 +40,7 @@ public class BoundingBox { ...@@ -39,7 +40,7 @@ public class BoundingBox {
* @param polygons containing the points from which the box will be created * @param polygons containing the points from which the box will be created
* @return the bounding box around all points * @return the bounding box around all points
*/ */
public static BoundingBox of(List<Polygon> polygons) { public static BoundingBox of(Collection<? extends Polygon> polygons) {
return BoundingBoxCalculator.calculateBoundingBox(polygons); return BoundingBoxCalculator.calculateBoundingBox(polygons);
} }
......
...@@ -150,8 +150,16 @@ public class FeatureMapper extends FeatureWalker { ...@@ -150,8 +150,16 @@ public class FeatureMapper extends FeatureWalker {
} }
continue; continue;
} }
LinkedPolygon lPoly = new LinkedPolygon(concPoly, link.getValue1()); Geometry geom = link.getValue1();
link.getValue1().addPolygon(lPoly); LinkedPolygon lPoly = new LinkedPolygon(concPoly, geom);
if (geom.getParent() instanceof BoundarySurface) {
BoundarySurface bs = (BoundarySurface) geom.getParent();
lPoly.setPartOfSurface(bs);
if (bs.getParent() instanceof BuildingInstallation) {
lPoly.setPartOfInstallation((BuildingInstallation) bs.getParent());
}
}
geom.addPolygon(lPoly);
} }
} }
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
*/ */
package de.hft.stuttgart.citydoctor2.utils; package de.hft.stuttgart.citydoctor2.utils;
import java.util.Collection;
import java.util.List; import java.util.List;
import de.hft.stuttgart.citydoctor2.datastructure.BoundingBox; import de.hft.stuttgart.citydoctor2.datastructure.BoundingBox;
...@@ -51,7 +52,7 @@ public class BoundingBoxCalculator { ...@@ -51,7 +52,7 @@ public class BoundingBoxCalculator {
* @param a list of polygons containing the vertices * @param a list of polygons containing the vertices
* @return an BoundingBox containing the two end points of the bounding box. * @return an BoundingBox containing the two end points of the bounding box.
*/ */
public static BoundingBox calculateBoundingBox(List<Polygon> polygons) { public static BoundingBox calculateBoundingBox(Collection<? extends Polygon> polygons) {
double lowX = Double.MAX_VALUE; double lowX = Double.MAX_VALUE;
double highX = Double.NEGATIVE_INFINITY; double highX = Double.NEGATIVE_INFINITY;
double lowY = Double.MAX_VALUE; double lowY = Double.MAX_VALUE;
......
Markdown is supported
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