Exemplo n.º 1
0
        private static bool IsEdgeSideOfTriangle(DelaunayTriangle triangle, TriangulationPoint ep, TriangulationPoint eq)
        {
            int index = triangle.EdgeIndex(ep, eq);

            if (index == -1)
            {
                return(false);
            }
            triangle.MarkConstrainedEdge(index);
            triangle = triangle.Neighbors[index];
            if (triangle != null)
            {
                triangle.MarkConstrainedEdge(ep, eq);
            }
            return(true);
        }
Exemplo n.º 2
0
        private static DelaunayTriangle NextFlipTriangle(DTSweepContext tcx, Orientation o, DelaunayTriangle t, DelaunayTriangle ot, TriangulationPoint p, TriangulationPoint op)
        {
            int edgeIndex;

            if (o == Orientation.CCW)
            {
                edgeIndex = ot.EdgeIndex(p, op);
                ot.EdgeIsDelaunay[edgeIndex] = true;
                Legalize(tcx, ot);
                ot.EdgeIsDelaunay.Clear();
                return(t);
            }
            edgeIndex = t.EdgeIndex(p, op);
            t.EdgeIsDelaunay[edgeIndex] = true;
            Legalize(tcx, t);
            t.EdgeIsDelaunay.Clear();
            return(ot);
        }