Main MRPT website > C++ reference for MRPT 1.9.9
CGridPlaneXZ.h
Go to the documentation of this file.
1 /* +------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | http://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2018, Individual contributors, see AUTHORS file |
6  | See: http://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See details in http://www.mrpt.org/License |
8  +------------------------------------------------------------------------+ */
9 
10 #ifndef opengl_CGridPlaneXZ_H
11 #define opengl_CGridPlaneXZ_H
12 
14 
15 namespace mrpt
16 {
17 namespace opengl
18 {
19 /** A grid of lines over the XZ plane.
20  * \sa opengl::COpenGLScene
21  *
22  * <div align="center">
23  * <table border="0" cellspan="4" cellspacing="4" style="border-width: 1px;
24  * border-style: solid;">
25  * <tr> <td> mrpt::opengl::CGridPlaneXZ </td> <td> \image html
26  * preview_CGridPlaneXZ.png </td> </tr>
27  * </table>
28  * </div>
29  *
30  * \ingroup mrpt_opengl_grp
31  */
33 {
35 
36  protected:
37  float m_xMin, m_xMax;
38  float m_zMin, m_zMax;
39  float m_plane_y;
40  float m_frequency;
41  float m_lineWidth;
43 
44  public:
45  void setLineWidth(float w)
46  {
47  m_lineWidth = w;
49  }
50  float getLineWidth() const { return m_lineWidth; }
51  void enableAntiAliasing(bool enable = true)
52  {
53  m_antiAliasing = enable;
55  }
56  bool isAntiAliasingEnabled() const { return m_antiAliasing; }
57  void setPlaneLimits(float xmin, float xmax, float zmin, float zmax)
58  {
59  m_xMin = xmin;
60  m_xMax = xmax;
61  m_zMin = zmin;
62  m_zMax = zmax;
64  }
65 
67  float& xmin, float& xmax, float& zmin, float& zmax) const
68  {
69  xmin = m_xMin;
70  xmax = m_xMax;
71  zmin = m_zMin;
72  zmax = m_zMax;
73  }
74 
75  void setPlaneYcoord(float y)
76  {
77  m_plane_y = y;
79  }
80  float getPlaneYcoord() const { return m_plane_y; }
81  void setGridFrequency(float freq)
82  {
83  ASSERT_(freq > 0);
84  m_frequency = freq;
86  }
87  float getGridFrequency() const { return m_frequency; }
88  /** Class factory */
90  float xMin = -10, float xMax = 10, float zMin = -10, float zMax = 10,
91  float y = 0, float frequency = 1, float lineWidth = 1.3f,
92  bool antiAliasing = true);
93 
94  /** Render
95  */
96  void render_dl() const override;
97 
98  /** Evaluates the bounding box of this object (including possible children)
99  * in the coordinate frame of the object parent. */
100  void getBoundingBox(
101  mrpt::math::TPoint3D& bb_min,
102  mrpt::math::TPoint3D& bb_max) const override;
103 
104  /** Constructor */
105  CGridPlaneXZ(
106  float xMin = -10, float xMax = 10, float zMin = -10, float zMax = 10,
107  float y = 0, float frequency = 1, float lineWidth = 1.3f,
108  bool antiAliasing = true);
109  /** Private, virtual destructor: only can be deleted from smart pointers */
110  virtual ~CGridPlaneXZ() {}
111 };
112 
113 } // end namespace
114 
115 } // End of namespace
116 
117 #endif
mrpt::opengl::CGridPlaneXZ::getPlaneYcoord
float getPlaneYcoord() const
Definition: CGridPlaneXZ.h:80
zmax
GLclampd zmax
Definition: glext.h:7918
mrpt::opengl::CGridPlaneXZ::setGridFrequency
void setGridFrequency(float freq)
Definition: CGridPlaneXZ.h:81
mrpt::opengl::CGridPlaneXZ::m_lineWidth
float m_lineWidth
Definition: CGridPlaneXZ.h:41
mrpt::opengl::CGridPlaneXZ::m_frequency
float m_frequency
Definition: CGridPlaneXZ.h:40
CRenderizableDisplayList.h
mrpt::opengl::CGridPlaneXZ::getPlaneLimits
void getPlaneLimits(float &xmin, float &xmax, float &zmin, float &zmax) const
Definition: CGridPlaneXZ.h:66
mrpt::opengl::CGridPlaneXZ::m_xMax
float m_xMax
Definition: CGridPlaneXZ.h:37
mrpt::opengl::CRenderizableDisplayList
A renderizable object suitable for rendering with OpenGL's display lists.
Definition: CRenderizableDisplayList.h:39
mrpt::opengl::CGridPlaneXZ::setLineWidth
void setLineWidth(float w)
Definition: CGridPlaneXZ.h:45
mrpt::opengl::CRenderizableDisplayList::notifyChange
EIGEN_STRONG_INLINE void notifyChange() const
Must be called to notify that the object has changed (so, the display list must be updated)
Definition: CRenderizableDisplayList.h:57
mrpt::opengl::CGridPlaneXZ::m_antiAliasing
bool m_antiAliasing
Definition: CGridPlaneXZ.h:42
mrpt::opengl::CGridPlaneXZ::Ptr
std::shared_ptr< CGridPlaneXZ > Ptr
Definition: CGridPlaneXZ.h:34
mrpt
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
Definition: CKalmanFilterCapable.h:30
w
GLubyte GLubyte GLubyte GLubyte w
Definition: glext.h:4178
ASSERT_
#define ASSERT_(f)
Defines an assertion mechanism.
Definition: exceptions.h:113
mrpt::opengl::CGridPlaneXZ::Create
static Ptr Create(Args &&... args)
Definition: CGridPlaneXZ.h:34
mrpt::opengl::CGridPlaneXZ::m_plane_y
float m_plane_y
Definition: CGridPlaneXZ.h:39
mrpt::opengl::CGridPlaneXZ::enableAntiAliasing
void enableAntiAliasing(bool enable=true)
Definition: CGridPlaneXZ.h:51
mrpt::opengl::CGridPlaneXZ::setPlaneLimits
void setPlaneLimits(float xmin, float xmax, float zmin, float zmax)
Definition: CGridPlaneXZ.h:57
mrpt::opengl::CGridPlaneXZ::m_zMax
float m_zMax
Definition: CGridPlaneXZ.h:38
mrpt::opengl::CGridPlaneXZ::render_dl
void render_dl() const override
Render.
Definition: CGridPlaneXZ.cpp:51
mrpt::opengl::CGridPlaneXZ::m_zMin
float m_zMin
Definition: CGridPlaneXZ.h:38
mrpt::opengl::CGridPlaneXZ::isAntiAliasingEnabled
bool isAntiAliasingEnabled() const
Definition: CGridPlaneXZ.h:56
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.
Definition: CGridPlaneXZ.cpp:34
mrpt::opengl::CGridPlaneXZ::getGridFrequency
float getGridFrequency() const
Definition: CGridPlaneXZ.h:87
mrpt::math::TPoint3D
Lightweight 3D point.
Definition: lightweight_geom_data.h:378
mrpt::opengl::CGridPlaneXZ
A grid of lines over the XZ plane.
Definition: CGridPlaneXZ.h:32
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:132
mrpt::opengl::CGridPlaneXZ::~CGridPlaneXZ
virtual ~CGridPlaneXZ()
Private, virtual destructor: only can be deleted from smart pointers.
Definition: CGridPlaneXZ.h:110
DEFINE_SERIALIZABLE
#define DEFINE_SERIALIZABLE(class_name)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
Definition: CSerializable.h:102
mrpt::opengl::CGridPlaneXZ::getLineWidth
float getLineWidth() const
Definition: CGridPlaneXZ.h:50
y
GLenum GLint GLint y
Definition: glext.h:3538
mrpt::opengl::CGridPlaneXZ::m_xMin
float m_xMin
Definition: CGridPlaneXZ.h:37
mrpt::opengl::CGridPlaneXZ::setPlaneYcoord
void setPlaneYcoord(float y)
Definition: CGridPlaneXZ.h:75



Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at miƩ 12 jul 2023 10:03:34 CEST