48 #include "orr_octree.h"
49 #include <pcl/pcl_exports.h>
71 z1 ()
const {
return z1_;}
74 z2 ()
const {
return z2_;}
89 : nodes_ (compare_nodes_z), x_ (x), y_ (y)
101 inline std::set<ORROctree::Node*, bool(*)(ORROctree::Node*,ORROctree::Node*)>&
111 std::set<ORROctree::Node*, bool(*)(ORROctree::Node*,ORROctree::Node*)>
nodes_;
121 build (
const ORROctree& input,
float eps_front,
float eps_back);
129 x =
static_cast<int> ((p[0] - bounds_[0])*inv_pixel_size_);
130 y =
static_cast<int> ((p[1] - bounds_[2])*inv_pixel_size_);
136 int x, y; this->getPixelCoordinates (p, x, y);
138 if ( x < 0 || x >= num_pixels_x_ )
return (
nullptr);
139 if ( y < 0 || y >= num_pixels_y_ )
return (
nullptr);
141 return (pixels_[x][y]);
147 int x, y; this->getPixelCoordinates (p, x, y);
149 if ( x < 0 || x >= num_pixels_x_ )
return (
nullptr);
150 if ( y < 0 || y >= num_pixels_y_ )
return (
nullptr);
152 return (pixels_[x][y]);
155 inline const std::set<ORROctree::Node*, bool(*)(ORROctree::Node*,ORROctree::Node*)>*
158 int x, y; this->getPixelCoordinates (p, x, y);
160 if ( x < 0 || x >= num_pixels_x_ )
return (
nullptr);
161 if ( y < 0 || y >= num_pixels_y_ )
return (
nullptr);
166 return (&sets_[x][y]->get_nodes ());
169 inline std::list<Pixel*>&
175 return pixels_[i][j];
194 num_x = num_pixels_x_;
195 num_y = num_pixels_y_;
199 float pixel_size_, inv_pixel_size_, bounds_[4], extent_x_, extent_y_;
void getPixelCoordinates(const float *p, int &x, int &y) const
std::set< ORROctree::Node *, bool(*)(ORROctree::Node *, ORROctree::Node *)> nodes_
void getNumberOfPixels(int &num_x, int &num_y) const
Get the width ('num_x') and height ('num_y') of the image.
const Pixel * getPixel(int i, int j) const
virtual ~ORROctreeZProjection()
void insert(ORROctree::Node *leaf)
const std::set< ORROctree::Node *, bool(*)(ORROctree::Node *, ORROctree::Node *)> * getOctreeNodes(const float *p) const
float getPixelSize() const
std::set< ORROctree::Node *, bool(*)(ORROctree::Node *, ORROctree::Node *)> & get_nodes()
std::list< Pixel * > full_pixels_
static bool compare_nodes_z(ORROctree::Node *node1, ORROctree::Node *node2)
std::list< Set * > full_sets_
Pixel * getPixel(const float *p)
const Pixel * getPixel(const float *p) const
std::list< Pixel * > & getFullPixels()
const float * getBounds() const
That's a very specialized and simple octree class.