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::opengl
16 {
17 /** A grid of lines over the XZ plane.
18  * \sa opengl::COpenGLScene
19  *
20  * <div align="center">
21  * <table border="0" cellspan="4" cellspacing="4" style="border-width: 1px;
22  * border-style: solid;">
23  * <tr> <td> mrpt::opengl::CGridPlaneXZ </td> <td> \image html
24  * preview_CGridPlaneXZ.png </td> </tr>
25  * </table>
26  * </div>
27  *
28  * \ingroup mrpt_opengl_grp
29  */
31 {
33 
34  protected:
35  float m_xMin, m_xMax;
36  float m_zMin, m_zMax;
37  float m_plane_y;
38  float m_frequency;
39  float m_lineWidth;
41 
42  public:
43  void setLineWidth(float w)
44  {
45  m_lineWidth = w;
47  }
48  float getLineWidth() const { return m_lineWidth; }
49  void enableAntiAliasing(bool enable = true)
50  {
51  m_antiAliasing = enable;
53  }
54  bool isAntiAliasingEnabled() const { return m_antiAliasing; }
55  void setPlaneLimits(float xmin, float xmax, float zmin, float zmax)
56  {
57  m_xMin = xmin;
58  m_xMax = xmax;
59  m_zMin = zmin;
60  m_zMax = zmax;
62  }
63 
65  float& xmin, float& xmax, float& zmin, float& zmax) const
66  {
67  xmin = m_xMin;
68  xmax = m_xMax;
69  zmin = m_zMin;
70  zmax = m_zMax;
71  }
72 
73  void setPlaneYcoord(float y)
74  {
75  m_plane_y = y;
77  }
78  float getPlaneYcoord() const { return m_plane_y; }
79  void setGridFrequency(float freq)
80  {
81  ASSERT_(freq > 0);
82  m_frequency = freq;
84  }
85  float getGridFrequency() const { return m_frequency; }
86  /** Class factory */
88  float xMin = -10, float xMax = 10, float zMin = -10, float zMax = 10,
89  float y = 0, float frequency = 1, float lineWidth = 1.3f,
90  bool antiAliasing = true);
91 
92  /** Render
93  */
94  void render_dl() const override;
95 
96  /** Evaluates the bounding box of this object (including possible children)
97  * in the coordinate frame of the object parent. */
98  void getBoundingBox(
99  mrpt::math::TPoint3D& bb_min,
100  mrpt::math::TPoint3D& bb_max) const override;
101 
102  /** Constructor */
103  CGridPlaneXZ(
104  float xMin = -10, float xMax = 10, float zMin = -10, float zMax = 10,
105  float y = 0, float frequency = 1, float lineWidth = 1.3f,
106  bool antiAliasing = true);
107  /** Private, virtual destructor: only can be deleted from smart pointers */
108  virtual ~CGridPlaneXZ() {}
109 };
110 
111 }
112 #endif
113 
114 
float getGridFrequency() const
Definition: CGridPlaneXZ.h:85
void setPlaneYcoord(float y)
Definition: CGridPlaneXZ.h:73
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:30
GLubyte GLubyte GLubyte GLubyte w
Definition: glext.h:4178
A renderizable object suitable for rendering with OpenGL&#39;s display lists.
#define ASSERT_(f)
Defines an assertion mechanism.
Definition: exceptions.h:113
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:108
void setGridFrequency(float freq)
Definition: CGridPlaneXZ.h:79
bool isAntiAliasingEnabled() const
Definition: CGridPlaneXZ.h:54
float getLineWidth() const
Definition: CGridPlaneXZ.h:48
void setLineWidth(float w)
Definition: CGridPlaneXZ.h:43
GLclampd zmax
Definition: glext.h:7918
float getPlaneYcoord() const
Definition: CGridPlaneXZ.h:78
#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:55
void render_dl() const override
Render.
The namespace for 3D scene representation and rendering.
Definition: CGlCanvasBase.h:15
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:64
Lightweight 3D point.
void enableAntiAliasing(bool enable=true)
Definition: CGridPlaneXZ.h:49
static Ptr Create(Args &&... args)
Definition: CGridPlaneXZ.h:32



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: 7d5e6d718 Fri Aug 24 01:51:28 2018 +0200 at lun nov 2 08:35:50 CET 2020