35 #if MRPT_HAS_OPENGL_GLUT 36 octree_assure_uptodate();
37 m_last_rendered_count_ongoing = 0;
43 if ( m_color.A != 255 )
65 if ( m_color.A != 255 )
71 m_last_rendered_count = m_last_rendered_count_ongoing;
80 #if MRPT_HAS_OPENGL_GLUT 81 const size_t N = all ? m_points.size() : idxs.size();
84 m_last_rendered_count_ongoing += N/decimation;
86 m_last_rendered_count_ongoing += (all ? m_points.size() : idxs.size())/decimation;
90 for (
size_t i=0;i<N;i+=decimation)
99 for (
size_t i=0;i<N;i+=decimation)
123 writeToStreamRender(out);
126 out << m_pointSmooth;
141 readFromStreamRender(
in);
142 in >> m_points >> m_pointSize;
146 else m_pointSmooth =
false;
151 readFromStreamRender(
in);
157 for (
uint32_t i=0;i<n;i++) in >> m_points[i];
164 markAllPointsAsNew();
169 in >> o.
x >> o.
y >> o.
z >> o.
R >> o.
G >> o.
B;
176 out << o.
x << o.
y << o.
z << o.
R << o.
G << o.
B;
190 markAllPointsAsNew();
199 markAllPointsAsNew();
206 octree_mark_as_outdated();
222 else this->setPoint(idx,
TPointColour(pt.
x,pt.
y,pt.
z,pt_color->
R,pt_color->
G,pt_color->
B));
255 const float coord_range = coord_max-coord_min;
256 const float coord_range_1 = coord_range!=0.0f ? 1.0f/coord_range : 1.0f;
257 for (
size_t i=0;i<m_points.size();i++)
260 switch (coord_index) {
261 case 0:
coord = m_points[i].x;
break;
262 case 1:
coord = m_points[i].y;
break;
263 case 2:
coord = m_points[i].z;
break;
265 const float col_idx = std::max(0.0f,
std::min(1.0f,(
coord-coord_min)*coord_range_1 ) );
268 this->setPointColor_fast(i,
r,
g,
b);
Classes for serialization, sockets, ini-file manipulation, streams, list of properties-values, timewatch, extensions to STL.
OPENGL_IMPEXP mrpt::utils::CStream & operator<<(mrpt::utils::CStream &out, const mrpt::opengl::CLight &o)
GLAPI void GLAPIENTRY glEnable(GLenum cap)
void writeToStream(mrpt::utils::CStream &out, int *getVersion) const
Introduces a pure virtual method responsible for writing to a CStream.
GLAPI void GLAPIENTRY glPointSize(GLfloat size)
TColormap
Different colormaps for use in mrpt::utils::colormap()
::mrpt::utils::CStream & operator>>(mrpt::utils::CStream &in, CAngularObservationMeshPtr &pObj)
#define IMPLEMENTS_SERIALIZABLE(class_name, base, NameSpace)
This must be inserted in all CSerializable classes implementation files.
A cloud of points, each one with an individual colour (R,G,B).
#define ASSERT_BELOW_(__A, __B)
This file implements several operations that operate element-wise on individual or pairs of container...
The base class of 3D objects that can be directly rendered through OpenGL.
#define GL_ONE_MINUS_SRC_ALPHA
void BASE_IMPEXP colormap(const TColormap &color_map, const float color_index, float &r, float &g, float &b)
Transform a float number in the range [0,1] into RGB components.
GLAPI void GLAPIENTRY glBlendFunc(GLenum sfactor, GLenum dfactor)
void setPoint(size_t i, const TPointColour &p)
Write an individual point (checks for "i" in the valid range only in Debug).
This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...
This base provides a set of functions for maths stuff.
size_t PLY_export_get_vertex_count() const MRPT_OVERRIDE
In a base class, return the number of vertices.
virtual void PLY_import_set_vertex_count(const size_t N) MRPT_OVERRIDE
In a base class, reserve memory to prepare subsequent calls to PLY_import_set_vertex.
Lightweight 3D point (float version).
#define MRPT_UNUSED_PARAM(a)
Can be used to avoid "not used parameters" warnings from the compiler.
#define MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION(__V)
For use in CSerializable implementations.
OPENGL_IMPEXP float OCTREE_RENDER_MAX_DENSITY_POINTS_PER_SQPIXEL
Default value = 0.01 points/px^2.
void recolorizeByCoordinate(const float coord_min, const float coord_max, const int coord_index=2, const mrpt::utils::TColormap color_map=mrpt::utils::cmJET)
Regenerates the color of each point according the one coordinate (coord_index:0,1,2 for X,Y,Z) and the given color map.
Information about the rendering process being issued.
GLAPI void GLAPIENTRY glBegin(GLenum mode)
void readFromStream(mrpt::utils::CStream &in, int version)
Introduces a pure virtual method responsible for loading from a CStream This can not be used directly...
GLAPI void GLAPIENTRY glVertex3f(GLfloat x, GLfloat y, GLfloat z)
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
#define ASSERT_ABOVEEQ_(__A, __B)
GLdouble GLdouble GLdouble r
void PLY_export_get_vertex(const size_t idx, mrpt::math::TPoint3Df &pt, bool &pt_has_color, mrpt::utils::TColorf &pt_color) const MRPT_OVERRIDE
In a base class, will be called after PLY_export_get_vertex_count() once for each exported point...
void push_back(float x, float y, float z, float R, float G, float B)
Inserts a new point into the point cloud.
void OPENGL_IMPEXP checkOpenGLError()
Checks glGetError and throws an exception if an error situation is found.
virtual void PLY_import_set_vertex(const size_t idx, const mrpt::math::TPoint3Df &pt, const mrpt::utils::TColorf *pt_color=NULL) MRPT_OVERRIDE
In a base class, will be called after PLY_import_set_vertex_count() once for each loaded point...
void render_subset(const bool all, const std::vector< size_t > &idxs, const float render_area_sqpixels) const
Render a subset of points (required by octree renderer)
The namespace for 3D scene representation and rendering.
void OPENGL_IMPEXP getCurrentRenderingInfo(TRenderInfo &ri)
Gather useful information on the render parameters.
A RGB color - floats in the range [0,1].
GLAPI void GLAPIENTRY glEnd(void)
int round(const T value)
Returns the closer integer (int) to x.
typedef void(APIENTRYP PFNGLBLENDCOLORPROC)(GLclampf red
GLAPI void GLAPIENTRY glColor4f(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)
unsigned __int32 uint32_t
GLAPI void GLAPIENTRY glDisable(GLenum cap)
void markAllPointsAsNew()
Do needed internal work if all points are new (octree rebuilt,...)