39 #ifndef OCTREE_POINTCLOUD_H
40 #define OCTREE_POINTCLOUD_H
76 template<
typename Po
intT,
typename LeafT = OctreeContainerDataTVector<
int>,
77 typename BranchT = OctreeContainerEmpty<
int>,
78 typename OctreeT = OctreeBase<
int, LeafT, BranchT> >
128 typedef boost::shared_ptr<OctreePointCloud<PointT, LeafT, OctreeT> >
Ptr;
129 typedef boost::shared_ptr<const OctreePointCloud<PointT, LeafT, OctreeT> >
ConstPtr;
141 assert(this->leafCount_==0);
144 indices_ = indices_arg;
183 assert( this->leafCount_ == 0);
185 resolution_ = resolution_arg;
195 return (resolution_);
203 return this->octreeDepth_;
246 minX_ = minY_ = maxY_ = minZ_ = maxZ_ = 0;
247 this->boundingBoxDefined_ =
false;
249 OctreeT::deleteTree (freeMemory_arg);
260 const double pointY_arg,
const double pointZ_arg)
const;
289 const Eigen::Vector3f& origin,
const Eigen::Vector3f& end,
323 const double minZ_arg,
const double maxX_arg,
const double maxY_arg,
324 const double maxZ_arg);
335 const double maxZ_arg);
355 getBoundingBox (
double& minX_arg,
double& minY_arg,
double& minZ_arg,
356 double& maxX_arg,
double& maxY_arg,
double& maxZ_arg)
const;
394 Eigen::Vector3f &min_pt, Eigen::Vector3f &max_pt)
406 addPointIdx (
const int pointIdx_arg);
413 getPointByIndex (
const unsigned int index_arg)
const;
420 findLeafAtPoint (
const PointT& point_arg)
const;
434 adoptBoundingBoxToPoint (
const PointT& pointIdx_arg);
440 inline bool isPointWithinBoundingBox (
const PointT& pointIdx_arg)
const
442 return (! ( (pointIdx_arg.x < minX_) || (pointIdx_arg.y < minY_)
443 || (pointIdx_arg.z < minZ_) || (pointIdx_arg.x >= maxX_)
444 || (pointIdx_arg.y >= maxY_) || (pointIdx_arg.z >= maxZ_)));
452 genOctreeKeyforPoint (
const PointT & point_arg,
453 OctreeKey &key_arg)
const;
462 genOctreeKeyforPoint (
const double pointX_arg,
const double pointY_arg,
463 const double pointZ_arg, OctreeKey & key_arg)
const;
472 genOctreeKeyForDataT (
const int& data_arg, OctreeKey & key_arg)
const;
479 genLeafNodeCenterFromOctreeKey (
const OctreeKey & key_arg,
488 genVoxelCenterFromOctreeKey (
const OctreeKey & key_arg,
489 unsigned int treeDepth_arg,
PointT& point_arg)
const;
498 genVoxelBoundsFromOctreeKey (
const OctreeKey & key_arg,
499 unsigned int treeDepth_arg, Eigen::Vector3f &min_pt,
500 Eigen::Vector3f &max_pt)
const;
509 getOccupiedVoxelCentersRecursive (
const BranchNode* node_arg,
510 const OctreeKey& key_arg,
539 bool boundingBoxDefined_;