MRPT  2.0.4
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-2020, 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 
27  public:
29  float x0, float y0, float z0, float x1, float y1, float z1)
30  {
31  m_x0 = x0;
32  m_y0 = y0;
33  m_z0 = z0;
34  m_x1 = x1;
35  m_y1 = y1;
36  m_z1 = z1;
38  }
39 
41  float& x0, float& y0, float& z0, float& x1, float& y1, float& z1) const
42  {
43  x0 = m_x0;
44  y0 = m_y0;
45  z0 = m_z0;
46  x1 = m_x1;
47  y1 = m_y1;
48  z1 = m_z1;
49  }
50 
51  void onUpdateBuffers_Wireframe() override;
52 
53  void getBoundingBox(
55  mrpt::math::TPoint3D& bb_max) const override;
56 
57  /** Constructor
58  */
60  float x0 = 0, float y0 = 0, float z0 = 0, float x1 = 0, float y1 = 0,
61  float z1 = 0, float lineWidth = 1, bool antiAliasing = true);
62 
63  /** Private, virtual destructor: only can be deleted from smart pointers */
64  ~CSimpleLine() override = default;
65 };
66 
67 } // namespace mrpt::opengl
void notifyChange() const
Call to enable calling renderUpdateBuffers() before the next render() rendering iteration.
void onUpdateBuffers_Wireframe() override
Must be implemented in derived classes to update the geometric entities to be drawn in "m_*_buffer" f...
Definition: CSimpleLine.cpp:32
void getLineCoords(float &x0, float &y0, float &z0, float &x1, float &y1, float &z1) const
Definition: CSimpleLine.h:40
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:75
A line segment.
Definition: CSimpleLine.h:19
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:23
Renderizable generic renderer for objects using the wireframe shader.
The namespace for 3D scene representation and rendering.
Definition: CGlCanvasBase.h:13
const auto bb_max
~CSimpleLine() override=default
Private, virtual destructor: only can be deleted from smart pointers.
#define DEFINE_SERIALIZABLE(class_name, NS)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
const auto bb_min
void setLineCoords(float x0, float y0, float z0, float x1, float y1, float z1)
Definition: CSimpleLine.h:28



Page generated by Doxygen 1.8.14 for MRPT 2.0.4 Git: 33de1d0ad Sat Jun 20 11:02:42 2020 +0200 at sáb jun 20 17:35:17 CEST 2020