00001
00002
00003
00004 #ifndef CAJUN_DRAW_SURVEY_GP_H
00005 #define CAJUN_DRAW_SURVEY_GP_H
00006
00007 #include "data_queue.H"
00008 #include "laser_data.H"
00009 #include "component_interface.H"
00010
00011 #include "GL/glx.h"
00012
00013 #ifdef VR_JUGGLER
00014 #include <vrj/Draw/OGL/GlContextData.h>
00015 #endif
00016
00017 namespace cajun
00018 {
00019 class draw_survey_gp_t : public component_interface_t
00020 {
00021 public:
00022 draw_survey_gp_t (double cbviz_origin[3], int survey_gp_id,
00023 conf_t &conf, world_state_t *ws_);
00024 virtual ~draw_survey_gp_t ();
00025 void dynamic_data ();
00026 void intra_update_data ();
00027 void update_data (double bot_pos_[3]);
00028 void display (double bot_pos[3]);
00029 void toggle_display ();
00030 void flush_buffer ();
00031 void init_data ();
00032 void translate_pts (survey_gp_data_t &survey_gp_);
00033 private:
00034 struct point_t
00035 {
00036 point_t () {;}
00037 point_t (float pt_x_, float pt_y_, float pt_z_)
00038 : x (pt_x_), y (pt_y_), z (pt_z_)
00039 {}
00040 point_t (double pt_x_, double pt_y_, double pt_z_)
00041 : x (pt_x_), y (pt_y_), z (pt_z_)
00042 {}
00043 float x, y, z;
00044 unsigned char r, g, b, a;
00045 };
00046
00047 access_data_t *m_ad;
00048
00049 bool m_vbo_support;
00050 unsigned m_num_surveys;
00051 point_t *m_vertex_data;
00052
00053 double m_prev_survey_tstamp;
00054 std::vector<survey_gp_data_t> m_survey_gp_list;
00055
00056 unsigned m_qid;
00057 size_t m_counter;
00058 size_t m_buffer_size;
00059 size_t m_prev_data_point;
00060
00061 #ifdef VR_JUGGLER
00062 vrj::GlContextData<GLuint> m_vbo_vert_name;
00063 #else
00064 unsigned m_vbo_vert_name;
00065 #endif
00066
00067 survey_gp_data_t::coord_t start_beam, end_beam;
00068
00069 PFNGLGENBUFFERSARBPROC glGenBuffersARB;
00070 PFNGLBINDBUFFERARBPROC glBindBufferARB;
00071 PFNGLBUFFERDATAARBPROC glBufferDataARB;
00072 PFNGLBUFFERSUBDATAARBPROC glBufferSubDataARB;
00073 PFNGLDELETEBUFFERSARBPROC glDeleteBuffersARB;
00074 };
00075 }
00076 #endif