/// <summary> /// Collect edges from Area inputs which should be in the result but /// which have not been included in a result area. /// This happens ONLY: /// during an intersection when the boundaries of two /// areas touch in a line segment /// OR as a result of a dimensional collapse. /// </summary> /// <param name="de"></param> /// <param name="opCode"></param> /// <param name="edges"></param> public void CollectBoundaryTouchEdge(DirectedEdge de, SpatialFunctions opCode, IList edges) { Label label = de.Label; if (de.IsLineEdge) { return; // only interested in area edges } if (de.IsVisited) { return; // already processed } if (de.IsInteriorAreaEdge) { return; // added to handle dimensional collapses } if (de.Edge.IsInResult) { return; // if the edge linework is already included, don't include it again } // sanity check for labelling of result edgerings Assert.IsTrue(!(de.IsInResult || de.Sym.IsInResult) || !de.Edge.IsInResult); // include the linework if it's in the result of the operation if (OverlayOp.IsResultOfOp(label, opCode) && opCode == SpatialFunctions.Intersection) { edges.Add(de.Edge); de.VisitedEdge = true; } }
/// <summary> /// /// </summary> /// <param name="geom0"></param> /// <param name="geom1"></param> /// <param name="opCode"></param> /// <returns></returns> public static IGeometry Overlay(IGeometry geom0, IGeometry geom1, SpatialFunctions opCode) { OverlayOp gov = new OverlayOp(geom0, geom1); IGeometry geomOv = gov.GetResultGeometry(opCode); return(geomOv); }
/// <summary> /// /// </summary> /// <param name="de"></param> /// <param name="opCode"></param> /// <param name="edges"></param> public void CollectLineEdge(DirectedEdge de, SpatialFunctions opCode, IList edges) { Label label = de.Label; Edge e = de.Edge; // include Curve edges which are in the result if (de.IsLineEdge) { if (!de.IsVisited && OverlayOp.IsResultOfOp(label, opCode) && !e.IsCovered) { edges.Add(e); de.VisitedEdge = true; } } }
/// <summary> /// /// </summary> /// <param name="opCode"></param> /// <returns></returns> private IList CollectNodes(SpatialFunctions opCode) { IList resultNodeList = new ArrayList(); // add nodes from edge intersections which have not already been included in the result IEnumerator nodeit = op.Graph.Nodes.GetEnumerator(); while (nodeit.MoveNext()) { Node n = (Node)nodeit.Current; if (!n.IsInResult) { Label label = n.Label; if (OverlayOp.IsResultOfOp(label, opCode)) { resultNodeList.Add(n); } } } return(resultNodeList); }
/// <summary> /// /// </summary> /// <param name="geom0"></param> /// <param name="geom1"></param> /// <param name="opCode"></param> /// <returns></returns> public static IGeometry Overlay(IGeometry geom0, IGeometry geom1, SpatialFunctions opCode) { OverlayOp gov = new OverlayOp(geom0, geom1); IGeometry geomOv = gov.GetResultGeometry(opCode); return geomOv; }
/// <summary> /// /// </summary> /// <param name="op"></param> /// <param name="geometryFactory"></param> /// <param name="ptLocator"></param> public PointBuilder(OverlayOp op, IGeometryFactory geometryFactory, PointLocator ptLocator) { this.op = op; this.geometryFactory = geometryFactory; this.ptLocator = ptLocator; }