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
mrpt::opengl::CSimpleLine::~CSimpleLine
virtual ~CSimpleLine()
Private, virtual destructor: only can be deleted from smart pointers.
Definition: CSimpleLine.h:90
mrpt::opengl::CSimpleLine::render_dl
void render_dl() const override
Render.
Definition: CSimpleLine.cpp:47
mrpt::opengl::CSimpleLine::m_z0
float m_z0
Definition: CSimpleLine.h:27
mrpt::opengl::CSimpleLine::isAntiAliasingEnabled
bool isAntiAliasingEnabled() const
Definition: CSimpleLine.h:44
CRenderizableDisplayList.h
mrpt::opengl::CSimpleLine::Ptr
std::shared_ptr< CSimpleLine > Ptr
Definition: CSimpleLine.h:24
mrpt::opengl::CSimpleLine::m_x0
float m_x0
Definition: CSimpleLine.h:27
mrpt::opengl::CSimpleLine::getLineCoords
void getLineCoords(float &x0, float &y0, float &z0, float &x1, float &y1, float &z1) const
Definition: CSimpleLine.h:57
mrpt::opengl::CRenderizableDisplayList
A renderizable object suitable for rendering with OpenGL's display lists.
Definition: CRenderizableDisplayList.h:39
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::CSimpleLine::m_lineWidth
float m_lineWidth
Definition: CSimpleLine.h:29
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
mrpt::opengl::CSimpleLine::m_antiAliasing
bool m_antiAliasing
Definition: CSimpleLine.h:30
mrpt::opengl::CSimpleLine
A line segment.
Definition: CSimpleLine.h:22
mrpt::opengl::CSimpleLine::m_x1
float m_x1
Definition: CSimpleLine.h:28
mrpt::opengl::CSimpleLine::m_z1
float m_z1
Definition: CSimpleLine.h:28
mrpt::opengl::CSimpleLine::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: CSimpleLine.cpp:111
mrpt::math::TPoint3D
Lightweight 3D point.
Definition: lightweight_geom_data.h:378
mrpt::opengl::CSimpleLine::getLineWidth
float getLineWidth() const
Definition: CSimpleLine.h:38
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::CSimpleLine::CSimpleLine
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
mrpt::opengl::CSimpleLine::setLineWidth
void setLineWidth(float w)
Definition: CSimpleLine.h:33
mrpt::opengl::CSimpleLine::m_y0
float m_y0
Definition: CSimpleLine.h:27
mrpt::opengl::CSimpleLine::setLineCoords
void setLineCoords(float x0, float y0, float z0, float x1, float y1, float z1)
Definition: CSimpleLine.h:45
mrpt::opengl::CSimpleLine::Create
static Ptr Create(Args &&... args)
Definition: CSimpleLine.h:24
mrpt::opengl::CSimpleLine::enableAntiAliasing
void enableAntiAliasing(bool enable=true)
Definition: CSimpleLine.h:39
mrpt::opengl::CSimpleLine::m_y1
float m_y1
Definition: CSimpleLine.h:28



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