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 @@
*/
package de.hft.stuttgart.citydoctor2.datastructure;
import java.util.Collection;
import java.util.List;
import de.hft.stuttgart.citydoctor2.math.Vector3d;
......@@ -39,7 +40,7 @@ public class BoundingBox {
* @param polygons containing the points from which the box will be created
* @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);
}
......
......@@ -150,8 +150,16 @@ public class FeatureMapper extends FeatureWalker {
}
continue;
}
LinkedPolygon lPoly = new LinkedPolygon(concPoly, link.getValue1());
link.getValue1().addPolygon(lPoly);
Geometry geom = link.getValue1();
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 @@
*/
package de.hft.stuttgart.citydoctor2.utils;
import java.util.Collection;
import java.util.List;
import de.hft.stuttgart.citydoctor2.datastructure.BoundingBox;
......@@ -51,7 +52,7 @@ public class BoundingBoxCalculator {
* @param a list of polygons containing the vertices
* @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 highX = Double.NEGATIVE_INFINITY;
double lowY = Double.MAX_VALUE;
......
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