Easy3D 2.6.1
|
KdTree implementation based on Richard Keiser's KdTree code. More...
#include <easy3d/kdtree/kdtree_search_eth.h>
Public Member Functions | |
KdTreeSearch_ETH (const PointCloud *cloud) | |
Constructor. | |
KdTreeSearch_ETH (const std::vector< vec3 > &points) | |
Constructor. | |
Closest point query | |
int | find_closest_point (const vec3 &p, float &squared_distance) const override |
Queries the closest point for a given point. | |
int | find_closest_point (const vec3 &p) const override |
Queries the closest point for a given point. | |
K nearest neighbors search | |
void | find_closest_k_points (const vec3 &p, int k, std::vector< int > &neighbors, std::vector< float > &squared_distances) const override |
Queries the K nearest neighbors for a given point. | |
void | find_closest_k_points (const vec3 &p, int k, std::vector< int > &neighbors) const override |
Queries the K nearest neighbors for a given point. | |
Fixed radius search | |
void | find_points_in_range (const vec3 &p, float squared_radius, std::vector< int > &neighbors, std::vector< float > &squared_distances) const override |
Queries the nearest neighbors within a fixed range. | |
void | find_points_in_range (const vec3 &p, float squared_radius, std::vector< int > &neighbors) const override |
Queries the nearest neighbors within a fixed range. | |
Cylinder range search | |
int | find_points_in_cylinder (const vec3 &p1, const vec3 &p2, float radius, std::vector< int > &neighbors, std::vector< float > &squared_distances, bool to_line=true) const |
Queries the nearest neighbors within a cylinder range. | |
int | find_points_in_cylinder (const vec3 &p1, const vec3 &p2, float radius, std::vector< int > &neighbors, bool to_line=true) const |
Queries the nearest neighbors within a cylinder range. | |
Cone range search | |
int | find_points_in_cone (const vec3 &eye, const vec3 &p1, const vec3 &p2, float angle_range, std::vector< int > &neighbors, std::vector< float > &squared_distances, bool to_line=true) const |
Queries the nearest neighbors within a cone. | |
int | find_points_in_cone (const vec3 &eye, const vec3 &p1, const vec3 &p2, float angle_range, std::vector< int > &neighbors, bool bToLine=true) const |
Queries the nearest neighbors within a cone. | |
![]() | |
KdTreeSearch (const PointCloud *cloud) | |
Constructor. | |
KdTreeSearch (const std::vector< vec3 > &points) | |
Constructor. | |
KdTree implementation based on Richard Keiser's KdTree code.
|
explicit |
Constructor.
cloud | The point cloud for which a KdTree will be constructed. |
|
explicit |
Constructor.
points | The points for which a KdTree will be constructed. |
|
overridevirtual |
Queries the K nearest neighbors for a given point.
p | The query point. |
k | The number of required neighbors. |
neighbors | The indices of the neighbors found. |
Implements KdTreeSearch.
|
overridevirtual |
Queries the K nearest neighbors for a given point.
p | The query point. |
k | The number of required neighbors. |
neighbors | The indices of the neighbors found. |
squared_distances | The squared distances between the query point and its K nearest neighbors. The values are stored in accordance with their indices. |
squared_distances
. Implements KdTreeSearch.
|
overridevirtual |
Queries the closest point for a given point.
p | The query point. |
Implements KdTreeSearch.
|
overridevirtual |
Queries the closest point for a given point.
p | The query point. |
squared_distance | The squared distance between the query point and its closest neighbor. |
squared_distance
. Implements KdTreeSearch.
int find_points_in_cone | ( | const vec3 & | eye, |
const vec3 & | p1, | ||
const vec3 & | p2, | ||
float | angle_range, | ||
std::vector< int > & | neighbors, | ||
bool | bToLine = true ) const |
Queries the nearest neighbors within a cone.
Searches for the nearest points with a cone from p1
to p2
.
eye | The view point. |
p1 | One end point of a line segment. |
p2 | The other end point of a line segment. |
angle_range | The maximal angle in radian allowed between p1 - p and p1 - p2 , where p is a candidate point. |
neighbors | The indices of the neighbors found. |
bToLine | Specifies how the points found are ordered. If bToLine=true , the points found are ordered by their distances to the line. Otherwise, they are ordered by their distances to the view point eye . |
int find_points_in_cone | ( | const vec3 & | eye, |
const vec3 & | p1, | ||
const vec3 & | p2, | ||
float | angle_range, | ||
std::vector< int > & | neighbors, | ||
std::vector< float > & | squared_distances, | ||
bool | to_line = true ) const |
Queries the nearest neighbors within a cone.
Searches for the nearest points with a cone from p1
to p2
.
eye | The view point. |
p1 | One end point of a line segment. |
p2 | The other end point of a line segment. |
angle_range | The maximal angle in radian allowed between p1 - p and p1 - p2 , where p is a candidate point. |
neighbors | The indices of the neighbors found. |
squared_distances | The squared distances between the found neighbors to the query line segment. The values are stored in accordance with their indices. |
to_line | Specifies how the points found are ordered. If to_line is true, the points found are ordered by their distances to the line. Otherwise, they are ordered by their distances to the view point eye . |
int find_points_in_cylinder | ( | const vec3 & | p1, |
const vec3 & | p2, | ||
float | radius, | ||
std::vector< int > & | neighbors, | ||
bool | to_line = true ) const |
Queries the nearest neighbors within a cylinder range.
Searches for the nearest points whose distances to line segment p1
- p2
are smaller than radius
(not squared).
p1 | One end point of the query line segment. |
p2 | The other end point of the query line segment. |
radius | The search range (which is not squared). |
neighbors | The indices of the neighbors found. |
to_line | Specifies how the points found are ordered. If to_line is true, the points found are ordered by their distances to the line. Otherwise, they are ordered by their distances to p1 . |
int find_points_in_cylinder | ( | const vec3 & | p1, |
const vec3 & | p2, | ||
float | radius, | ||
std::vector< int > & | neighbors, | ||
std::vector< float > & | squared_distances, | ||
bool | to_line = true ) const |
Queries the nearest neighbors within a cylinder range.
Searches for the nearest points whose distances to line segment p1
- p2
are smaller than radius
(not squared).
p1 | One end point of the query line segment. |
p2 | The other end point of the query line segment. |
radius | The search range (which is not squared). |
neighbors | The indices of the neighbors found. |
squared_distances | The squared distances between the found neighbors to the query line. The values are stored in accordance with their indices. |
to_line | Specifies how the points found are ordered. If to_line is true, the points found are ordered by their distances to the line. Otherwise, they are ordered by their distances to p1 . |
|
overridevirtual |
Queries the nearest neighbors within a fixed range.
p | The query point. |
squared_radius | The search range (which is required to be squared). |
neighbors | The indices of the neighbors found. |
Implements KdTreeSearch.
|
overridevirtual |
Queries the nearest neighbors within a fixed range.
p | The query point. |
squared_radius | The search range (which is required to be squared). |
neighbors | The indices of the neighbors found. |
squared_distances | The squared distances between the query point and the neighbors found. The values are stored in accordance with their indices. |
squared_distances
. Implements KdTreeSearch.