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/CRenderizable.h>
00032 #include <mrpt/poses/CPose3D.h>
00033 #include <mrpt/math/geometry.h>
00034
00035 namespace mrpt
00036 {
00037 namespace opengl
00038 {
00039 class MRPTDLLIMPEXP CDisk;
00040
00041
00042 DEFINE_SERIALIZABLE_PRE_CUSTOM_BASE( CDisk, CRenderizable )
00043
00044
00045
00046
00047 class MRPTDLLIMPEXP CDisk : public CRenderizable
00048 {
00049 DEFINE_SERIALIZABLE( CDisk )
00050
00051 protected:
00052 float m_radiusIn,m_radiusOut;
00053 uint32_t m_nSlices, m_nLoops;
00054
00055 public:
00056 void setDiskRadius(float outRadius, float inRadius=0) { m_radiusIn=inRadius; m_radiusOut=outRadius; }
00057
00058 float getInRadius() const { return m_radiusIn; }
00059 float getOutRadius() const { return m_radiusOut; }
00060
00061 void setSlicesCount(uint32_t N) { m_nSlices=N; }
00062 void setLoopsCount(uint32_t N) { m_nLoops=N; }
00063
00064
00065
00066
00067 void render() const;
00068
00069
00070
00071 virtual bool traceRay(const mrpt::poses::CPose3D &o,double &dist) const;
00072
00073 static CDiskPtr Create(float radius,uint32_t slices=50,uint32_t loops=4) {
00074 return CDiskPtr(new CDisk(radius,0,slices,loops));
00075 }
00076 static CDiskPtr Create(float radiusOut,float radiusIn,uint32_t slices=50,uint32_t loops=4) {
00077 return CDiskPtr(new CDisk(radiusOut,radiusIn,slices,loops));
00078 }
00079
00080 private:
00081
00082
00083 CDisk():m_radiusIn(0),m_radiusOut(1),m_nSlices(50),m_nLoops(4) {}
00084
00085 CDisk(float rOut,float rIn,uint32_t slices,uint32_t loops):m_radiusIn(rIn),m_radiusOut(rOut),m_nSlices(slices),m_nLoops(loops) {}
00086
00087
00088 virtual ~CDisk() { }
00089 };
00090
00091 }
00092
00093 }
00094
00095
00096 #endif