Main MRPT website > C++ reference for MRPT 1.5.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 
20 
21  // This must be added to any CSerializable derived class:
22  DEFINE_SERIALIZABLE_PRE_CUSTOM_BASE_LINKAGE( CGridPlaneXZ, CRenderizableDisplayList, OPENGL_IMPEXP )
23 
24  /** A grid of lines over the XZ plane.
25  * \sa opengl::COpenGLScene
26  *
27  * <div align="center">
28  * <table border="0" cellspan="4" cellspacing="4" style="border-width: 1px; border-style: solid;">
29  * <tr> <td> mrpt::opengl::CGridPlaneXZ </td> <td> \image html preview_CGridPlaneXZ.png </td> </tr>
30  * </table>
31  * </div>
32  *
33  * \ingroup mrpt_opengl_grp
34  */
36  {
38 
39  protected:
40  float m_xMin, m_xMax;
41  float m_zMin, m_zMax;
42  float m_plane_y;
43  float m_frequency;
44  float m_lineWidth;
46 
47  public:
48  void setLineWidth(float w) { m_lineWidth=w; CRenderizableDisplayList::notifyChange(); }
49  float getLineWidth() const { return m_lineWidth;}
50 
51  void enableAntiAliasing(bool enable=true) { m_antiAliasing =enable; CRenderizableDisplayList::notifyChange(); }
52  bool isAntiAliasingEnabled() const { return m_antiAliasing; }
53 
54  void setPlaneLimits(float xmin,float xmax, float zmin, float zmax)
55  {
56  m_xMin=xmin; m_xMax = xmax;
57  m_zMin=zmin; m_zMax = zmax;
59  }
60 
61  void getPlaneLimits(float &xmin,float &xmax, float &zmin, float &zmax) const
62  {
63  xmin=m_xMin; xmax=m_xMax;
64  zmin=m_zMin; zmax=m_zMax;
65  }
66 
68  float getPlaneYcoord() const { return m_plane_y; }
69 
71  float getGridFrequency() const { return m_frequency; }
72 
73 
74 
75  /** Class factory */
76  static CGridPlaneXZPtr Create(
77  float xMin = -10,
78  float xMax = 10,
79  float zMin = -10,
80  float zMax = 10,
81  float y = 0,
82  float frequency = 1,
83  float lineWidth = 1.3f,
84  bool antiAliasing = true
85  );
86 
87  /** Render
88  */
89  void render_dl() const MRPT_OVERRIDE;
90 
91  /** Evaluates the bounding box of this object (including possible children) in the coordinate frame of the object parent. */
92  void getBoundingBox(mrpt::math::TPoint3D &bb_min, mrpt::math::TPoint3D &bb_max) const MRPT_OVERRIDE;
93  private:
94  /** Constructor */
96  float xMin = -10,
97  float xMax = 10,
98  float zMin = -10,
99  float zMax = 10,
100  float y = 0,
101  float frequency = 1,
102  float lineWidth = 1.3f,
103  bool antiAliasing = true
104  );
105  /** Private, virtual destructor: only can be deleted from smart pointers */
106  virtual ~CGridPlaneXZ() { }
107  };
108  DEFINE_SERIALIZABLE_POST_CUSTOM_BASE_LINKAGE( CGridPlaneXZ, CRenderizableDisplayList, OPENGL_IMPEXP )
109 
110  } // end namespace
111 
112 } // End of namespace
113 
114 
115 #endif
float getGridFrequency() const
Definition: CGridPlaneXZ.h:71
#define MRPT_OVERRIDE
C++11 "override" for virtuals:
void setPlaneYcoord(float y)
Definition: CGridPlaneXZ.h:67
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:35
GLubyte GLubyte GLubyte GLubyte w
Definition: glext.h:3962
A renderizable object suitable for rendering with OpenGL&#39;s display lists.
#define DEFINE_SERIALIZABLE_PRE_CUSTOM_BASE_LINKAGE(class_name, base_name, _LINKAGE_)
This declaration must be inserted in all CSerializable classes definition, before the class declarati...
void setGridFrequency(float freq)
Definition: CGridPlaneXZ.h:70
bool isAntiAliasingEnabled() const
Definition: CGridPlaneXZ.h:52
JHUFF_TBL long freq[]
Definition: jchuff.h:44
float getLineWidth() const
Definition: CGridPlaneXZ.h:49
void setLineWidth(float w)
Definition: CGridPlaneXZ.h:48
GLclampd zmax
Definition: glext.h:6808
float getPlaneYcoord() const
Definition: CGridPlaneXZ.h:68
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:54
#define ASSERT_(f)
GLenum GLint GLint y
Definition: glext.h:3516
void getPlaneLimits(float &xmin, float &xmax, float &zmin, float &zmax) const
Definition: CGridPlaneXZ.h:61
#define DEFINE_SERIALIZABLE_POST_CUSTOM_BASE_LINKAGE(class_name, base_name, _LINKAGE_)
void enableAntiAliasing(bool enable=true)
Definition: CGridPlaneXZ.h:51



Page generated by Doxygen 1.8.14 for MRPT 1.5.9 Git: 690a4699f Wed Apr 15 19:29:53 2020 +0200 at miƩ abr 15 19:30:12 CEST 2020