private static AdvancingFrontNode PointEvent(DTSweepContext tcx, TriangulationPoint point) { AdvancingFrontNode advancingFrontNode = tcx.LocateNode(point); AdvancingFrontNode advancingFrontNode2 = DTSweep.NewFrontTriangle(tcx, point, advancingFrontNode); bool flag = point.X <= advancingFrontNode.Point.X + TriangulationUtil.EPSILON; if (flag) { DTSweep.Fill(tcx, advancingFrontNode); } tcx.AddNode(advancingFrontNode2); DTSweep.FillAdvancingFront(tcx, advancingFrontNode2); return(advancingFrontNode2); }
/// <summary> /// Find closes node to the left of the new point and /// create a new triangle. If needed new holes and basins /// will be filled to. /// </summary> private static AdvancingFrontNode PointEvent(DTSweepContext tcx, TriangulationPoint point) { AdvancingFrontNode node = tcx.LocateNode(point); AdvancingFrontNode newNode = NewFrontTriangle(tcx, point, node); // Only need to check +epsilon since point never have smaller // x value than node due to how we fetch nodes from the front if (point.X <= node.Point.X + TriangulationUtil.EPSILON) { Fill(tcx, node); } tcx.AddNode(newNode); FillAdvancingFront(tcx, newNode); return(newNode); }