50#include <pcl/point_cloud.h>
51#include <pcl/pcl_exports.h>
81 Data (
int id_x,
int id_y,
int id_z,
int lin_id,
void* user_data =
nullptr)
92 virtual~ Data () =
default;
97 p_[0] += x;
p_[1] += y;
p_[2] += z;
155 inline const std::set<Node*>&
159 float n_[3]{}, p_[3]{};
160 int id_x_{0}, id_y_{0}, id_z_{0}, lin_id_{0}, num_points_{0};
258 this->
getData ()->insertNeighbor (node);
284 build (
const float* bounds,
float voxel_size);
312 if ( x >= c[0] )
id |= 4;
313 if ( y >= c[1] )
id |= 2;
314 if ( z >= c[2] )
id |= 1;
359 return (this->
getLeaf (p[0], p[1], p[2]));
387 if ( x >= c[0] )
id |= 4;
388 if ( y >= c[1] )
id |= 2;
389 if ( z >= c[2] )
id |= 1;
402 inline std::vector<ORROctree::Node*>&
405 inline const std::vector<ORROctree::Node*>&
PointCloud represents the base class in PCL for storing collections of 3D points.
const float * getNormal() const
void insertNeighbor(Node *node)
void addToPoint(float x, float y, float z)
const std::set< Node * > & getNeighbors() const
void get3dId(int id[3]) const
std::set< Node * > neighbors_
Data(int id_x, int id_y, int id_z, int lin_id, void *user_data=nullptr)
void * getUserData() const
void computeAveragePoint()
void setUserData(void *user_data)
void addToNormal(float x, float y, float z)
const float * getPoint() const
void setBounds(const float *b)
void setCenter(const float *c)
const float * getBounds() const
float getRadius() const
Computes the "radius" of the node which is half the diagonal length.
const Node::Data * getData() const
void getBounds(float b[6]) const
void setUserData(void *user_data)
const float * getCenter() const
void setParent(Node *parent)
void computeRadius()
Computes the "radius" of the node which is half the diagonal length.
void setData(Node::Data *data)
void makeNeighbors(Node *node)
Make this and 'node' neighbors by inserting each node in the others node neighbor set.
pcl::PointCloud< pcl::PointXYZ > PointCloudOut
void build(const PointCloudIn &points, float voxel_size, const PointCloudN *normals=nullptr, float enlarge_bounds=0.00001f)
Creates an octree which encloses 'points' and with leaf size equal to 'voxel_size'.
const float * getBounds() const
void deleteBranch(Node *node)
Deletes the branch 'node' is part of.
ORROctree::Node * getRandomFullLeafOnSphere(const float *p, float radius) const
Randomly chooses and returns a full leaf that is intersected by the sphere with center 'p' and 'radiu...
ORROctree::Node * getRoot()
void getNormalsOfFullLeaves(PointCloudN &out) const
ORROctree::Node * getLeaf(int i, int j, int k)
Since the leaves are aligned in a rectilinear grid, each leaf has a unique id.
ORROctree::Node * getLeaf(float x, float y, float z)
Returns a pointer to the leaf containing p = (x, y, z) or NULL if no such leaf exists.
pcl::PointCloud< pcl::Normal > PointCloudN
ORROctree::Node * createLeaf(float x, float y, float z)
Creates the leaf containing p = (x, y, z) and returns a pointer to it, however, only if p lies within...
void build(const float *bounds, float voxel_size)
Creates an empty octree with bounds at least as large as the ones provided as input and with leaf siz...
void getFullLeavesPoints(PointCloudOut &out) const
float getVoxelSize() const
void getFullLeavesIntersectedBySphere(const float *p, float radius, std::list< ORROctree::Node * > &out) const
This method returns a super set of the full leavess which are intersected by the sphere with radius '...
void getBounds(float b[6]) const
void insertNeighbors(Node *node)
std::vector< ORROctree::Node * > & getFullLeaves()
Returns a vector with all octree leaves which contain at least one point.
std::vector< Node * > full_leaves_
pcl::PointCloud< pcl::PointXYZ > PointCloudIn
const std::vector< ORROctree::Node * > & getFullLeaves() const
Defines all the PCL implemented PointT point type structures.
T length3(const T v[3])
Returns the length of v.
void mult3(T *v, T scalar)
v = scalar*v.