コード例 #1
0
ファイル: DTSweep.cs プロジェクト: yuruyigit/TrueSync
        private static void FillBasin(DTSweepContext tcx, AdvancingFrontNode node)
        {
            bool flag = TriangulationUtil.Orient2d(node.Point, node.Next.Point, node.Next.Next.Point) == Orientation.CCW;

            if (flag)
            {
                tcx.Basin.leftNode = node;
            }
            else
            {
                tcx.Basin.leftNode = node.Next;
            }
            tcx.Basin.bottomNode = tcx.Basin.leftNode;
            while (tcx.Basin.bottomNode.HasNext && tcx.Basin.bottomNode.Point.Y >= tcx.Basin.bottomNode.Next.Point.Y)
            {
                tcx.Basin.bottomNode = tcx.Basin.bottomNode.Next;
            }
            bool flag2 = tcx.Basin.bottomNode == tcx.Basin.leftNode;

            if (!flag2)
            {
                tcx.Basin.rightNode = tcx.Basin.bottomNode;
                while (tcx.Basin.rightNode.HasNext && tcx.Basin.rightNode.Point.Y < tcx.Basin.rightNode.Next.Point.Y)
                {
                    tcx.Basin.rightNode = tcx.Basin.rightNode.Next;
                }
                bool flag3 = tcx.Basin.rightNode == tcx.Basin.bottomNode;
                if (!flag3)
                {
                    tcx.Basin.width       = tcx.Basin.rightNode.Point.X - tcx.Basin.leftNode.Point.X;
                    tcx.Basin.leftHighest = (tcx.Basin.leftNode.Point.Y > tcx.Basin.rightNode.Point.Y);
                    DTSweep.FillBasinReq(tcx, tcx.Basin.bottomNode);
                }
            }
        }
コード例 #2
0
ファイル: DTSweep.cs プロジェクト: yuruyigit/TrueSync
        private static void FillBasinReq(DTSweepContext tcx, AdvancingFrontNode node)
        {
            bool flag = DTSweep.IsShallow(tcx, node);

            if (!flag)
            {
                DTSweep.Fill(tcx, node);
                bool flag2 = node.Prev == tcx.Basin.leftNode && node.Next == tcx.Basin.rightNode;
                if (!flag2)
                {
                    bool flag3 = node.Prev == tcx.Basin.leftNode;
                    if (flag3)
                    {
                        Orientation orientation = TriangulationUtil.Orient2d(node.Point, node.Next.Point, node.Next.Next.Point);
                        bool        flag4       = orientation == Orientation.CW;
                        if (flag4)
                        {
                            return;
                        }
                        node = node.Next;
                    }
                    else
                    {
                        bool flag5 = node.Next == tcx.Basin.rightNode;
                        if (flag5)
                        {
                            Orientation orientation2 = TriangulationUtil.Orient2d(node.Point, node.Prev.Point, node.Prev.Prev.Point);
                            bool        flag6        = orientation2 == Orientation.CCW;
                            if (flag6)
                            {
                                return;
                            }
                            node = node.Prev;
                        }
                        else
                        {
                            bool flag7 = node.Prev.Point.Y < node.Next.Point.Y;
                            if (flag7)
                            {
                                node = node.Prev;
                            }
                            else
                            {
                                node = node.Next;
                            }
                        }
                    }
                    DTSweep.FillBasinReq(tcx, node);
                }
            }
        }