Main MRPT website > C++ reference for 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-2017, 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
17 {
18 namespace opengl
19 {
20 /** A planar disk in the XY plane.
21  * \sa opengl::COpenGLScene
22  *
23  * <div align="center">
24  * <table border="0" cellspan="4" cellspacing="4" style="border-width: 1px;
25  * border-style: solid;">
26  * <tr> <td> mrpt::opengl::CDisk </td> <td> \image html preview_CDisk.png
27  * </td> </tr>
28  * </table>
29  * </div>
30  *
31  * \ingroup mrpt_opengl_grp
32  */
34 {
36 
37  protected:
40 
41  public:
42  void setDiskRadius(float outRadius, float inRadius = 0)
43  {
44  m_radiusIn = inRadius;
45  m_radiusOut = outRadius;
47  }
48 
49  float getInRadius() const { return m_radiusIn; }
50  float getOutRadius() const { return m_radiusOut; }
51  /** Default=50 */
53  {
54  m_nSlices = N;
56  }
57  /** Default=4 */
59  {
60  m_nLoops = N;
62  }
63 
64  /** Render
65  */
66  void render_dl() const override;
67 
68  /** Evaluates the bounding box of this object (including possible children)
69  * in the coordinate frame of the object parent. */
70  void getBoundingBox(
71  mrpt::math::TPoint3D& bb_min,
72  mrpt::math::TPoint3D& bb_max) const override;
73 
74  /** Ray tracing
75  */
76  bool traceRay(const mrpt::poses::CPose3D& o, double& dist) const override;
77 
78  /** Constructor
79  */
81  CDisk(float rOut, float rIn, uint32_t slices = 50, uint32_t loops = 4)
82  : m_radiusIn(rIn), m_radiusOut(rOut), m_nSlices(slices), m_nLoops(loops)
83  {
84  }
85 
86  /** Private, virtual destructor: only can be deleted from smart pointers */
87  virtual ~CDisk() {}
88 };
89 
90 } // end namespace
91 
92 } // End of namespace
93 
94 #endif
virtual ~CDisk()
Private, virtual destructor: only can be deleted from smart pointers.
Definition: CDisk.h:87
void setDiskRadius(float outRadius, float inRadius=0)
Definition: CDisk.h:42
CDisk(float rOut, float rIn, uint32_t slices=50, uint32_t loops=4)
Definition: CDisk.h:81
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:119
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:52
A planar disk in the XY plane.
Definition: CDisk.h:33
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
#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:39
float m_radiusOut
Definition: CDisk.h:38
void setLoopsCount(uint32_t N)
Default=4.
Definition: CDisk.h:58
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
Definition: CPose3D.h:88
float getInRadius() const
Definition: CDisk.h:49
Lightweight 3D point.
unsigned __int32 uint32_t
Definition: rptypes.h:47
float getOutRadius() const
Definition: CDisk.h:50
float m_radiusIn
Definition: CDisk.h:38
bool traceRay(const mrpt::poses::CPose3D &o, double &dist) const override
Ray tracing.
Definition: CDisk.cpp:84
uint32_t m_nLoops
Definition: CDisk.h:39
CDisk()
Constructor.
Definition: CDisk.h:80



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: ae4571287 Thu Nov 23 00:06:53 2017 +0100 at dom oct 27 23:51:55 CET 2019