MRPT  1.9.9
CSimpleLine.h
Go to the documentation of this file.
1 /* +------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | https://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2019, Individual contributors, see AUTHORS file |
6  | See: https://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See: https://www.mrpt.org/License |
8  +------------------------------------------------------------------------+ */
9 #pragma once
10 
12 
13 namespace mrpt::opengl
14 {
15 /** A line segment
16  * \sa opengl::COpenGLScene
17  * \ingroup mrpt_opengl_grp
18  */
20 {
22 
23  protected:
24  float m_x0, m_y0, m_z0;
25  float m_x1, m_y1, m_z1;
26  float m_lineWidth;
28 
29  public:
30  void setLineWidth(float w)
31  {
32  m_lineWidth = w;
34  }
35  float getLineWidth() const { return m_lineWidth; }
36  void enableAntiAliasing(bool enable = true)
37  {
38  m_antiAliasing = enable;
40  }
41  bool isAntiAliasingEnabled() const { return m_antiAliasing; }
43  float x0, float y0, float z0, float x1, float y1, float z1)
44  {
45  m_x0 = x0;
46  m_y0 = y0;
47  m_z0 = z0;
48  m_x1 = x1;
49  m_y1 = y1;
50  m_z1 = z1;
52  }
53 
55  float& x0, float& y0, float& z0, float& x1, float& y1, float& z1) const
56  {
57  x0 = m_x0;
58  y0 = m_y0;
59  z0 = m_z0;
60  x1 = m_x1;
61  y1 = m_y1;
62  z1 = m_z1;
63  }
64 
65  /** Render
66  */
67  void render_dl() const override;
68 
69  /** Evaluates the bounding box of this object (including possible children)
70  * in the coordinate frame of the object parent. */
71  void getBoundingBox(
73  mrpt::math::TPoint3D& bb_max) const override;
74 
75  /** Constructor
76  */
78  float x0 = 0, float y0 = 0, float z0 = 0, float x1 = 0, float y1 = 0,
79  float z1 = 0, float lineWidth = 1, bool antiAliasing = true);
80 
81  /** Private, virtual destructor: only can be deleted from smart pointers */
82  ~CSimpleLine() override = default;
83 };
84 
85 } // namespace mrpt::opengl
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:4199
A renderizable object suitable for rendering with OpenGL's display lists.
float getLineWidth() const
Definition: CSimpleLine.h:35
void getLineCoords(float &x0, float &y0, float &z0, float &x1, float &y1, float &z1) const
Definition: CSimpleLine.h:54
void render_dl() const override
Render.
Definition: CSimpleLine.cpp:41
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:41
#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:19
void enableAntiAliasing(bool enable=true)
Definition: CSimpleLine.h:36
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:24
The namespace for 3D scene representation and rendering.
Definition: CGlCanvasBase.h:15
const auto bb_max
~CSimpleLine() override=default
Private, virtual destructor: only can be deleted from smart pointers.
const auto bb_min
Lightweight 3D point.
Definition: TPoint3D.h:90
void setLineWidth(float w)
Definition: CSimpleLine.h:30
void setLineCoords(float x0, float y0, float z0, float x1, float y1, float z1)
Definition: CSimpleLine.h:42



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: 8fe78517f Sun Jul 14 19:43:28 2019 +0200 at lun oct 28 02:10:00 CET 2019