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
float getGridFrequency() const
Definition: CGridPlaneXZ.h:70
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.
void notifyChange() const
Call to enable calling renderUpdateBuffers() before the next render() rendering iteration.
void setPlaneYcoord(float y)
Definition: CGridPlaneXZ.h:58
A grid of lines over the XZ plane.
Definition: CGridPlaneXZ.h:29
#define ASSERT_(f)
Defines an assertion mechanism.
Definition: exceptions.h:120
void setGridFrequency(float freq)
Definition: CGridPlaneXZ.h:64
void onUpdateBuffers_Wireframe() override
Must be implemented in derived classes to update the geometric entities to be drawn in "m_*_buffer" f...
~CGridPlaneXZ() override=default
Private, virtual destructor: only can be deleted from smart pointers.
float getPlaneYcoord() const
Definition: CGridPlaneXZ.h:63
Renderizable generic renderer for objects using the wireframe shader.
void setPlaneLimits(float xmin, float xmax, float zmin, float zmax)
Definition: CGridPlaneXZ.h:40
The namespace for 3D scene representation and rendering.
Definition: CGlCanvasBase.h:13
const auto bb_max
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 getPlaneLimits(float &xmin, float &xmax, float &zmin, float &zmax) const
Definition: CGridPlaneXZ.h:49
#define DEFINE_SERIALIZABLE(class_name, NS)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
const auto bb_min



Page generated by Doxygen 1.8.14 for MRPT 2.0.4 Git: 33de1d0ad Sat Jun 20 11:02:42 2020 +0200 at sáb jun 20 17:35:17 CEST 2020