Main MRPT website > C++ reference for MRPT 1.9.9
CSimpleLine.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 #ifndef opengl_CSimpleLine_H
10 #define opengl_CSimpleLine_H
11 
13 
14 namespace mrpt
15 {
16 namespace opengl
17 {
18 /** A line segment
19  * \sa opengl::COpenGLScene
20  * \ingroup mrpt_opengl_grp
21  */
23 {
25 
26  protected:
27  float m_x0, m_y0, m_z0;
28  float m_x1, m_y1, m_z1;
29  float m_lineWidth;
31 
32  public:
33  void setLineWidth(float w)
34  {
35  m_lineWidth = w;
37  }
38  float getLineWidth() const { return m_lineWidth; }
39  void enableAntiAliasing(bool enable = true)
40  {
41  m_antiAliasing = enable;
43  }
44  bool isAntiAliasingEnabled() const { return m_antiAliasing; }
46  float x0, float y0, float z0, float x1, float y1, float z1)
47  {
48  m_x0 = x0;
49  m_y0 = y0;
50  m_z0 = z0;
51  m_x1 = x1;
52  m_y1 = y1;
53  m_z1 = z1;
55  }
56 
58  float& x0, float& y0, float& z0, float& x1, float& y1, float& z1) const
59  {
60  x0 = m_x0;
61  y0 = m_y0;
62  z0 = m_z0;
63  x1 = m_x1;
64  y1 = m_y1;
65  z1 = m_z1;
66  }
67 
68  /** Render
69  */
70  void render_dl() const override;
71 
72  /** Class factory */
73  static CSimpleLine::Ptr Create(
74  float x0, float y0, float z0, float x1, float y1, float z1,
75  float lineWidth = 1);
76 
77  /** Evaluates the bounding box of this object (including possible children)
78  * in the coordinate frame of the object parent. */
79  void getBoundingBox(
80  mrpt::math::TPoint3D& bb_min,
81  mrpt::math::TPoint3D& bb_max) const override;
82 
83  /** Constructor
84  */
86  float x0 = 0, float y0 = 0, float z0 = 0, float x1 = 0, float y1 = 0,
87  float z1 = 0, float lineWidth = 1, bool antiAliasing = true);
88 
89  /** Private, virtual destructor: only can be deleted from smart pointers */
90  virtual ~CSimpleLine() {}
91 };
92 
93 } // end namespace
94 
95 } // End of namespace
96 
97 #endif
EIGEN_STRONG_INLINE void notifyChange() const
Must be called to notify that the object has changed (so, the display list must be updated) ...
GLubyte GLubyte GLubyte GLubyte w
Definition: glext.h:4178
A renderizable object suitable for rendering with OpenGL's display lists.
float getLineWidth() const
Definition: CSimpleLine.h:38
void getLineCoords(float &x0, float &y0, float &z0, float &x1, float &y1, float &z1) const
Definition: CSimpleLine.h:57
void render_dl() const override
Render.
Definition: CSimpleLine.cpp:47
virtual ~CSimpleLine()
Private, virtual destructor: only can be deleted from smart pointers.
Definition: CSimpleLine.h:90
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...
bool isAntiAliasingEnabled() const
Definition: CSimpleLine.h:44
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...
A line segment.
Definition: CSimpleLine.h:22
void enableAntiAliasing(bool enable=true)
Definition: CSimpleLine.h:39
CSimpleLine(float x0=0, float y0=0, float z0=0, float x1=0, float y1=0, float z1=0, float lineWidth=1, bool antiAliasing=true)
Constructor.
Definition: CSimpleLine.cpp:30
Lightweight 3D point.
void setLineWidth(float w)
Definition: CSimpleLine.h:33
void setLineCoords(float x0, float y0, float z0, float x1, float y1, float z1)
Definition: CSimpleLine.h:45
static Ptr Create(Args &&... args)
Definition: CSimpleLine.h:24



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at lun oct 28 00:14:14 CET 2019