示例#1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="cpBBTree"></param>
        /// <param name="value"></param>

        public Leaf(cpBBTree tree, IObjectBox obj)
            : base()
        {
            this.obj = obj;             //THIS IS THE GENERIC REAL VALUE

            tree.GetBB(obj, this);

            this.parent = null;

            this.STAMP = 1;
            this.PAIRS = null;

            cp.numLeaves++;
        }
示例#2
0
        public bool Update(cpBBTree tree)
        {
            var root = tree.root;

            var obj = this.obj;

            if (!this.ContainsObj(obj))
            {
                this.bb = tree.GetBB(this.obj);

                root      = tree.SubtreeRemove(root, this);
                tree.root = tree.SubtreeInsert(root, this);                //tree.root = SubtreeInsert(root, this, tree);
                this.ClearPairs(tree);
                this.stamp = tree.GetStamp();

                return(true);
            }
            return(false);
        }