49 m_cache_points.clear();
50 m_cache_points.insertionOptions.minDistBetweenLaserPoints = 0;
51 m_cache_points.insertionOptions.isPlanarMap =
false;
53 m_cache_points.insertObservation(m_scan);
69 const float *x, *y, *z;
70 m_cache_points.getPointsBuffer(n, x, y, z);
73 for (
size_t i = 0; i < n - 1; i++)
75 vbd.emplace_back(x[i], y[i], z[i]);
76 vbd.emplace_back(x[i + 1], y[i + 1], z[i + 1]);
90 const float *x, *y, *z;
91 m_cache_points.getPointsBuffer(n, x, y, z);
96 for (
size_t i = 0; i < n - 1; i++)
99 P3f(m_scan.sensorPose.x(), m_scan.sensorPose.y(),
100 m_scan.sensorPose.z()),
101 P3f(x[i], y[i], z[i]), P3f(x[i + 1], y[i + 1], z[i + 1]));
119 const float *x, *y, *z;
120 m_cache_points.getPointsBuffer(n, x, y, z);
122 for (
size_t i = 0; i < n; i++) vbd.emplace_back(x[i], y[i], z[i]);
133 writeToStreamRender(
out);
135 out << m_line_R << m_line_G << m_line_B << m_line_A << m_points_R
136 << m_points_G << m_points_B << m_points_A << m_plane_R << m_plane_G
137 << m_plane_B << m_plane_A << m_enable_points << m_enable_line
149 readFromStreamRender(in);
158 in >> m_line_R >> m_line_G >> m_line_B >> m_line_A;
165 in >> m_points_R >> m_points_G >> m_points_B >> m_points_A >>
166 m_plane_R >> m_plane_G >> m_plane_B >> m_plane_A;
170 in >> m_enable_points >> m_enable_line >>
175 m_enable_points = m_enable_line = m_enable_surface =
true;
190 m_cache_valid =
true;
191 m_cache_points.clear();
192 m_cache_points.insertionOptions.minDistBetweenLaserPoints = 0;
193 m_cache_points.insertionOptions.isPlanarMap =
false;
195 m_cache_points.insertObservation(m_scan);
199 const float *x, *y, *z;
201 m_cache_points.getPointsBuffer(n, x, y, z);
202 if (!n || !x)
return;
205 std::numeric_limits<double>::max(), std::numeric_limits<double>::max(),
206 std::numeric_limits<double>::max());
208 -std::numeric_limits<double>::max(),
209 -std::numeric_limits<double>::max(),
210 -std::numeric_limits<double>::max());
212 for (
size_t i = 0; i < n; i++)
229 return {
d2f(m_scan.sensorPose.x()),
d2f(m_scan.sensorPose.y()),
230 d2f(m_scan.sensorPose.z())};
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 keep_min(T &var, const K test_val)
If the second argument is below the first one, set the first argument to this lower value...
void onUpdateBuffers_Triangles() override
Must be implemented in derived classes to update the geometric entities to be drawn in "m_*_buffer" f...
std::vector< mrpt::math::TPoint3Df > m_vertex_buffer_data
void onUpdateBuffers_Wireframe() override
Must be implemented in derived classes to update the geometric entities to be drawn in "m_*_buffer" f...
#define IMPLEMENTS_SERIALIZABLE(class_name, base, NameSpace)
To be added to all CSerializable-classes implementation files.
void notifyChange() const
Call to enable calling renderUpdateBuffers() before the next render() rendering iteration.
mrpt::opengl::shader_id_t shader_id
The base class of 3D objects that can be directly rendered through OpenGL.
mrpt::math::TPoint3Df getLocalRepresentativePoint() const override
Provide a representative point (in object local coordinates), used to sort objects by eye-distance wh...
void renderUpdateBuffers() const override
Called whenever m_outdatedBuffers is true: used to re-generate OpenGL vertex buffers, etc.
void renderUpdateBuffers() const override
Called whenever m_outdatedBuffers is true: used to re-generate OpenGL vertex buffers, etc.
Context for calls to render()
std::vector< mrpt::math::TPoint3Df > m_vertex_buffer_data
#define MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION(__V)
For use in CSerializable implementations.
std::vector< mrpt::img::TColor > m_color_buffer_data
float d2f(const double d)
shortcut for static_cast<float>(double)
This base provides a set of functions for maths stuff.
static constexpr shader_id_t WIREFRAME
This object renders a 2D laser scan by means of three elements: the points, the line along end-points...
uint8_t serializeGetVersion() const override
Must return the current versioning number of the object.
TPoint3D_< double > TPoint3D
Lightweight 3D point.
static constexpr shader_id_t TRIANGLES
void keep_max(T &var, const K test_val)
If the second argument is above the first one, set the first argument to this higher value...
void serializeFrom(mrpt::serialization::CArchive &in, uint8_t serial_version) override
Pure virtual method for reading (deserializing) from an abstract archive.
std::vector< mrpt::img::TColor > m_color_buffer_data
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
Virtual base class for "archives": classes abstracting I/O streams.
std::vector< mrpt::opengl::TTriangle > m_triangles
List of triangles.
mrpt::vision::TStereoCalibResults out
An RGBA color - floats in the range [0,1].
The namespace for 3D scene representation and rendering.
void render(const RenderContext &rc) const override
Implements the rendering of 3D objects in each class derived from CRenderizable.
void render(const RenderContext &rc) const override
Implements the rendering of 3D objects in each class derived from CRenderizable.
TPoint3D_< float > TPoint3Df
TColor asTColor() const
Returns the 0-255 integer version of this color: RGBA_u8.
void render(const RenderContext &rc) const override
Implements the rendering of 3D objects in each class derived from CRenderizable.
void onUpdateBuffers_Points() override
Must be implemented in derived classes to update the geometric entities to be drawn in "m_*_buffer" f...
void clear()
Clear the contents of this container.
static constexpr shader_id_t POINTS
void renderUpdateBuffers() const override
Called whenever m_outdatedBuffers is true: used to re-generate OpenGL vertex buffers, etc.
void render(const RenderContext &rc) const override
Implements the rendering of 3D objects in each class derived from CRenderizable.
void serializeTo(mrpt::serialization::CArchive &out) const override
Pure virtual method for writing (serializing) to an abstract archive.
void renderUpdateBuffers() const override
Called whenever m_outdatedBuffers is true: used to re-generate OpenGL vertex buffers, etc.