39 #ifndef PCL_OCTREE_SEARCH_H_
40 #define PCL_OCTREE_SEARCH_H_
42 #include <pcl/point_cloud.h>
43 #include <pcl/point_types.h>
45 #include "octree_pointcloud.h"
57 template<
typename Po
intT,
typename LeafContainerT = OctreeContainerPo
intIndices ,
typename BranchContainerT = OctreeContainerEmpty >
70 typedef boost::shared_ptr<OctreePointCloudSearch<PointT, LeafContainerT, BranchContainerT> >
Ptr;
71 typedef boost::shared_ptr<const OctreePointCloudSearch<PointT, LeafContainerT, BranchContainerT> >
ConstPtr;
108 voxelSearch (
const int index, std::vector<int>& point_idx_data);
121 std::vector<float> &k_sqr_distances)
123 return (
nearestKSearch (cloud[index], k, k_indices, k_sqr_distances));
135 std::vector<float> &k_sqr_distances);
147 nearestKSearch (
int index,
int k, std::vector<int> &k_indices, std::vector<float> &k_sqr_distances);
191 std::vector<float> &k_sqr_distances,
unsigned int max_nn = 0)
193 return (
radiusSearch (cloud.
points[index], radius, k_indices, k_sqr_distances, max_nn));
206 std::vector<float> &k_sqr_distances,
unsigned int max_nn = 0)
const;
218 radiusSearch (
int index,
const double radius, std::vector<int> &k_indices,
219 std::vector<float> &k_sqr_distances,
unsigned int max_nn = 0)
const;
241 std::vector<int> &k_indices,
242 int max_voxel_count = 0)
const;
252 boxSearch (
const Eigen::Vector3f &min_pt,
const Eigen::Vector3f &max_pt, std::vector<int> &k_indices)
const;
365 unsigned int tree_depth, std::vector<int>& k_indices,
366 std::vector<float>& k_sqr_distances,
unsigned int max_nn)
const;
380 const OctreeKey& key,
unsigned int tree_depth,
381 const double squared_search_radius,
382 std::vector<prioPointQueueEntry>& point_candidates)
const;
394 unsigned int tree_depth,
int& result_index,
float& sqr_distance);
414 double max_z,
unsigned char a,
const OctreeNode* node,
416 int max_voxel_count)
const;
429 const OctreeKey& key,
unsigned int tree_depth, std::vector<int>& k_indices)
const;
449 double max_x,
double max_y,
double max_z,
451 std::vector<int> &k_indices,
452 int max_voxel_count)
const;
467 double &min_x,
double &min_y,
double &min_z,
468 double &max_x,
double &max_y,
double &max_z,
469 unsigned char &a)
const
472 const float epsilon = 1e-10f;
473 if (direction.x () == 0.0)
474 direction.x () = epsilon;
475 if (direction.y () == 0.0)
476 direction.y () = epsilon;
477 if (direction.z () == 0.0)
478 direction.z () = epsilon;
484 if (direction.x () < 0.0)
486 origin.x () =
static_cast<float> (this->
min_x_) + static_cast<float> (this->
max_x_) - origin.x ();
487 direction.x () = -direction.x ();
490 if (direction.y () < 0.0)
492 origin.y () =
static_cast<float> (this->
min_y_) + static_cast<float> (this->
max_y_) - origin.y ();
493 direction.y () = -direction.y ();
496 if (direction.z () < 0.0)
498 origin.z () =
static_cast<float> (this->
min_z_) + static_cast<float> (this->
max_z_) - origin.z ();
499 direction.z () = -direction.z ();
502 min_x = (this->
min_x_ - origin.x ()) / direction.x ();
503 max_x = (this->
max_x_ - origin.x ()) / direction.x ();
504 min_y = (this->
min_y_ - origin.y ()) / direction.y ();
505 max_y = (this->
max_y_ - origin.y ()) / direction.y ();
506 min_z = (this->
min_z_ - origin.z ()) / direction.z ();
507 max_z = (this->
max_z_ - origin.z ()) / direction.z ();
603 #define PCL_INSTANTIATE_OctreePointCloudSearch(T) template class PCL_EXPORTS pcl::octree::OctreePointCloudSearch<T>;
605 #endif // PCL_OCTREE_SEARCH_H_