public void MarkEdge(DelaunayTriangle triangle) { for (int i = 0; i < 3; i++) { if (EdgeIsConstrained[i]) { triangle.MarkConstrainedEdge(Points[(i + 1) % 3], Points[(i + 2) % 3]); } } }
private static void FlipEdgeEvent(DTSweepContext tcx, PolygonPoint ep, PolygonPoint eq, DelaunayTriangle t, PolygonPoint p) { DelaunayTriangle ot = t.NeighborAcrossFrom(p); PolygonPoint op = ot.OppositePoint(t, p); if (ot == null) { // If we want to integrate the fillEdgeEvent do it here // With current implementation we should never get here throw new InvalidOperationException("[BUG:FIXME] FLIP failed due to missing triangle"); } bool inScanArea = TriangulationUtil.InScanArea(p, t.PointCCWFrom(p), t.PointCWFrom(p), op); if (inScanArea) { // Lets rotate shared edge one vertex CW RotateTrianglePair(t, p, ot, op); tcx.MapTriangleToNodes(t); tcx.MapTriangleToNodes(ot); if (p == eq && op == ep) { if (eq == tcx.EdgeEvent.ConstrainedEdge.Q && ep == tcx.EdgeEvent.ConstrainedEdge.P) { t.MarkConstrainedEdge(ep, eq); ot.MarkConstrainedEdge(ep, eq); Legalize(tcx, t); Legalize(tcx, ot); } else { // XXX: I think one of the triangles should be legalized here? } } else { Orientation o = TriangulationUtil.Orient2D(eq, op, ep); t = NextFlipTriangle(tcx, o, t, ot, p, op); FlipEdgeEvent(tcx, ep, eq, t, p); } } else { PolygonPoint newP = NextFlipPoint(ep, eq, ot, op); FlipScanEdgeEvent(tcx, ep, eq, t, ot, newP); EdgeEvent(tcx, ep, eq, t, p); } }
public void MarkEdge( DelaunayTriangle triangle ) { for( int i = 0; i < 3; i++ ) if( edgeIsConstrained[i] ) { triangle.MarkConstrainedEdge( points[( i + 1 ) % 3], points[( i + 2 ) % 3] ); } }