MRPT  1.9.9
CDisk.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_CDisk_H
10 #define opengl_CDisk_H
11 
13 #include <mrpt/poses/CPose3D.h>
14 #include <mrpt/math/geometry.h>
15 
16 namespace mrpt::opengl
17 {
18 /** A planar disk in the XY plane.
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::CDisk </td> <td> \image html preview_CDisk.png
25  * </td> </tr>
26  * </table>
27  * </div>
28  *
29  * \ingroup mrpt_opengl_grp
30  */
32 {
34 
35  protected:
38 
39  public:
40  void setDiskRadius(float outRadius, float inRadius = 0)
41  {
42  m_radiusIn = inRadius;
43  m_radiusOut = outRadius;
45  }
46 
47  float getInRadius() const { return m_radiusIn; }
48  float getOutRadius() const { return m_radiusOut; }
49  /** Default=50 */
51  {
52  m_nSlices = N;
54  }
55  /** Default=4 */
57  {
58  m_nLoops = N;
60  }
61 
62  /** Render
63  */
64  void render_dl() const override;
65 
66  /** Evaluates the bounding box of this object (including possible children)
67  * in the coordinate frame of the object parent. */
68  void getBoundingBox(
69  mrpt::math::TPoint3D& bb_min,
70  mrpt::math::TPoint3D& bb_max) const override;
71 
72  /** Ray tracing
73  */
74  bool traceRay(const mrpt::poses::CPose3D& o, double& dist) const override;
75 
76  /** Constructor
77  */
79  CDisk(float rOut, float rIn, uint32_t slices = 50, uint32_t loops = 4)
80  : m_radiusIn(rIn), m_radiusOut(rOut), m_nSlices(slices), m_nLoops(loops)
81  {
82  }
83 
84  /** Private, virtual destructor: only can be deleted from smart pointers */
85  virtual ~CDisk() {}
86 };
87 
88 }
89 #endif
90 
91 
virtual ~CDisk()
Private, virtual destructor: only can be deleted from smart pointers.
Definition: CDisk.h:85
void setDiskRadius(float outRadius, float inRadius=0)
Definition: CDisk.h:40
CDisk(float rOut, float rIn, uint32_t slices=50, uint32_t loops=4)
Definition: CDisk.h:79
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: CDisk.cpp:107
EIGEN_STRONG_INLINE void notifyChange() const
Must be called to notify that the object has changed (so, the display list must be updated) ...
void render_dl() const override
Render.
Definition: CDisk.cpp:28
A renderizable object suitable for rendering with OpenGL&#39;s display lists.
void setSlicesCount(uint32_t N)
Default=50.
Definition: CDisk.h:50
A planar disk in the XY plane.
Definition: CDisk.h:31
#define DEFINE_SERIALIZABLE(class_name)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
uint32_t m_nSlices
Definition: CDisk.h:37
float m_radiusOut
Definition: CDisk.h:36
void setLoopsCount(uint32_t N)
Default=4.
Definition: CDisk.h:56
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
Definition: CPose3D.h:86
The namespace for 3D scene representation and rendering.
Definition: CGlCanvasBase.h:15
float getInRadius() const
Definition: CDisk.h:47
Lightweight 3D point.
unsigned __int32 uint32_t
Definition: rptypes.h:47
float getOutRadius() const
Definition: CDisk.h:48
float m_radiusIn
Definition: CDisk.h:36
bool traceRay(const mrpt::poses::CPose3D &o, double &dist) const override
Ray tracing.
Definition: CDisk.cpp:72
uint32_t m_nLoops
Definition: CDisk.h:37
CDisk()
Constructor.
Definition: CDisk.h:78



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