org.osm2world.core.terrain.creation
Class CAGUtil

Object
  extended by CAGUtil

public final class CAGUtil
extends Object

utility class for Constructive Area Geometry (CAG), boolean operations on areas


Method Summary
static Collection<PolygonWithHolesXZ> intersectPolygons(List<? extends SimplePolygonXZ> intersectPolygons)
          calculates the intersection area of a collection of polygons.
static Collection<PolygonWithHolesXZ> subtractPolygons(SimplePolygonXZ basePolygon, List<? extends SimplePolygonXZ> subtractPolygons)
          takes a polygon outline, "subtracts" a collection of other polygon outlines, and returns a collection of polygons that covers the difference area.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

subtractPolygons

public static final Collection<PolygonWithHolesXZ> subtractPolygons(SimplePolygonXZ basePolygon,
                                                                    List<? extends SimplePolygonXZ> subtractPolygons)
takes a polygon outline, "subtracts" a collection of other polygon outlines, and returns a collection of polygons that covers the difference area. The result polygons should cover the area that was within the original polygon (excluding its holes), but not within a subtracted polygon.

Returns:
polygons without self-intersections, but maybe with holes

intersectPolygons

public static final Collection<PolygonWithHolesXZ> intersectPolygons(List<? extends SimplePolygonXZ> intersectPolygons)
calculates the intersection area of a collection of polygons. The result polygons should cover the area that was within all of the polygons.