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
00029 #ifndef opengl_CPointCloud_H
00030 #define opengl_CPointCloud_H
00031
00032 #include <mrpt/opengl/CRenderizable.h>
00033 #include <mrpt/utils/CMRPTImage.h>
00034
00035 namespace mrpt
00036 {
00037 namespace slam { class CPointsMap; }
00038
00039 namespace opengl
00040 {
00041 class MRPTDLLIMPEXP CPointCloud;
00042
00043
00044 DEFINE_SERIALIZABLE_PRE_CUSTOM_BASE( CPointCloud, CRenderizable )
00045
00046
00047
00050 class MRPTDLLIMPEXP CPointCloud : public CRenderizable
00051 {
00052 DEFINE_SERIALIZABLE( CPointCloud )
00053 public:
00054 bool m_colorFromZ;
00055 vector_float m_xs,m_ys,m_zs;
00056 float m_pointSize;
00057
00058
00060 void clear();
00061
00063 void insertPoint( float x,float y, float z );
00064
00066 static CPointCloudPtr Create()
00067 {
00068 return CPointCloudPtr( new CPointCloud() );
00069 }
00070
00073 void loadFromPointsMap( const mrpt::slam::CPointsMap *map);
00074
00077 void render();
00078
00079 private:
00082 CPointCloud( ) :
00083 m_colorFromZ(false),
00084 m_xs(),m_ys(),m_zs(),
00085 m_pointSize(1),
00086 m_z_min(0),
00087 m_z_max(0),
00088 m_z_minmax_valid(false)
00089 {
00090 }
00092 virtual ~CPointCloud() { }
00093
00094 float m_z_min, m_z_max;
00095 bool m_z_minmax_valid;
00096 };
00097
00098 }
00099
00100 }
00101
00102
00103 #endif