MRPT  2.0.4
CGridPlaneXZ.h
Go to the documentation of this file.
1 /* +------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | https://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2020, Individual contributors, see AUTHORS file |
6  | See: https://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See: https://www.mrpt.org/License |
8  +------------------------------------------------------------------------+ */
9 
10 #pragma once
11 
13 
14 namespace mrpt::opengl
15 {
16 /** A grid of lines over the XZ plane.
17  * \sa opengl::COpenGLScene
18  *
19  * <div align="center">
20  * <table border="0" cellspan="4" cellspacing="4" style="border-width: 1px;
21  * border-style: solid;">
22  * <tr> <td> mrpt::opengl::CGridPlaneXZ </td> <td> \image html
23  * preview_CGridPlaneXZ.png </td> </tr>
24  * </table>
25  * </div>
26  *
27  * \ingroup mrpt_opengl_grp
28  */
30 {
32 
33  protected:
34  float m_xMin, m_xMax;
35  float m_zMin, m_zMax;
36  float m_plane_y;
37  float m_frequency;
38 
39  public:
40  void setPlaneLimits(float xmin, float xmax, float zmin, float zmax)
41  {
42  m_xMin = xmin;
43  m_xMax = xmax;
44  m_zMin = zmin;
45  m_zMax = zmax;
47  }
48 
50  float& xmin, float& xmax, float& zmin, float& zmax) const
51  {
52  xmin = m_xMin;
53  xmax = m_xMax;
54  zmin = m_zMin;
55  zmax = m_zMax;
56  }
57 
58  void setPlaneYcoord(float y)
59  {
60  m_plane_y = y;
62  }
63  float getPlaneYcoord() const { return m_plane_y; }
64  void setGridFrequency(float freq)
65  {
66  ASSERT_(freq > 0);
67  m_frequency = freq;
69  }
70  float getGridFrequency() const { return m_frequency; }
71 
72  void onUpdateBuffers_Wireframe() override;
73 
74  void getBoundingBox(
76  mrpt::math::TPoint3D& bb_max) const override;
77 
78  /** Constructor */
80  float xMin = -10, float xMax = 10, float zMin = -10, float zMax = 10,
81  float y = 0, float frequency = 1, float lineWidth = 1.3f,
82  bool antiAliasing = true);
83  /** Private, virtual destructor: only can be deleted from smart pointers */
84  ~CGridPlaneXZ() override = default;
85 };
86 
87 } // namespace mrpt::opengl
mrpt::opengl::CGridPlaneXZ::getPlaneYcoord
float getPlaneYcoord() const
Definition: CGridPlaneXZ.h:63
mrpt::opengl::CGridPlaneXZ::setGridFrequency
void setGridFrequency(float freq)
Definition: CGridPlaneXZ.h:64
mrpt::opengl::CGridPlaneXZ::onUpdateBuffers_Wireframe
void onUpdateBuffers_Wireframe() override
Must be implemented in derived classes to update the geometric entities to be drawn in "m_*_buffer" f...
Definition: CGridPlaneXZ.cpp:37
mrpt::opengl::CGridPlaneXZ::~CGridPlaneXZ
~CGridPlaneXZ() override=default
Private, virtual destructor: only can be deleted from smart pointers.
mrpt::opengl::CRenderizable::notifyChange
void notifyChange() const
Call to enable calling renderUpdateBuffers() before the next render() rendering iteration.
Definition: CRenderizable.h:315
mrpt::opengl::CGridPlaneXZ::m_frequency
float m_frequency
Definition: CGridPlaneXZ.h:37
mrpt::math::TPoint3D_< double >
DEFINE_SERIALIZABLE
#define DEFINE_SERIALIZABLE(class_name, NS)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
Definition: CSerializable.h:152
mrpt::opengl::CGridPlaneXZ::getPlaneLimits
void getPlaneLimits(float &xmin, float &xmax, float &zmin, float &zmax) const
Definition: CGridPlaneXZ.h:49
mrpt::opengl::CGridPlaneXZ::m_xMax
float m_xMax
Definition: CGridPlaneXZ.h:34
mrpt::opengl::CRenderizableShaderWireFrame
Renderizable generic renderer for objects using the wireframe shader.
Definition: CRenderizableShaderWireFrame.h:24
ASSERT_
#define ASSERT_(f)
Defines an assertion mechanism.
Definition: exceptions.h:120
mrpt::opengl::CGridPlaneXZ::m_plane_y
float m_plane_y
Definition: CGridPlaneXZ.h:36
bb_max
const auto bb_max
Definition: CPose3DPDFGrid_unittest.cpp:25
bb_min
const auto bb_min
Definition: CPose3DPDFGrid_unittest.cpp:23
mrpt::opengl::CGridPlaneXZ::setPlaneLimits
void setPlaneLimits(float xmin, float xmax, float zmin, float zmax)
Definition: CGridPlaneXZ.h:40
mrpt::opengl::CGridPlaneXZ::m_zMax
float m_zMax
Definition: CGridPlaneXZ.h:35
CRenderizableShaderWireFrame.h
mrpt::opengl::CGridPlaneXZ::CGridPlaneXZ
CGridPlaneXZ(float xMin=-10, float xMax=10, float zMin=-10, float zMax=10, float y=0, float frequency=1, float lineWidth=1.3f, bool antiAliasing=true)
Constructor.
mrpt::opengl::CGridPlaneXZ::m_zMin
float m_zMin
Definition: CGridPlaneXZ.h:35
mrpt::opengl::CGridPlaneXZ::getGridFrequency
float getGridFrequency() const
Definition: CGridPlaneXZ.h:70
mrpt::opengl::CGridPlaneXZ
A grid of lines over the XZ plane.
Definition: CGridPlaneXZ.h:29
mrpt::opengl::CGridPlaneXZ::getBoundingBox
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...
Definition: CGridPlaneXZ.cpp:95
mrpt::opengl
The namespace for 3D scene representation and rendering.
Definition: CGlCanvasBase.h:13
mrpt::opengl::CGridPlaneXZ::m_xMin
float m_xMin
Definition: CGridPlaneXZ.h:34
mrpt::opengl::CGridPlaneXZ::setPlaneYcoord
void setPlaneYcoord(float y)
Definition: CGridPlaneXZ.h:58



Page generated by Doxygen 1.8.17 for MRPT 2.0.4 at Sun Jul 19 17:54:30 UTC 2020