Main MRPT website > C++ reference for MRPT 1.9.9
CArrow.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_CArrow_H
10 #define opengl_CArrow_H
11 
13 
14 namespace mrpt
15 {
16 namespace opengl
17 {
18 /** A 3D arrow
19  * \sa opengl::COpenGLScene
20  *
21  * <div align="center">
22  * <table border="0" cellspan="4" cellspacing="4" style="border-width: 1px;
23  * border-style: solid;">
24  * <tr> <td> mrpt::opengl::CArrow </td> <td> \image html preview_CArrow.png
25  * </td> </tr>
26  * </table>
27  * </div>
28  * \ingroup mrpt_opengl_grp
29  *
30  */
32 {
34  protected:
35  mutable float m_x0, m_y0, m_z0;
36  mutable float m_x1, m_y1, m_z1;
37  float m_headRatio;
39  // For version 2 in stream
40  float m_arrow_roll;
42  float m_arrow_yaw;
43 
44  public:
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  void setHeadRatio(float rat)
57  {
58  m_headRatio = rat;
60  }
61  void setSmallRadius(float rat)
62  {
63  m_smallRadius = rat;
65  }
66  void setLargeRadius(float rat)
67  {
68  m_largeRadius = rat;
70  }
71  void setArrowYawPitchRoll(float yaw, float pitch, float roll)
72  {
73  m_arrow_yaw = yaw;
77  }
78 
79  /** Render
80  */
81  void render_dl() const override;
82 
83  /** Evaluates the bounding box of this object (including possible children)
84  * in the coordinate frame of the object parent. */
85  void getBoundingBox(
86  mrpt::math::TPoint3D& bb_min,
87  mrpt::math::TPoint3D& bb_max) const override;
88 
89  /** Class factory */
90  static CArrow::Ptr Create(
91  float x0, float y0, float z0, float x1, float y1, float z1,
92  float headRatio = 0.2f, float smallRadius = 0.05f,
93  float largeRadius = 0.2f, float arrow_roll = -1.0f,
94  float arrow_pitch = -1.0f, float arrow_yaw = -1.0f);
95 
96  /** Constructor
97  */
99  float x0 = 0, float y0 = 0, float z0 = 0, float x1 = 1, float y1 = 1,
100  float z1 = 1, float headRatio = 0.2f, float smallRadius = 0.05f,
101  float largeRadius = 0.2f, float arrow_roll = -1.0f,
102  float arrow_pitch = -1.0f, float arrow_yaw = -1.0f)
103  : m_x0(x0),
104  m_y0(y0),
105  m_z0(z0),
106  m_x1(x1),
107  m_y1(y1),
108  m_z1(z1),
109  m_headRatio(headRatio),
110  m_smallRadius(smallRadius),
111  m_largeRadius(largeRadius),
112  m_arrow_roll(arrow_roll),
113  m_arrow_pitch(arrow_pitch),
114  m_arrow_yaw(arrow_yaw)
115  {
116  }
117 
118  /** Private, virtual destructor: only can be deleted from smart pointers */
119  virtual ~CArrow() {}
120 };
121 
122 } // end namespace
123 } // End of namespace
124 
125 #endif
mrpt::opengl::CArrow::m_y0
float m_y0
Definition: CArrow.h:35
mrpt::opengl::CArrow::~CArrow
virtual ~CArrow()
Private, virtual destructor: only can be deleted from smart pointers.
Definition: CArrow.h:119
mrpt::opengl::CArrow::m_arrow_roll
float m_arrow_roll
Definition: CArrow.h:40
mrpt::opengl::CArrow::m_x0
float m_x0
Definition: CArrow.h:35
CRenderizableDisplayList.h
mrpt::opengl::CArrow::Ptr
std::shared_ptr< CArrow > Ptr
Definition: CArrow.h:33
mrpt::opengl::CArrow::setHeadRatio
void setHeadRatio(float rat)
Definition: CArrow.h:56
mrpt::opengl::CRenderizableDisplayList
A renderizable object suitable for rendering with OpenGL's display lists.
Definition: CRenderizableDisplayList.h:39
mrpt::opengl::CArrow::CArrow
CArrow(float x0=0, float y0=0, float z0=0, float x1=1, float y1=1, float z1=1, float headRatio=0.2f, float smallRadius=0.05f, float largeRadius=0.2f, float arrow_roll=-1.0f, float arrow_pitch=-1.0f, float arrow_yaw=-1.0f)
Constructor.
Definition: CArrow.h:98
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::obs::gnss::roll
double roll
Definition: gnss_messages_novatel.h:264
mrpt::opengl::CArrow::setSmallRadius
void setSmallRadius(float rat)
Definition: CArrow.h:61
mrpt::opengl::CArrow::m_largeRadius
float m_largeRadius
Definition: CArrow.h:38
mrpt
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
Definition: CKalmanFilterCapable.h:30
mrpt::opengl::CArrow::m_arrow_pitch
float m_arrow_pitch
Definition: CArrow.h:41
mrpt::opengl::CArrow
A 3D arrow.
Definition: CArrow.h:31
mrpt::opengl::CArrow::m_z1
float m_z1
Definition: CArrow.h:36
mrpt::opengl::CArrow::setLargeRadius
void setLargeRadius(float rat)
Definition: CArrow.h:66
mrpt::opengl::CArrow::render_dl
void render_dl() const override
Render.
Definition: CArrow.cpp:41
mrpt::opengl::CArrow::m_smallRadius
float m_smallRadius
Definition: CArrow.h:38
mrpt::opengl::CArrow::m_arrow_yaw
float m_arrow_yaw
Definition: CArrow.h:42
mrpt::opengl::CArrow::m_headRatio
float m_headRatio
Definition: CArrow.h:37
mrpt::obs::gnss::pitch
double pitch
Definition: gnss_messages_novatel.h:264
mrpt::opengl::CArrow::setArrowYawPitchRoll
void setArrowYawPitchRoll(float yaw, float pitch, float roll)
Definition: CArrow.h:71
mrpt::math::TPoint3D
Lightweight 3D point.
Definition: lightweight_geom_data.h:378
mrpt::opengl::CArrow::m_y1
float m_y1
Definition: CArrow.h:36
mrpt::opengl::CArrow::Create
static Ptr Create(Args &&... args)
Definition: CArrow.h:33
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::CArrow::setArrowEnds
void setArrowEnds(float x0, float y0, float z0, float x1, float y1, float z1)
Definition: CArrow.h:45
mrpt::opengl::CArrow::m_z0
float m_z0
Definition: CArrow.h:35
mrpt::opengl::CArrow::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: CArrow.cpp:212
mrpt::opengl::CArrow::m_x1
float m_x1
Definition: CArrow.h:36



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