26 float xMin,
float xMax,
float yMin,
float yMax,
float z,
float frequency,
27 float lineWidth,
bool antiAliasing)
33 m_frequency(frequency),
34 m_lineWidth(lineWidth),
35 m_antiAliasing(antiAliasing)
44 #if MRPT_HAS_OPENGL_GLUT 60 for (
float y = m_yMin;
y <= m_yMax;
y += m_frequency)
66 for (
float x = m_xMin;
x <= m_xMax;
x += m_frequency)
87 writeToStreamRender(out);
88 out << m_xMin << m_xMax;
89 out << m_yMin << m_yMax << m_plane_z;
91 out << m_lineWidth << m_antiAliasing;
102 readFromStreamRender(
in);
103 in >> m_xMin >> m_xMax;
104 in >> m_yMin >> m_yMax >> m_plane_z;
107 in >> m_lineWidth >> m_antiAliasing;
111 m_antiAliasing =
true;
void notifyChange() const
Must be called to notify that the object has changed (so, the display list must be updated) ...
A grid of lines over the XY plane.
GLAPI void GLAPIENTRY glEnable(GLenum cap)
void serializeTo(mrpt::serialization::CArchive &out) const override
Pure virtual method for writing (serializing) to an abstract archive.
#define IMPLEMENTS_SERIALIZABLE(class_name, base, NameSpace)
To be added to all CSerializable-classes implementation files.
void render_dl() const override
Render.
#define GL_ONE_MINUS_SRC_ALPHA
GLAPI void GLAPIENTRY glPopAttrib(void)
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...
GLAPI void GLAPIENTRY glLineWidth(GLfloat width)
void serializeFrom(mrpt::serialization::CArchive &in, uint8_t serial_version) override
Pure virtual method for reading (deserializing) from an abstract archive.
GLAPI void GLAPIENTRY glBlendFunc(GLenum sfactor, GLenum dfactor)
A renderizable object suitable for rendering with OpenGL's display lists.
#define MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION(__V)
For use in CSerializable implementations.
#define ASSERT_(f)
Defines an assertion mechanism.
#define GL_COLOR_BUFFER_BIT
GLAPI void GLAPIENTRY glBegin(GLenum mode)
uint8_t serializeGetVersion() const override
Must return the current versioning number of the object.
GLAPI void GLAPIENTRY glVertex3f(GLfloat x, GLfloat y, GLfloat z)
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
Virtual base class for "archives": classes abstracting I/O streams.
GLAPI void GLAPIENTRY glPushAttrib(GLbitfield mask)
void checkOpenGLError()
Checks glGetError and throws an exception if an error situation is found.
The namespace for 3D scene representation and rendering.
GLAPI void GLAPIENTRY glEnd(void)
GLAPI void GLAPIENTRY glDisable(GLenum cap)