00001
00002
00003
00004 #ifndef CAJUN_LANE_FILE_LOADER_H
00005 #define CAJUN_LANE_FILE_LOADER_H
00006
00007 #include "rndf.H"
00008 #include "data_type.H"
00009
00010 #include <fstream>
00011 #include <string>
00012 #include <vector>
00013
00014 namespace cajun
00015 {
00016 class lane_file_loader_t
00017 {
00018 rndf_t const *m_rndf;
00019 std::string m_lane_data_dir;
00020 double m_interp_dis;
00021 public:
00022 lane_file_loader_t (rndf_t const *rndf_,
00023 std::string lane_data_dir_,
00024 double interp_dis_):
00025 m_rndf (rndf_), m_lane_data_dir (lane_data_dir_),
00026 m_interp_dis (interp_dis_) { }
00027 bool load_boundary_files (
00028 std::vector<rndf_lane_data_t> &lane_list_);
00029 private:
00032 void sample_lane_data (std::ifstream &infile_,
00033 rndf_t::lane_t &lane_,
00034 rndf_t::waypoint_id_t const &start_id,
00035 rndf_t::waypoint_id_t const &end_id,
00036 rndf_lane_data_t &lane_data_);
00040 bool seg_from_wp_pair (rndf_t::waypoint_id_t start_id,
00041 rndf_t::waypoint_id_t end_id,
00042 rndf_t::lane_t &lane,
00043 rndf_lane_data_t &lane_data_);
00044
00047 void seg_from_wp (std::vector<rndf_lane_data_t> &lane_list_,
00048 rndf_t::waypoint_id_t wp_id);
00049 };
00050 };
00051
00052 #endif