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; }
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); } } } }
/// <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); } } } }
public void ClearOcTree() { branches = null; subdivided = false; }