MRPT  1.9.9
CGridPlaneXY.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_CGridPlaneXY_H
11 #define opengl_CGridPlaneXY_H
12 
14 
15 namespace mrpt::opengl
16 {
17 /** A grid of lines over the XY 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::CGridPlaneXY </td> <td> \image html
24  * preview_CGridPlaneXY.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_yMin, m_yMax;
37  float m_plane_z;
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 ymin, float ymax)
56  {
57  m_xMin = xmin;
58  m_xMax = xmax;
59  m_yMin = ymin;
60  m_yMax = ymax;
62  }
63 
65  float& xmin, float& xmax, float& ymin, float& ymax) const
66  {
67  xmin = m_xMin;
68  xmax = m_xMax;
69  ymin = m_yMin;
70  ymax = m_yMax;
71  }
72 
73  void setPlaneZcoord(float z)
74  {
76  m_plane_z = z;
77  }
78  float getPlaneZcoord() const { return m_plane_z; }
79  void setGridFrequency(float freq)
80  {
81  ASSERT_(freq > 0);
82  m_frequency = freq;
84  }
85  float getGridFrequency() const { return m_frequency; }
86  /** Render */
87  virtual 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(
92  mrpt::math::TPoint3D& bb_min,
93  mrpt::math::TPoint3D& bb_max) const override;
94 
95  /** Class factory */
97  float xMin, float xMax, float yMin, float yMax, float z = 0,
98  float frequency = 1, float lineWidth = 1.3f, bool antiAliasing = true);
99 
100  /** Constructor */
101  CGridPlaneXY(
102  float xMin = -10, float xMax = 10, float yMin = -10, float yMax = 10,
103  float z = 0, float frequency = 1, float lineWidth = 1.3f,
104  bool antiAliasing = true);
105 
106  /** Private, virtual destructor: only can be deleted from smart pointers */
107  virtual ~CGridPlaneXY() {}
108 };
109 
110 }
111 #endif
112 
113 
void enableAntiAliasing(bool enable=true)
Definition: CGridPlaneXY.h:49
GLdouble GLdouble z
Definition: glext.h:3872
A grid of lines over the XY plane.
Definition: CGridPlaneXY.h:30
virtual void render_dl() const override
Render.
EIGEN_STRONG_INLINE void notifyChange() const
Must be called to notify that the object has changed (so, the display list must be updated) ...
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...
GLubyte GLubyte GLubyte GLubyte w
Definition: glext.h:4178
A renderizable object suitable for rendering with OpenGL&#39;s display lists.
void setGridFrequency(float freq)
Definition: CGridPlaneXY.h:79
#define ASSERT_(f)
Defines an assertion mechanism.
Definition: exceptions.h:113
float getGridFrequency() const
Definition: CGridPlaneXY.h:85
void setPlaneLimits(float xmin, float xmax, float ymin, float ymax)
Definition: CGridPlaneXY.h:55
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.
#define DEFINE_SERIALIZABLE(class_name)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
void setPlaneZcoord(float z)
Definition: CGridPlaneXY.h:73
bool isAntiAliasingEnabled() const
Definition: CGridPlaneXY.h:54
The namespace for 3D scene representation and rendering.
Definition: CGlCanvasBase.h:15
float getLineWidth() const
Definition: CGridPlaneXY.h:48
Lightweight 3D point.
void getPlaneLimits(float &xmin, float &xmax, float &ymin, float &ymax) const
Definition: CGridPlaneXY.h:64
virtual ~CGridPlaneXY()
Private, virtual destructor: only can be deleted from smart pointers.
Definition: CGridPlaneXY.h:107
static Ptr Create(Args &&... args)
Definition: CGridPlaneXY.h:32
float getPlaneZcoord() const
Definition: CGridPlaneXY.h:78
void setLineWidth(float w)
Definition: CGridPlaneXY.h:43



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