コード例 #1
0
 public OcTreeBranch(BoundingBox bb, PointCloud <J> pcl, OcTreeBranch <J> parent, int depth)
 {
     this.bb     = bb;
     this.points = pcl;
     indices     = new List <int>();
     branchDepth = depth;
     this.parent = parent;
 }
コード例 #2
0
                public void TrySubdivide()
                {
                    if (subdivided)
                    {
                        return;
                    }
                    subdivided = true;

                    branches = new OcTreeBranch <J> [2, 2, 2];
                    for (int x = 0; x < 2; ++x)
                    {
                        for (int y = 0; y < 2; ++y)
                        {
                            for (int z = 0; z < 2; ++z)
                            {
                                branches[x, y, z] = new OcTreeBranch <J>(bb.GetOctantBoundingBox(x, y, z), points, this, branchDepth + 1);
                            }
                        }
                    }
                }
コード例 #3
0
            /// <summary>
            /// try to subdivide octree. Only succeeds if not already subdivided
            /// </summary>
            public void TrySubdivide()
            {
                if (subdivided)
                {
                    return;
                }

                subdivided = true;

                branches = new OcTreeBranch <T> [2, 2, 2];
                for (int x = 0; x < 2; ++x)
                {
                    for (int y = 0; y < 2; ++y)
                    {
                        for (int z = 0; z < 2; ++z)
                        {
                            branches[x, y, z] = new OcTreeBranch <T>(rootBB_.GetOctantBoundingBox(x, y, z), Cloud, null, 1);
                        }
                    }
                }
            }
コード例 #4
0
 public void ClearOcTree()
 {
     branches   = null;
     subdivided = false;
 }