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
00029 #ifndef opengl_CPlanarLaserScan_H
00030 #define opengl_CPlanarLaserScan_H
00031
00032 #include <mrpt/opengl/CRenderizableDisplayList.h>
00033
00034 #include <mrpt/slam/CMetricMap.h>
00035 #include <mrpt/slam/CObservation.h>
00036 #include <mrpt/slam/CObservation2DRangeScan.h>
00037 #include <mrpt/slam/CSimplePointsMap.h>
00038
00039
00040 namespace mrpt
00041 {
00042
00043 namespace opengl
00044 {
00045 class CPlanarLaserScan;
00046
00047
00048 DEFINE_SERIALIZABLE_PRE_CUSTOM_BASE_LINKAGE( CPlanarLaserScan, CRenderizableDisplayList, MAPS_IMPEXP )
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063 class MAPS_IMPEXP CPlanarLaserScan : public CRenderizableDisplayList
00064 {
00065 DEFINE_SERIALIZABLE( CPlanarLaserScan )
00066 protected:
00067 mrpt::slam::CObservation2DRangeScan m_scan;
00068 mutable mrpt::slam::CSimplePointsMap m_cache_points;
00069 mutable bool m_cache_valid;
00070
00071
00072 float m_line_width;
00073 float m_line_R,m_line_G,m_line_B,m_line_A;
00074
00075 float m_points_width;
00076 float m_points_R,m_points_G,m_points_B,m_points_A;
00077
00078 float m_plane_R,m_plane_G,m_plane_B,m_plane_A;
00079
00080 public:
00081 void clear();
00082
00083 bool m_enable_points;
00084 bool m_enable_line;
00085 bool m_enable_surface;
00086
00087 void setLineWidth(float w) { m_line_width=w; }
00088 float getLineWidth() const { return m_line_width;}
00089
00090 void sePointsWidth(float w) { m_points_width=w; }
00091
00092 void setLineColor(float R,float G, float B, float A=1.0f)
00093 {
00094 m_line_R=R;
00095 m_line_G=G;
00096 m_line_B=B;
00097 m_line_A=A;
00098 }
00099 void setPointsColor(float R,float G, float B, float A=1.0f)
00100 {
00101 m_points_R=R;
00102 m_points_G=G;
00103 m_points_B=B;
00104 m_points_A=A;
00105 }
00106 void setSurfaceColor(float R,float G, float B, float A=1.0f)
00107 {
00108 m_plane_R=R;
00109 m_plane_G=G;
00110 m_plane_B=B;
00111 m_plane_A=A;
00112 }
00113
00114 void setScan( const mrpt::slam::CObservation2DRangeScan &scan)
00115 {
00116 CRenderizableDisplayList::notifyChange();
00117 m_cache_valid = false;
00118 m_scan = scan;
00119 }
00120
00121
00122
00123 void render_dl() const;
00124
00125 private:
00126
00127
00128 CPlanarLaserScan( );
00129
00130
00131 virtual ~CPlanarLaserScan() { }
00132 };
00133
00134 }
00135
00136 }
00137
00138
00139 #endif