121 float lineWidth = 1.0);
124 ~CBox()
override =
default;
void setBoxCorners(const mrpt::math::TPoint3D &corner1, const mrpt::math::TPoint3D &corner2)
Set the position and size of the box, from two corners in 3D.
virtual shader_list_t requiredShaders() const override
Returns the ID of the OpenGL shader program required to render this class.
A solid or wireframe box in 3D, defined by 6 rectangular faces parallel to the planes X...
void setLineWidth(float width)
bool isBoxBorderEnabled() const
mrpt::math::TPoint3D m_corner_max
void freeOpenGLResources() override
Free opengl buffers.
void notifyChange() const
Call to enable calling renderUpdateBuffers() before the next render() rendering iteration.
void onUpdateBuffers_Wireframe() override
Must be implemented in derived classes to update the geometric entities to be drawn in "m_*_buffer" f...
bool m_wireframe
true: wireframe, false (default): solid
bool m_draw_border
Draw line borders to solid box with the given linewidth (default: true)
void setBoxBorderColor(const mrpt::img::TColor &c)
Renderizable generic renderer for objects using the triangles shader.
std::vector< shader_id_t > shader_list_t
A list of shader IDs.
Context for calls to render()
void renderUpdateBuffers() const override
Called whenever m_outdatedBuffers is true: used to re-generate OpenGL vertex buffers, etc.
bool traceRay(const mrpt::poses::CPose3D &o, double &dist) const override
Ray tracing.
CBox()=default
Basic empty constructor.
void getBoxCorners(mrpt::math::TPoint3D &corner1, mrpt::math::TPoint3D &corner2) const
~CBox() override=default
Destructor.
void onUpdateBuffers_Triangles() override
Must be implemented in derived classes to update the geometric entities to be drawn in "m_*_buffer" f...
void setWireframe(bool is_wireframe=true)
static constexpr shader_id_t WIREFRAME
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 enableBoxBorder(bool drawBorder=true)
void freeOpenGLResources() override
Free opengl buffers.
static constexpr shader_id_t TRIANGLES
void render(const RenderContext &rc) const override
Implements the rendering of 3D objects in each class derived from CRenderizable.
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
mrpt::math::TPoint3D m_corner_min
Corners coordinates.
mrpt::img::TColor m_solidborder_color
Color of the solid box borders.
Renderizable generic renderer for objects using the wireframe shader.
The namespace for 3D scene representation and rendering.
#define DEFINE_SERIALIZABLE(class_name, NS)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
float getLineWidth() const
mrpt::img::TColor getBoxBorderColor() const
void freeOpenGLResources() override
Free opengl buffers.