MRPT  2.0.4
CGridPlaneXY.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 XY 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::CGridPlaneXY </td> <td> \image html
23  * preview_CGridPlaneXY.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_yMin, m_yMax;
36  float m_plane_z;
37  float m_frequency;
38 
39  public:
40  void setPlaneLimits(float xmin, float xmax, float ymin, float ymax)
41  {
42  m_xMin = xmin;
43  m_xMax = xmax;
44  m_yMin = ymin;
45  m_yMax = ymax;
47  }
48 
50  float& xmin, float& xmax, float& ymin, float& ymax) const
51  {
52  xmin = m_xMin;
53  xmax = m_xMax;
54  ymin = m_yMin;
55  ymax = m_yMax;
56  }
57 
58  void setPlaneZcoord(float z)
59  {
61  m_plane_z = z;
62  }
63  float getPlaneZcoord() const { return m_plane_z; }
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 yMin = -10, float yMax = 10,
81  float z = 0, float frequency = 1, float lineWidth = 1.3f,
82  bool antiAliasing = true);
83 
84  /** Private, virtual destructor: only can be deleted from smart pointers */
85  ~CGridPlaneXY() override = default;
86 };
87 
88 } // namespace mrpt::opengl
A grid of lines over the XY plane.
Definition: CGridPlaneXY.h:29
void notifyChange() const
Call to enable calling renderUpdateBuffers() before the next render() rendering iteration.
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 setGridFrequency(float freq)
Definition: CGridPlaneXY.h:64
#define ASSERT_(f)
Defines an assertion mechanism.
Definition: exceptions.h:120
float getGridFrequency() const
Definition: CGridPlaneXY.h:70
~CGridPlaneXY() override=default
Private, virtual destructor: only can be deleted from smart pointers.
void setPlaneLimits(float xmin, float xmax, float ymin, float ymax)
Definition: CGridPlaneXY.h:40
void setPlaneZcoord(float z)
Definition: CGridPlaneXY.h:58
Renderizable generic renderer for objects using the wireframe shader.
The namespace for 3D scene representation and rendering.
Definition: CGlCanvasBase.h:13
const auto bb_max
#define DEFINE_SERIALIZABLE(class_name, NS)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
const auto bb_min
void onUpdateBuffers_Wireframe() override
Must be implemented in derived classes to update the geometric entities to be drawn in "m_*_buffer" f...
void getPlaneLimits(float &xmin, float &xmax, float &ymin, float &ymax) const
Definition: CGridPlaneXY.h:49
CGridPlaneXY(float xMin=-10, float xMax=10, float yMin=-10, float yMax=10, float z=0, float frequency=1, float lineWidth=1.3f, bool antiAliasing=true)
Constructor.
float getPlaneZcoord() const
Definition: CGridPlaneXY.h:63



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