|
| | OCTree ()=default |
| | OCTree (Points pts, int bucket_size=32) |
| void | rebuild (Points pts, int bucket_size=-1) |
| void | find_neighbors_kd (const Vector3d &pt, int k, std::vector< int > &idxs, std::vector< double > &distsq, double cutoff=-1) const |
| void | find_neighbors_d (const Vector3d &pt, double cutoff, std::vector< int > &idxs, std::vector< double > &distsq) const |
| void | find_neighbors_tree (const OCTree &oct, double cutoff, std::vector< int > &self, std::vector< int > &other) const |
| std::vector< std::vector< int > > | find_neighbors_tree (const OCTree &oct, double cutoff) const |
| void | find_neighbors_self (double cutoff, std::vector< int > &left, std::vector< int > &right) const |
| const Matrix3Xd & | pts () const |
| const Vector3d & | max () const |
| const Vector3d & | len () const |
| void | notify_transform (const Vector3d &new_max, const Vector3d &new_len) |
| | Notify the octree that the point set has been transformed by scaling and/or translation.
|
| const std::vector< internal::OCTreeNode > & | nodes () const |
| int | size () const |
| int | root () const |
| int | bucket_size () const |
| const ArrayXi & | idxs () const |
| const internal::OCTreeNode & | node (int i) const |
| const internal::OCTreeNode & | operator[] (int idx) const |
An octree implementation for 3D point clouds.
The octree partitions 3D space into axis-aligned boxes recursively, allowing efficient spatial queries such as nearest neighbor search.
This implementation is designed for static point clouds. To update the point set, one must rebuild(const MatrixLike &) the octree.
One notable exception is that if the points are only scaled uniformly in each axis and/or translated in any order, the octree can still be used without rebuilding, due to the axis-aligned nature of the octree. Note that, however, it is the user's responsibility to ensure that the points are "correctly" transformed separately from the octree; otherwise, the behavior is undefined.