00001 #include "SIGEL_Visualisation/SIG_RenderRecorder.h" 00002 00003 namespace SIGEL_Visualisation 00004 { 00005 00006 SIG_RenderRecorder::SIG_RenderRecorder(int noOfObjects) 00007 : SIGEL_Simulation::SIG_Recorder(), 00008 robotLinks(noOfObjects), 00009 simulationTime() 00010 { 00011 robotLinks.setAutoDelete(true); 00012 00013 for (int i=0; i<noOfObjects; i++) 00014 robotLinks.insert(i, new SIG_SceneObject(i)); 00015 }; 00016 00017 void SIG_RenderRecorder::init() 00018 throw (SIGEL_Simulation::SIG_RecorderNoQueriesSetException, 00019 SIGEL_Simulation::SIG_RecorderBadRecordingOrderException) 00020 { 00021 SIGEL_Simulation::SIG_Recorder::init(); 00022 record(); 00023 }; 00024 00025 void SIG_RenderRecorder::record() 00026 throw (SIGEL_Simulation::SIG_RecorderNoQueriesSetException, 00027 SIGEL_Simulation::SIG_RecorderBadRecordingOrderException) 00028 { 00029 SIGEL_Simulation::SIG_Recorder::record(); 00030 00031 for (int i=0; i<robotLinks.size(); i++) 00032 { 00033 robotLinks[i]->position = simulationQueries->getLinkPosition(i); 00034 robotLinks[i]->rotation = simulationQueries->getLinkOrientation(i); 00035 }; 00036 00037 simulationTime = simulationQueries->getActualSimulationTime(); 00038 }; 00039 00040 void SIG_RenderRecorder::finish() 00041 throw (SIGEL_Simulation::SIG_RecorderNoQueriesSetException, 00042 SIGEL_Simulation::SIG_RecorderBadRecordingOrderException) 00043 { 00044 SIGEL_Simulation::SIG_Recorder::finish(); 00045 }; 00046 00047 }