bool pcl::octree::OctreePointCloudSearch<PointT, LeafT, OctreeT>::voxelSearch (const PointT& point, std::vector<int>& pointIdx_data) { OctreeKey key; bool b_success = false; // generate key this->genOctreeKeyforPoint (point, key); LeafT* leaf = this->getLeaf (key); if (leaf) { leaf->getData (pointIdx_data); b_success = true; } return (b_success); }
template<typename PointT, typename LeafT, typename BranchT> bool pcl::octree::OctreePointCloudSearch<PointT, LeafT, BranchT>::voxelSearch (const PointT& point, std::vector<int>& pointIdx_data) { assert (isFinite (point) && "Invalid (NaN, Inf) point coordinates given to nearestKSearch!"); OctreeKey key; bool b_success = false; // generate key this->genOctreeKeyforPoint (point, key); LeafT* leaf = this->findLeaf (key); if (leaf) { leaf->getData (pointIdx_data); b_success = true; } return (b_success); }
bool OctreeLowMemBase<DataT, LeafT>::get (const unsigned int idxX_arg, const unsigned int idxY_arg, const unsigned int idxZ_arg, DataT& data_arg) const { OctreeKey key; // generate key genOctreeKeyByIntIdx (idxX_arg, idxY_arg, idxZ_arg, key); // search for leaf at key LeafT* leaf = findLeaf (key); if (leaf) { const DataT * dataPtr; // if successful, decode data to data_arg leaf->getData (dataPtr); if (dataPtr) data_arg = *dataPtr; } // returns true on success return (leaf != 0); }