Main MRPT website > C++ reference for 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-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_CGridPlaneXY_H
11 #define opengl_CGridPlaneXY_H
12 
14 
15 namespace mrpt
16 {
17 namespace opengl
18 {
19 /** A grid of lines over the XY 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::CGridPlaneXY </td> <td> \image html
26  * preview_CGridPlaneXY.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_yMin, m_yMax;
39  float m_plane_z;
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 ymin, float ymax)
58  {
59  m_xMin = xmin;
60  m_xMax = xmax;
61  m_yMin = ymin;
62  m_yMax = ymax;
64  }
65 
67  float& xmin, float& xmax, float& ymin, float& ymax) const
68  {
69  xmin = m_xMin;
70  xmax = m_xMax;
71  ymin = m_yMin;
72  ymax = m_yMax;
73  }
74 
75  void setPlaneZcoord(float z)
76  {
78  m_plane_z = z;
79  }
80  float getPlaneZcoord() const { return m_plane_z; }
81  void setGridFrequency(float freq)
82  {
83  ASSERT_(freq > 0);
84  m_frequency = freq;
86  }
87  float getGridFrequency() const { return m_frequency; }
88  /** Render */
89  virtual void render_dl() const override;
90 
91  /** Evaluates the bounding box of this object (including possible children)
92  * in the coordinate frame of the object parent. */
93  void getBoundingBox(
94  mrpt::math::TPoint3D& bb_min,
95  mrpt::math::TPoint3D& bb_max) const override;
96 
97  /** Class factory */
99  float xMin, float xMax, float yMin, float yMax, float z = 0,
100  float frequency = 1, float lineWidth = 1.3f, bool antiAliasing = true);
101 
102  /** Constructor */
103  CGridPlaneXY(
104  float xMin = -10, float xMax = 10, float yMin = -10, float yMax = 10,
105  float z = 0, float frequency = 1, float lineWidth = 1.3f,
106  bool antiAliasing = true);
107 
108  /** Private, virtual destructor: only can be deleted from smart pointers */
109  virtual ~CGridPlaneXY() {}
110 };
111 
112 } // end namespace
113 
114 } // End of namespace
115 
116 #endif
void enableAntiAliasing(bool enable=true)
Definition: CGridPlaneXY.h:51
GLdouble GLdouble z
Definition: glext.h:3872
A grid of lines over the XY plane.
Definition: CGridPlaneXY.h:32
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:81
float getGridFrequency() const
Definition: CGridPlaneXY.h:87
void setPlaneLimits(float xmin, float xmax, float ymin, float ymax)
Definition: CGridPlaneXY.h:57
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.
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 setPlaneZcoord(float z)
Definition: CGridPlaneXY.h:75
bool isAntiAliasingEnabled() const
Definition: CGridPlaneXY.h:56
#define ASSERT_(f)
float getLineWidth() const
Definition: CGridPlaneXY.h:50
Lightweight 3D point.
void getPlaneLimits(float &xmin, float &xmax, float &ymin, float &ymax) const
Definition: CGridPlaneXY.h:66
virtual ~CGridPlaneXY()
Private, virtual destructor: only can be deleted from smart pointers.
Definition: CGridPlaneXY.h:109
static Ptr Create(Args &&... args)
Definition: CGridPlaneXY.h:34
float getPlaneZcoord() const
Definition: CGridPlaneXY.h:80
std::shared_ptr< CGridPlaneXY > Ptr
Definition: CGridPlaneXY.h:34
void setLineWidth(float w)
Definition: CGridPlaneXY.h:45



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