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::opengl
15 {
16 /** A line segment
17  * \sa opengl::COpenGLScene
18  * \ingroup mrpt_opengl_grp
19  */
21 {
23 
24  protected:
25  float m_x0, m_y0, m_z0;
26  float m_x1, m_y1, m_z1;
27  float m_lineWidth;
29 
30  public:
31  void setLineWidth(float w)
32  {
33  m_lineWidth = w;
35  }
36  float getLineWidth() const { return m_lineWidth; }
37  void enableAntiAliasing(bool enable = true)
38  {
39  m_antiAliasing = enable;
41  }
42  bool isAntiAliasingEnabled() const { return m_antiAliasing; }
44  float x0, float y0, float z0, float x1, float y1, float z1)
45  {
46  m_x0 = x0;
47  m_y0 = y0;
48  m_z0 = z0;
49  m_x1 = x1;
50  m_y1 = y1;
51  m_z1 = z1;
53  }
54 
56  float& x0, float& y0, float& z0, float& x1, float& y1, float& z1) const
57  {
58  x0 = m_x0;
59  y0 = m_y0;
60  z0 = m_z0;
61  x1 = m_x1;
62  y1 = m_y1;
63  z1 = m_z1;
64  }
65 
66  /** Render
67  */
68  void render_dl() const override;
69 
70  /** Class factory */
71  static CSimpleLine::Ptr Create(
72  float x0, float y0, float z0, float x1, float y1, float z1,
73  float lineWidth = 1);
74 
75  /** Evaluates the bounding box of this object (including possible children)
76  * in the coordinate frame of the object parent. */
77  void getBoundingBox(
78  mrpt::math::TPoint3D& bb_min,
79  mrpt::math::TPoint3D& bb_max) const override;
80 
81  /** Constructor
82  */
84  float x0 = 0, float y0 = 0, float z0 = 0, float x1 = 0, float y1 = 0,
85  float z1 = 0, float lineWidth = 1, bool antiAliasing = true);
86 
87  /** Private, virtual destructor: only can be deleted from smart pointers */
88  virtual ~CSimpleLine() {}
89 };
90 
91 }
92 #endif
93 
94 
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:36
void getLineCoords(float &x0, float &y0, float &z0, float &x1, float &y1, float &z1) const
Definition: CSimpleLine.h:55
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:88
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:42
#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:20
void enableAntiAliasing(bool enable=true)
Definition: CSimpleLine.h:37
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
The namespace for 3D scene representation and rendering.
Definition: CGlCanvasBase.h:15
Lightweight 3D point.
void setLineWidth(float w)
Definition: CSimpleLine.h:31
void setLineCoords(float x0, float y0, float z0, float x1, float y1, float z1)
Definition: CSimpleLine.h:43
static Ptr Create(Args &&... args)
Definition: CSimpleLine.h:22



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