10 #ifndef opengl_COctoMapVoxels_H 11 #define opengl_COctoMapVoxels_H 309 const size_t set_index,
const size_t idx)
const 347 template <
class OCTOMAP>
350 m.getAsOctoMapVoxels(*
this);
bool areLightsEnabled() const
const mrpt::utils::TColor & getGridLinesColor() const
void showVoxels(unsigned int voxel_set, bool show)
Shows/hides the voxels (voxel_set is a 0-based index for the set of voxels to modify, e.g.
void reserveVoxels(const size_t set_index, const size_t nVoxels)
TGridCube & getGridCubeRef(const size_t idx)
All cubes are of identical color.
visualization_mode_t
The different coloring schemes, which modulate the generic mrpt::opengl::CRenderizable object color...
bool areVoxelsVisible(unsigned int voxel_set) const
const TGridCube & getGridCube(const size_t idx) const
void enableLights(bool enable)
Can be used to enable/disable the effects of lighting in this object.
mrpt::math::TPoint3D m_bb_min
Cached bounding boxes.
std::deque< TInfoPerVoxelSet > m_voxel_sets
void setFromOctoMap(OCTOMAP &m)
Sets the contents of the object from a mrpt::maps::COctoMap object.
void setVoxelAsPointsSize(float pointSize)
Only used when showVoxelsAsPoints() is enabled.
mrpt::math::TPoint3D m_bb_max
size_t getVoxelCount(const size_t set_index) const
Returns the total count of voxels in one voxel set.
TVoxel & getVoxelRef(const size_t set_index, const size_t idx)
Combination of COLOR_FROM_HEIGHT and TRANSPARENCY_FROM_OCCUPANCY.
void enableCubeTransparency(bool enable)
By default, the alpha (transparency) component of voxel cubes is taken into account, but transparency can be disabled with this method.
float getGridLinesWidth() const
Gets the width of grid lines.
void setBoundingBox(const mrpt::math::TPoint3D &bb_min, const mrpt::math::TPoint3D &bb_max)
Manually changes the bounding box (normally the user doesn't need to call this)
Color goes from black (at the bottom) to the chosen color (at the top)
size_t getVoxelSetCount() const
Returns the number of voxel sets.
void reserveGridCubes(const size_t nCubes)
bool areVoxelsShownAsPoints() const
std::vector< TVoxel > voxels
EIGEN_STRONG_INLINE void notifyChange() const
Must be called to notify that the object has changed (so, the display list must be updated) ...
Transparency goes from opaque (occupied voxel) to transparent (free voxel).
void clear()
Clears everything.
void resizeVoxels(const size_t set_index, const size_t nVoxels)
GLubyte GLubyte GLubyte GLubyte w
A renderizable object suitable for rendering with OpenGL's display lists.
A flexible renderer of voxels, typically from a 3D octo map (see mrpt::maps::COctoMap).
void push_back_GridCube(const TGridCube &c)
float getVoxelAsPointsSize() const
Color goes from black (occupaid voxel) to the chosen color (free voxel) and they are transparent...
size_t getGridCubeCount() const
Returns the total count of grid cubes.
void render_dl() const override
Render.
bool m_showVoxelsAsPoints
const TVoxel & getVoxel(const size_t set_index, const size_t idx) const
bool areGridLinesVisible() const
The info of each grid block.
void push_back_Voxel(const size_t set_index, const TVoxel &v)
TVoxel(const mrpt::math::TPoint3D &coords_, const double side_length_, mrpt::utils::TColor color_)
float m_showVoxelsAsPointsSize
The info of each of the voxels.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
#define DEFINE_SERIALIZABLE(class_name)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
#define ASSERTDEB_(f)
Defines an assertion mechanism - only when compiled in debug.
Color goes from black (occupied voxel) to the chosen color (free voxel)
mrpt::utils::TColor color
void getBoundingBox(mrpt::math::TPoint3D &bb_min, mrpt::math::TPoint3D &bb_max) const override
Evaluates the bounding box of this object (including possible children) in the coordinate frame of th...
visualization_mode_t m_visual_mode
void showVoxelsAsPoints(const bool enable)
For quick renders: render voxels as points instead of cubes.
void resizeVoxelSets(const size_t nVoxelSets)
void setGridLinesColor(const mrpt::utils::TColor &color)
visualization_mode_t getVisualizationMode() const
void showGridLines(bool show)
Shows/hides the grid lines.
void setVisualizationMode(visualization_mode_t mode)
Select the visualization mode.
bool m_enable_cube_transparency
COctoMapVoxels()
Constructor.
std::vector< TGridCube > m_grid_cubes
mrpt::utils::TColor m_grid_color
void resizeGridCubes(const size_t nCubes)
mrpt::math::TPoint3D coords
bool isCubeTransparencyEnabled() const
virtual ~COctoMapVoxels()
Private, virtual destructor: only can be deleted from smart pointers.
mrpt::math::TPoint3D min
opposite corners of the cube
void setGridLinesWidth(float w)
Sets the width of grid lines.
TGridCube(const mrpt::math::TPoint3D &min_, const mrpt::math::TPoint3D &max_)