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-2017, 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
float getGridFrequency() const
Definition: CGridPlaneXZ.h:87
void setPlaneYcoord(float y)
Definition: CGridPlaneXZ.h:75
EIGEN_STRONG_INLINE void notifyChange() const
Must be called to notify that the object has changed (so, the display list must be updated) ...
A grid of lines over the XZ plane.
Definition: CGridPlaneXZ.h:32
GLubyte GLubyte GLubyte GLubyte w
Definition: glext.h:4178
A renderizable object suitable for rendering with OpenGL&#39;s display lists.
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.
virtual ~CGridPlaneXZ()
Private, virtual destructor: only can be deleted from smart pointers.
Definition: CGridPlaneXZ.h:110
void setGridFrequency(float freq)
Definition: CGridPlaneXZ.h:81
bool isAntiAliasingEnabled() const
Definition: CGridPlaneXZ.h:56
float getLineWidth() const
Definition: CGridPlaneXZ.h:50
void setLineWidth(float w)
Definition: CGridPlaneXZ.h:45
GLclampd zmax
Definition: glext.h:7918
float getPlaneYcoord() const
Definition: CGridPlaneXZ.h:80
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
#define DEFINE_SERIALIZABLE(class_name)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
void setPlaneLimits(float xmin, float xmax, float zmin, float zmax)
Definition: CGridPlaneXZ.h:57
void render_dl() const override
Render.
std::shared_ptr< CGridPlaneXZ > Ptr
Definition: CGridPlaneXZ.h:34
#define ASSERT_(f)
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...
GLenum GLint GLint y
Definition: glext.h:3538
void getPlaneLimits(float &xmin, float &xmax, float &zmin, float &zmax) const
Definition: CGridPlaneXZ.h:66
Lightweight 3D point.
void enableAntiAliasing(bool enable=true)
Definition: CGridPlaneXZ.h:51
static Ptr Create(Args &&... args)
Definition: CGridPlaneXZ.h:34



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: ae4571287 Thu Nov 23 00:06:53 2017 +0100 at dom oct 27 23:51:55 CET 2019