示例#1
0
        private static void pushSubHullDown(RedBlackNode current, bool isLeftHalf)
        {
            if (current != null && !current.IsLeaf && current.GetConvexHull(isLeftHalf) != null)
            {
                Treap <Point> leftHalf;
                Treap <Point> rightHalf;
                Treap <Point> .SplitBySize(current.GetConvexHull(isLeftHalf), current.GeLowerSubHullSize(isLeftHalf), out leftHalf, out rightHalf);

                current.Left.SetConvexHull(isLeftHalf, Treap <Point> .Merge(leftHalf, current.Left.GetConvexHull(isLeftHalf)));
                current.Right.SetConvexHull(isLeftHalf, Treap <Point> .Merge(current.Right.GetConvexHull(isLeftHalf), rightHalf));

                current.SetConvexHull(isLeftHalf, null);
            }
        }