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
00055 class OPENGL_IMPEXP CDisk : public CRenderizableDisplayList
00056 {
00057 DEFINE_SERIALIZABLE( CDisk )
00058
00059 protected:
00060 float m_radiusIn,m_radiusOut;
00061 uint32_t m_nSlices, m_nLoops;
00062
00063 public:
00064 void setDiskRadius(float outRadius, float inRadius=0) { m_radiusIn=inRadius; m_radiusOut=outRadius; CRenderizableDisplayList::notifyChange(); }
00065
00066 float getInRadius() const { return m_radiusIn; }
00067 float getOutRadius() const { return m_radiusOut; }
00068
00069 void setSlicesCount(uint32_t N) { m_nSlices=N; CRenderizableDisplayList::notifyChange(); }
00070 void setLoopsCount(uint32_t N) { m_nLoops=N; CRenderizableDisplayList::notifyChange(); }
00071
00072
00073
00074
00075 void render_dl() const;
00076
00077
00078
00079 virtual bool traceRay(const mrpt::poses::CPose3D &o,double &dist) const;
00080
00081 static CDiskPtr Create(float radiusOut,float radiusIn,uint32_t slices=50,uint32_t loops=4) {
00082 return CDiskPtr(new CDisk(radiusOut,radiusIn,slices,loops));
00083 }
00084
00085 private:
00086
00087
00088 CDisk():m_radiusIn(0),m_radiusOut(1),m_nSlices(50),m_nLoops(4) {}
00089
00090 CDisk(float rOut,float rIn,uint32_t slices,uint32_t loops):m_radiusIn(rIn),m_radiusOut(rOut),m_nSlices(slices),m_nLoops(loops) {}
00091
00092
00093 virtual ~CDisk() { }
00094 };
00095
00096 }
00097
00098 }
00099
00100
00101 #endif