MRPT  1.9.9
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-2019, 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  float m_lineWidth;
40 
41  public:
42  void setLineWidth(float w)
43  {
44  m_lineWidth = w;
46  }
47  float getLineWidth() const { return m_lineWidth; }
48  void enableAntiAliasing(bool enable = true)
49  {
50  m_antiAliasing = enable;
52  }
53  bool isAntiAliasingEnabled() const { return m_antiAliasing; }
54  void setPlaneLimits(float xmin, float xmax, float zmin, float zmax)
55  {
56  m_xMin = xmin;
57  m_xMax = xmax;
58  m_zMin = zmin;
59  m_zMax = zmax;
61  }
62 
64  float& xmin, float& xmax, float& zmin, float& zmax) const
65  {
66  xmin = m_xMin;
67  xmax = m_xMax;
68  zmin = m_zMin;
69  zmax = m_zMax;
70  }
71 
72  void setPlaneYcoord(float y)
73  {
74  m_plane_y = y;
76  }
77  float getPlaneYcoord() const { return m_plane_y; }
78  void setGridFrequency(float freq)
79  {
80  ASSERT_(freq > 0);
81  m_frequency = freq;
83  }
84  float getGridFrequency() const { return m_frequency; }
85  /** Render
86  */
87  void render_dl() const override;
88 
89  /** Evaluates the bounding box of this object (including possible children)
90  * in the coordinate frame of the object parent. */
91  void getBoundingBox(
93  mrpt::math::TPoint3D& bb_max) const override;
94 
95  /** Constructor */
97  float xMin = -10, float xMax = 10, float zMin = -10, float zMax = 10,
98  float y = 0, float frequency = 1, float lineWidth = 1.3f,
99  bool antiAliasing = true);
100  /** Private, virtual destructor: only can be deleted from smart pointers */
101  ~CGridPlaneXZ() override = default;
102 };
103 
104 } // namespace mrpt::opengl
void notifyChange() const
Must be called to notify that the object has changed (so, the display list must be updated) ...
float getGridFrequency() const
Definition: CGridPlaneXZ.h:84
void setPlaneYcoord(float y)
Definition: CGridPlaneXZ.h:72
A grid of lines over the XZ plane.
Definition: CGridPlaneXZ.h:29
A renderizable object suitable for rendering with OpenGL&#39;s display lists.
#define ASSERT_(f)
Defines an assertion mechanism.
Definition: exceptions.h:120
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 setGridFrequency(float freq)
Definition: CGridPlaneXZ.h:78
bool isAntiAliasingEnabled() const
Definition: CGridPlaneXZ.h:53
float getLineWidth() const
Definition: CGridPlaneXZ.h:47
void setLineWidth(float w)
Definition: CGridPlaneXZ.h:42
~CGridPlaneXZ() override=default
Private, virtual destructor: only can be deleted from smart pointers.
float getPlaneYcoord() const
Definition: CGridPlaneXZ.h:77
void setPlaneLimits(float xmin, float xmax, float zmin, float zmax)
Definition: CGridPlaneXZ.h:54
void render_dl() const override
Render.
The namespace for 3D scene representation and rendering.
Definition: CGlCanvasBase.h:15
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:63
#define DEFINE_SERIALIZABLE(class_name, NS)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
const auto bb_min
Lightweight 3D point.
Definition: TPoint3D.h:90
void enableAntiAliasing(bool enable=true)
Definition: CGridPlaneXZ.h:48



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: 7e629e01a Sat Dec 14 00:05:55 2019 +0100 at sáb dic 14 00:15:10 CET 2019