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
mrpt::opengl::CGridPlaneXY::m_plane_z
float m_plane_z
Definition: CGridPlaneXY.h:36
mrpt::opengl::CRenderizable::notifyChange
void notifyChange() const
Call to enable calling renderUpdateBuffers() before the next render() rendering iteration.
Definition: CRenderizable.h:315
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::CGridPlaneXY::setPlaneZcoord
void setPlaneZcoord(float z)
Definition: CGridPlaneXY.h:58
mrpt::opengl::CRenderizableShaderWireFrame
Renderizable generic renderer for objects using the wireframe shader.
Definition: CRenderizableShaderWireFrame.h:25
ASSERT_
#define ASSERT_(f)
Defines an assertion mechanism.
Definition: exceptions.h:120
mrpt::opengl::CGridPlaneXY::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: CGridPlaneXY.cpp:37
mrpt::opengl::CGridPlaneXY::getGridFrequency
float getGridFrequency() const
Definition: CGridPlaneXY.h:70
mrpt::opengl::CGridPlaneXY::setGridFrequency
void setGridFrequency(float freq)
Definition: CGridPlaneXY.h:64
bb_max
const auto bb_max
Definition: CPose3DPDFGrid_unittest.cpp:25
mrpt::opengl::CGridPlaneXY::~CGridPlaneXY
~CGridPlaneXY() override=default
Private, virtual destructor: only can be deleted from smart pointers.
bb_min
const auto bb_min
Definition: CPose3DPDFGrid_unittest.cpp:23
mrpt::opengl::CGridPlaneXY::setPlaneLimits
void setPlaneLimits(float xmin, float xmax, float ymin, float ymax)
Definition: CGridPlaneXY.h:40
mrpt::opengl::CGridPlaneXY
A grid of lines over the XY plane.
Definition: CGridPlaneXY.h:30
mrpt::opengl::CGridPlaneXY::getPlaneLimits
void getPlaneLimits(float &xmin, float &xmax, float &ymin, float &ymax) const
Definition: CGridPlaneXY.h:49
mrpt::opengl::CGridPlaneXY::getPlaneZcoord
float getPlaneZcoord() const
Definition: CGridPlaneXY.h:63
mrpt::opengl::CGridPlaneXY::m_frequency
float m_frequency
Definition: CGridPlaneXY.h:37
CRenderizableShaderWireFrame.h
mrpt::opengl::CGridPlaneXY::m_xMax
float m_xMax
Definition: CGridPlaneXY.h:34
mrpt::opengl::CGridPlaneXY::CGridPlaneXY
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
mrpt::opengl::CGridPlaneXY::m_yMax
float m_yMax
Definition: CGridPlaneXY.h:35
mrpt::opengl::CGridPlaneXY::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: CGridPlaneXY.cpp:95
mrpt::opengl::CGridPlaneXY::m_yMin
float m_yMin
Definition: CGridPlaneXY.h:35
mrpt::opengl
The namespace for 3D scene representation and rendering.
Definition: CGlCanvasBase.h:14
mrpt::opengl::CGridPlaneXY::m_xMin
float m_xMin
Definition: CGridPlaneXY.h:34



Page generated by Doxygen 1.8.18 for MRPT 2.0.4 at Thu Sep 24 07:14:18 UTC 2020