Go to the documentation of this file.
156 void render(
const RenderContext& rc)
const override;
333 const size_t set_index,
const size_t idx)
const
366 template <
class OCTOMAP>
369 m.getAsOctoMapVoxels(*
this);
void showGridLines(bool show)
Shows/hides the grid lines.
bool isCubeTransparencyEnabled() const
void render(const RenderContext &rc) const override
Implements the rendering of 3D objects in each class derived from CRenderizable.
bool areVoxelsVisible(unsigned int voxel_set) const
mrpt::math::TPoint3D m_bb_min
Cached bounding boxes.
void enableLights(bool enable)
Can be used to enable/disable the effects of lighting in this object.
const mrpt::img::TColor & getGridLinesColor() const
mrpt::math::TPoint3Df min
opposite corners of the cube
@ COLOR_FROM_OCCUPANCY
Color goes from black (occupied voxel) to the chosen color (free voxel)
@ TRANSPARENCY_FROM_OCCUPANCY
Transparency goes from opaque (occupied voxel) to transparent (free voxel).
mrpt::math::TPoint3D m_bb_max
void notifyChange() const
Call to enable calling renderUpdateBuffers() before the next render() rendering iteration.
#define DEFINE_SERIALIZABLE(class_name, NS)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
virtual shader_list_t requiredShaders() const override
Returns the ID of the OpenGL shader program required to render this class.
mrpt::math::TPoint3Df coords
The info of each grid block.
bool m_showVoxelsAsPoints
Renderizable generic renderer for objects using the wireframe shader.
void resizeVoxelSets(const size_t nVoxelSets)
const TVoxel & getVoxel(const size_t set_index, const size_t idx) const
void renderUpdateBuffers() const override
Called whenever m_outdatedBuffers is true: used to re-generate OpenGL vertex buffers,...
~COctoMapVoxels() override=default
Private, virtual destructor: only can be deleted from smart pointers.
TVoxel(const mrpt::math::TPoint3Df &coords_, const double side_length_, mrpt::img::TColor color_)
size_t getGridCubeCount() const
Returns the total count of grid cubes.
bool areVoxelsShownAsPoints() const
TVoxel & getVoxelRef(const size_t set_index, const size_t idx)
#define ASSERT_(f)
Defines an assertion mechanism.
void freeOpenGLResources() override
Free opengl buffers.
void freeOpenGLResources() override
Free opengl buffers.
void enableCubeTransparency(bool enable)
By default, the alpha (transparency) component of voxel cubes is taken into account,...
void onUpdateBuffers_Wireframe() override
Must be implemented in derived classes to update the geometric entities to be drawn in "m_*_buffer" f...
void reserveVoxels(const size_t set_index, const size_t nVoxels)
std::vector< TVoxel > voxels
void setFromOctoMap(OCTOMAP &m)
Sets the contents of the object from a mrpt::maps::COctoMap object.
void clear()
Clears everything.
float getVoxelAsPointsSize() const
void push_back_GridCube(const TGridCube &c)
static constexpr shader_id_t WIREFRAME
void onUpdateBuffers_Points() override
Must be implemented in derived classes to update the geometric entities to be drawn in "m_*_buffer" f...
void setGridLinesWidth(float w)
Sets the width of grid lines.
visualization_mode_t
The different coloring schemes, which modulate the generic mrpt::opengl::CRenderizable object color.
static constexpr shader_id_t TRIANGLES
mrpt::math::TPoint3Df max
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)
COctoMapVoxels()
Constructor.
void setVoxelAsPointsSize(float pointSize)
Only used when showVoxelsAsPoints() is enabled.
TGridCube(const mrpt::math::TPoint3Df &min_, const mrpt::math::TPoint3Df &max_)
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...
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,...
void setGridLinesColor(const mrpt::img::TColor &color)
bool areLightsEnabled() const
@ COLOR_FROM_HEIGHT
Color goes from black (at the bottom) to the chosen color (at the top)
@ MIXED
Combination of COLOR_FROM_HEIGHT and TRANSPARENCY_FROM_OCCUPANCY.
void reserveGridCubes(const size_t nCubes)
const TGridCube & getGridCube(const size_t idx) const
visualization_mode_t m_visual_mode
void freeOpenGLResources() override
Free opengl buffers.
size_t getVoxelCount(const size_t set_index) const
Returns the total count of voxels in one voxel set.
A flexible renderer of voxels, typically from a 3D octo map (see mrpt::maps::COctoMap).
bool areGridLinesVisible() const
void onUpdateBuffers_Triangles() override
Must be implemented in derived classes to update the geometric entities to be drawn in "m_*_buffer" f...
TGridCube & getGridCubeRef(const size_t idx)
void resizeGridCubes(const size_t nCubes)
std::vector< TGridCube > m_grid_cubes
void setVisualizationMode(visualization_mode_t mode)
Select the visualization mode.
void push_back_Voxel(const size_t set_index, const TVoxel &v)
float m_showVoxelsAsPointsSize
float getGridLinesWidth() const
Gets the width of grid lines.
void resizeVoxels(const size_t set_index, const size_t nVoxels)
size_t getVoxelSetCount() const
Returns the number of voxel sets.
bool m_enable_cube_transparency
Renderizable generic renderer for objects using the points shader.
std::vector< shader_id_t > shader_list_t
A list of shader IDs.
#define ASSERTDEB_(f)
Defines an assertion mechanism - only when compiled in debug.
Renderizable generic renderer for objects using the triangles shader.
void showVoxelsAsPoints(const bool enable)
For quick renders: render voxels as points instead of cubes.
std::deque< TInfoPerVoxelSet > m_voxel_sets
void freeOpenGLResources() override
Free opengl buffers.
@ FIXED
All cubes are of identical color.
The namespace for 3D scene representation and rendering.
static constexpr shader_id_t POINTS
mrpt::img::TColor m_grid_color
@ TRANS_AND_COLOR_FROM_OCCUPANCY
Color goes from black (occupaid voxel) to the chosen color (free voxel) and they are transparent.
The info of each of the voxels.
TInfoPerVoxelSet()=default
visualization_mode_t getVisualizationMode() const
Page generated by Doxygen 1.8.17 for MRPT 2.0.3 at Fri May 29 13:06:46 UTC 2020 | |