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-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
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
mrpt::opengl::CGridPlaneXY::Ptr
std::shared_ptr< CGridPlaneXY > Ptr
Definition: CGridPlaneXY.h:34
mrpt::opengl::CGridPlaneXY::render_dl
virtual void render_dl() const override
Render.
Definition: CGridPlaneXY.cpp:50
mrpt::opengl::CGridPlaneXY::setLineWidth
void setLineWidth(float w)
Definition: CGridPlaneXY.h:45
mrpt::opengl::CGridPlaneXY::m_plane_z
float m_plane_z
Definition: CGridPlaneXY.h:39
mrpt::opengl::CGridPlaneXY::CGridPlaneXY
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
Definition: CGridPlaneXY.cpp:33
mrpt::opengl::CGridPlaneXY::getLineWidth
float getLineWidth() const
Definition: CGridPlaneXY.h:50
CRenderizableDisplayList.h
mrpt::opengl::CGridPlaneXY::setPlaneZcoord
void setPlaneZcoord(float z)
Definition: CGridPlaneXY.h:75
mrpt::opengl::CRenderizableDisplayList
A renderizable object suitable for rendering with OpenGL's display lists.
Definition: CRenderizableDisplayList.h:39
mrpt::opengl::CGridPlaneXY::isAntiAliasingEnabled
bool isAntiAliasingEnabled() const
Definition: CGridPlaneXY.h:56
mrpt::opengl::CRenderizableDisplayList::notifyChange
EIGEN_STRONG_INLINE void notifyChange() const
Must be called to notify that the object has changed (so, the display list must be updated)
Definition: CRenderizableDisplayList.h:57
mrpt::opengl::CGridPlaneXY::enableAntiAliasing
void enableAntiAliasing(bool enable=true)
Definition: CGridPlaneXY.h:51
mrpt
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
Definition: CKalmanFilterCapable.h:30
w
GLubyte GLubyte GLubyte GLubyte w
Definition: glext.h:4178
ASSERT_
#define ASSERT_(f)
Defines an assertion mechanism.
Definition: exceptions.h:113
mrpt::opengl::CGridPlaneXY::getGridFrequency
float getGridFrequency() const
Definition: CGridPlaneXY.h:87
mrpt::opengl::CGridPlaneXY::setGridFrequency
void setGridFrequency(float freq)
Definition: CGridPlaneXY.h:81
mrpt::opengl::CGridPlaneXY::setPlaneLimits
void setPlaneLimits(float xmin, float xmax, float ymin, float ymax)
Definition: CGridPlaneXY.h:57
mrpt::opengl::CGridPlaneXY
A grid of lines over the XY plane.
Definition: CGridPlaneXY.h:32
mrpt::opengl::CGridPlaneXY::getPlaneLimits
void getPlaneLimits(float &xmin, float &xmax, float &ymin, float &ymax) const
Definition: CGridPlaneXY.h:66
mrpt::opengl::CGridPlaneXY::m_lineWidth
float m_lineWidth
Definition: CGridPlaneXY.h:41
mrpt::opengl::CGridPlaneXY::Create
static Ptr Create(Args &&... args)
Definition: CGridPlaneXY.h:34
mrpt::opengl::CGridPlaneXY::getPlaneZcoord
float getPlaneZcoord() const
Definition: CGridPlaneXY.h:80
mrpt::opengl::CGridPlaneXY::m_frequency
float m_frequency
Definition: CGridPlaneXY.h:40
mrpt::opengl::CGridPlaneXY::m_xMax
float m_xMax
Definition: CGridPlaneXY.h:37
mrpt::math::TPoint3D
Lightweight 3D point.
Definition: lightweight_geom_data.h:378
DEFINE_SERIALIZABLE
#define DEFINE_SERIALIZABLE(class_name)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
Definition: CSerializable.h:102
mrpt::opengl::CGridPlaneXY::m_yMax
float m_yMax
Definition: CGridPlaneXY.h:38
z
GLdouble GLdouble z
Definition: glext.h:3872
mrpt::opengl::CGridPlaneXY::m_antiAliasing
bool m_antiAliasing
Definition: CGridPlaneXY.h:42
mrpt::opengl::CGridPlaneXY::getBoundingBox
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...
Definition: CGridPlaneXY.cpp:129
mrpt::opengl::CGridPlaneXY::m_yMin
float m_yMin
Definition: CGridPlaneXY.h:38
mrpt::opengl::CGridPlaneXY::~CGridPlaneXY
virtual ~CGridPlaneXY()
Private, virtual destructor: only can be deleted from smart pointers.
Definition: CGridPlaneXY.h:109
mrpt::opengl::CGridPlaneXY::m_xMin
float m_xMin
Definition: CGridPlaneXY.h:37



Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at miƩ 12 jul 2023 10:03:34 CEST