00001 00005 #include <iostream> 00006 00007 #include <utils/ConfigFile.h> 00008 #include <utils/Player.h> 00009 #include <TimeSource/TimeSource.h> 00010 00011 #include "VehPoseSource.h" 00012 #include "VehPosePlayer.h" 00013 00016 class PlayerVehPoseSource : public VehPoseSource { 00017 public: 00019 virtual bool getCurPose(utils::Time& time, 00020 VehPose& pose, bool blocking = true); 00021 00023 virtual bool getPose(utils::Time time, VehPose& pose); 00024 00026 bool init(utils::ConfigFile& params, utils::SymbolTable* globals); 00027 00028 private: 00029 VehPosePlayer _player; 00030 }; 00031 00033 UTILS_INTF_CREATOR(VehPoseSource, player, gen, params, globals) 00034 { 00035 UTILS_INTF_REPORT(VehPoseSource, player); 00036 PlayerVehPoseSource* intf = new PlayerVehPoseSource(); 00037 if (!intf->init(*params, globals)) { 00038 delete intf; 00039 return NULL; 00040 } 00041 return intf; 00042 } 00043 00044 bool PlayerVehPoseSource::init(utils::ConfigFile& params, 00045 utils::SymbolTable* globals) 00046 { 00047 return _player.open(params, globals); 00048 } 00049 00050 bool PlayerVehPoseSource::getCurPose(utils::Time& time, VehPose& pose, 00051 bool blocking) 00052 { 00053 return _player.nextPose(time, pose, blocking); 00054 } 00055 00056 bool PlayerVehPoseSource::getPose(utils::Time time, VehPose& pose) 00057 { 00058 return _player.getPose(time, pose); 00059 } 00060 00061