00001
00005 #include <iostream>
00006
00007 #include <utils/ConfigFile.h>
00008 #include <TimeSource/TimeSource.h>
00009
00010 #include "RoadSource.h"
00011 #include "RoadPlayer.h"
00012
00015 class PlayerRoadSource : public RoadSource {
00016 public:
00018 virtual bool getPoints(utils::Time& time,
00019 std::vector<utils::Vec3d>& points,
00020 bool blocking = true);
00021
00023 bool init(utils::ConfigFile& params, utils::SymbolTable* globals);
00024
00025 private:
00026 RoadPlayer _player;
00027 };
00028
00030 UTILS_INTF_CREATOR(RoadSource, player, gen, params, globals)
00031 {
00032 UTILS_INTF_REPORT(RoadSource, player);
00033 PlayerRoadSource* intf = new PlayerRoadSource();
00034 if (!intf->init(*params, globals)) {
00035 delete intf;
00036 return NULL;
00037 }
00038 return intf;
00039 }
00040
00041 bool PlayerRoadSource::init(utils::ConfigFile& params,
00042 utils::SymbolTable* globals)
00043 {
00044 return _player.open(params, globals);
00045 }
00046
00047 bool PlayerRoadSource::getPoints(utils::Time& time,
00048 std::vector<utils::Vec3d>& points,
00049 bool blocking)
00050 {
00051 return _player.nextPoints(time, points, blocking);
00052 }
00053