Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef opengl_CDisk_H
00029 #define opengl_CDisk_H
00030
00031 #include <mrpt/opengl/CRenderizableDisplayList.h>
00032 #include <mrpt/poses/CPose3D.h>
00033 #include <mrpt/math/geometry.h>
00034
00035 namespace mrpt
00036 {
00037 namespace opengl
00038 {
00039 class OPENGL_IMPEXP CDisk;
00040
00041
00042 DEFINE_SERIALIZABLE_PRE_CUSTOM_BASE_LINKAGE( CDisk, CRenderizableDisplayList, OPENGL_IMPEXP )
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054 class OPENGL_IMPEXP CDisk : public CRenderizableDisplayList
00055 {
00056 DEFINE_SERIALIZABLE( CDisk )
00057
00058 protected:
00059 float m_radiusIn,m_radiusOut;
00060 uint32_t m_nSlices, m_nLoops;
00061
00062 public:
00063 void setDiskRadius(float outRadius, float inRadius=0) { m_radiusIn=inRadius; m_radiusOut=outRadius; CRenderizableDisplayList::notifyChange(); }
00064
00065 float getInRadius() const { return m_radiusIn; }
00066 float getOutRadius() const { return m_radiusOut; }
00067
00068 void setSlicesCount(uint32_t N) { m_nSlices=N; CRenderizableDisplayList::notifyChange(); }
00069 void setLoopsCount(uint32_t N) { m_nLoops=N; CRenderizableDisplayList::notifyChange(); }
00070
00071
00072
00073
00074 void render_dl() const;
00075
00076
00077
00078 virtual bool traceRay(const mrpt::poses::CPose3D &o,double &dist) const;
00079
00080 static CDiskPtr Create(float radiusOut,float radiusIn,uint32_t slices=50,uint32_t loops=4) {
00081 return CDiskPtr(new CDisk(radiusOut,radiusIn,slices,loops));
00082 }
00083
00084 private:
00085
00086
00087 CDisk():m_radiusIn(0),m_radiusOut(1),m_nSlices(50),m_nLoops(4) {}
00088
00089 CDisk(float rOut,float rIn,uint32_t slices,uint32_t loops):m_radiusIn(rIn),m_radiusOut(rOut),m_nSlices(slices),m_nLoops(loops) {}
00090
00091
00092 virtual ~CDisk() { }
00093 };
00094
00095 }
00096
00097 }
00098
00099
00100 #endif