Exemplo n.º 1
0
        //---------------------------------------------------------------------
        QuadNode <A> newQuadNode(_eQuadTreeLeaf leaf, QuadNodeObjectFactory <A> node_object_factory)
        {
            QuadNode <A> node = new QuadNode <A>();

            node.create(mDepth + 1, mQuadTree, (A)mArea.getArea(leaf), node_object_factory);
            return(node);
        }
Exemplo n.º 2
0
        //---------------------------------------------------------------------
        public void create(int depth, QuadTree <A> tree, A area, QuadNodeObjectFactory <A> node_object_factory)
        {
            mDepth    = depth;
            mQuadTree = tree;
            mArea     = area;

            if (mDepth < mQuadTree.MaxDepth)
            {
                mChildren = new QuadNode <A> [4];
                mChildren[(int)_eQuadTreeLeaf.UR] = newQuadNode(_eQuadTreeLeaf.UR, node_object_factory);
                mChildren[(int)_eQuadTreeLeaf.UL] = newQuadNode(_eQuadTreeLeaf.UL, node_object_factory);
                mChildren[(int)_eQuadTreeLeaf.LL] = newQuadNode(_eQuadTreeLeaf.LL, node_object_factory);
                mChildren[(int)_eQuadTreeLeaf.LR] = newQuadNode(_eQuadTreeLeaf.LR, node_object_factory);
            }
            else
            {
                mQuadNodeObject = node_object_factory.build();
                mQuadTree.addNode(this);
            }
        }
Exemplo n.º 3
0
 //---------------------------------------------------------------------
 public void create(int depth, A area, QuadNodeObjectFactory <A> node_object_factory)
 {
     mMaxDepth = depth;
     mRootNode = new QuadNode <A>();
     mRootNode.create(0, this, area, node_object_factory);
 }