00001
00002
00003
00004
00005
00006
00007
00008
00009 #include "LinesTables2004.h"
00010 #include "Tools/Debugging/Debugging.h"
00011 #include "Tools/Streams/InStreams.h"
00012
00013 Field LinesTables2004::field;
00014 ObservationTable<280,200,25>* LinesTables2004::observationTable = 0;
00015 TemplateTable<50000>* LinesTables2004::templateTable = 0;
00016 int LinesTables2004::refCount = 0;
00017
00018
00019
00020 LinesTables2004::LinesTables2004()
00021 {
00022 if(!refCount++)
00023 {
00024 int i;
00025 observationTable = new ObservationTable<280,200,25>[LinesPercept::numberOfLineTypes + 1];
00026 templateTable = new TemplateTable<50000>[2];
00027
00028 #ifdef SAVE
00029 OutBinaryFile stream("lines04.tab");
00030 for(i = 0; i < LinesPercept::numberOfLineTypes + 1; ++i)
00031 {
00032 if(i == LinesPercept::field)
00033 observationTable[i].create(field,LinesPercept::xField);
00034 else if(i == LinesPercept::numberOfLineTypes)
00035 observationTable[i].create(field,LinesPercept::yField);
00036 else
00037 observationTable[i].create(field,LinesPercept::LineType(i));
00038 stream << observationTable[i];
00039 }
00040 templateTable[0].create(field,LinesPercept::yellowGoal);
00041 templateTable[LinesPercept::skyblueGoal - LinesPercept::yellowGoal].create(field,LinesPercept::skyblueGoal);
00042 stream << templateTable[0] << templateTable[1];
00043 #else
00044 InBinaryFile stream("lines04.tab");
00045 if(stream.exists())
00046 {
00047 for(i = 0; i < LinesPercept::numberOfLineTypes + 1; ++i)
00048 stream >> observationTable[i];
00049 stream >> templateTable[0] >> templateTable[1];
00050 }
00051 else
00052 {
00053 OUTPUT(idText, text, "LinesTables2004 : lines04.tab not found");
00054 }
00055 #endif
00056 }
00057 }
00058
00059 LinesTables2004::~LinesTables2004()
00060 {
00061 if(!--refCount)
00062 {
00063 delete [] observationTable;
00064 delete [] templateTable;
00065 }
00066 }
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093