50 bool showAll = (tree.
size() < 5 * 1e6);
51 bool uses_origin = ( (origin_.
rot().
x() != 0.) && (origin_.
rot().
y() != 0.)
52 && (origin_.
rot().
z() != 0.) && (origin_.
rot().
u() != 1.) );
57 unsigned int cnt_occupied(0), cnt_occupied_thres(0), cnt_free(0), cnt_free_thres(0);
58 for(ColorOcTree::tree_iterator it = tree.
begin_tree(this->m_max_tree_depth),
59 end=tree.
end_tree(); it!= end; ++it) {
77 std::vector<octomath::Vector3> cube_template;
80 unsigned int idx_occupied(0), idx_occupied_thres(0), idx_free(0), idx_free_thres(0);
81 unsigned int color_idx_occupied(0), color_idx_occupied_thres(0);
85 for(ColorOcTree::tree_iterator it = tree.
begin_tree(this->m_max_tree_depth),
86 end=tree.
end_tree(); it!= end; ++it) {
97 color_idx_occupied_thres =
setCubeColorRGBA(it->getColor().r, it->getColor().g, it->getColor().b,
98 (
unsigned char) (it->getOccupancy() * 255.),
103 color_idx_occupied =
setCubeColorRGBA(it->getColor().r, it->getColor().g, it->getColor().b,
104 (
unsigned char)(it->getOccupancy() * 255.),
const tree_iterator end_tree() const
GLfloat ** m_occupiedArray
std::pair< point3d, double > OcTreeVolume
octomap::pose6d initial_origin
GLfloat * m_occupiedColorArray
void initCubeTemplate(const octomath::Pose6D &origin, std::vector< octomath::Vector3 > &cube_template)
setup cube template
Vector3 rotate(const Vector3 &v) const
virtual ~ColorOcTreeDrawer()
virtual void setOcTree(const AbstractOcTree &tree_pnt, const pose6d &origin, int map_id_)
bool isNodeAtThreshold(const OcTreeNode *occupancyNode) const
GLfloat ** m_freeThresArray
bool m_octree_grid_vis_initialized
GLfloat ** m_occupiedThresArray
OpenGL representation of Octree cells (cubes)
unsigned int generateCube(const octomap::OcTreeVolume &v, const std::vector< octomath::Vector3 > &cube_template, const unsigned int ¤t_array_idx, GLfloat ***glArray)
add one cube to arrays
tree_iterator begin_tree(unsigned char maxDepth=0) const
void initGLArrays(const unsigned int &num_cubes, unsigned int &glArraySize, GLfloat ***glArray, GLfloat **glColorArray)
setup OpenGL arrays
std::list< octomap::OcTreeVolume > m_grid_voxels
unsigned int m_occupiedThresSize
unsigned int m_occupiedSize
unsigned int setCubeColorRGBA(const unsigned char &r, const unsigned char &g, const unsigned char &b, const unsigned char &a, const unsigned int ¤t_array_idx, GLfloat **glColorArray)
GLfloat * m_occupiedThresColorArray
Color array for occupied cells (height)
bool isNodeOccupied(const OcTreeNode *occupancyNode) const
virtual size_t size() const
unsigned int m_freeThresSize