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-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
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
mrpt::opengl::CDisk::m_nLoops
uint32_t m_nLoops
Definition: CDisk.h:39
mrpt::opengl::CDisk::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: CDisk.cpp:107
geometry.h
mrpt::opengl::CDisk::setDiskRadius
void setDiskRadius(float outRadius, float inRadius=0)
Definition: CDisk.h:42
CRenderizableDisplayList.h
mrpt::opengl::CDisk::m_nSlices
uint32_t m_nSlices
Definition: CDisk.h:39
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
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
Definition: CKalmanFilterCapable.h:30
mrpt::opengl::CDisk::m_radiusIn
float m_radiusIn
Definition: CDisk.h:38
mrpt::opengl::CDisk::setSlicesCount
void setSlicesCount(uint32_t N)
Default=50.
Definition: CDisk.h:52
mrpt::opengl::CDisk::m_radiusOut
float m_radiusOut
Definition: CDisk.h:38
mrpt::poses::CPose3D
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
Definition: CPose3D.h:88
mrpt::opengl::CDisk
A planar disk in the XY plane.
Definition: CDisk.h:33
mrpt::opengl::CDisk::CDisk
CDisk(float rOut, float rIn, uint32_t slices=50, uint32_t loops=4)
Definition: CDisk.h:81
mrpt::opengl::CDisk::~CDisk
virtual ~CDisk()
Private, virtual destructor: only can be deleted from smart pointers.
Definition: CDisk.h:87
mrpt::opengl::CDisk::traceRay
bool traceRay(const mrpt::poses::CPose3D &o, double &dist) const override
Ray tracing.
Definition: CDisk.cpp:72
mrpt::math::TPoint3D
Lightweight 3D point.
Definition: lightweight_geom_data.h:378
CPose3D.h
mrpt::opengl::CDisk::getInRadius
float getInRadius() const
Definition: CDisk.h:49
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::CDisk::setLoopsCount
void setLoopsCount(uint32_t N)
Default=4.
Definition: CDisk.h:58
mrpt::opengl::CDisk::render_dl
void render_dl() const override
Render.
Definition: CDisk.cpp:28
mrpt::opengl::CDisk::getOutRadius
float getOutRadius() const
Definition: CDisk.h:50
mrpt::opengl::CDisk::CDisk
CDisk()
Constructor.
Definition: CDisk.h:80
uint32_t
unsigned __int32 uint32_t
Definition: rptypes.h:47



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