public class Octree extends Object
| 限定符和类型 | 类和说明 |
|---|---|
class |
Octree.OctreeNode |
| 限定符和类型 | 字段和说明 |
|---|---|
protected Map<Long,Octree.OctreeNode> |
octreeIndices
used to find an octree node by its index
the index of an octree node is generated according to its spatial position
|
protected List<javax.vecmath.Point3d> |
points |
protected Octree.OctreeNode |
root
the root node of the octree,
the size of root node is the bounding box of point cloud
|
| 构造器和说明 |
|---|
Octree() |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
buildIndex(List<javax.vecmath.Point3d> points)
build spatial index for point cloud
note that the length double array in List points must be 3
|
protected Long |
locateOctreeNode(Octree.OctreeNode node,
javax.vecmath.Point3d point)
find the index of octree node in which the target point is located
|
int[] |
searchNearestNeighbors(int k,
int index)
If you want to acquire the k-nearest neighbors of a certain point p, call this function,
octree will decrease the time cost
|
int[] |
searchNearestNeighbors(int k,
javax.vecmath.Point3d point) |
List<Integer> |
searchNeighborsInSphere(int index,
double radius) |
List<Integer> |
searchNeighborsInSphere(javax.vecmath.Point3d point,
double radius) |
void |
setMaxPointsPerNode(int m) |
protected Octree.OctreeNode root
protected List<javax.vecmath.Point3d> points
protected Map<Long,Octree.OctreeNode> octreeIndices
public void buildIndex(List<javax.vecmath.Point3d> points)
points - the point cloudpublic int[] searchNearestNeighbors(int k,
int index)
k - the number of nearest neighborsindex - the index of point ppublic int[] searchNearestNeighbors(int k,
javax.vecmath.Point3d point)
protected Long locateOctreeNode(Octree.OctreeNode node, javax.vecmath.Point3d point)
node - the root octree nodepoint - the target pointpublic List<Integer> searchNeighborsInSphere(javax.vecmath.Point3d point, double radius)
public List<Integer> searchNeighborsInSphere(int index, double radius)
index - the index of a pointradius - radius of neighborhoodpublic void setMaxPointsPerNode(int m)
Copyright © 2019. All rights reserved.