00001 #ifndef _FILTER_H__
00002 #define _FILTER_H__
00003
00004 #include "bodies.h"
00005 #include <list>
00006
00007
00009
00013 class TrackingFilter
00014 {
00015 private:
00017 struct TFilterEntry
00018 {
00020 Body::BodyType type;
00022 int id;
00024 MATRIX prevMatrix;
00026 bool validMatrix;
00028
00031 float angleFilter;
00033
00036 float distFilter;
00037 };
00039 float angleFilter;
00041 float distFilter;
00043 std::list<TFilterEntry> table;
00045
00049 TFilterEntry * findEntry(Body::BodyType btype, int bid);
00051
00055 inline bool checkTranslation(MATRIX currMatrix, MATRIX prevMatrix,float shift);
00057
00061 inline bool checkRotation(MATRIX currMatrix, MATRIX prevMatrix, float angle);
00062 public:
00064
00067 TrackingFilter(float angle = 0.1, float shift = 5);
00069
00073 bool UpdateFilter(Body::BodyType type, int id, float angle, float shift);
00075 ~TrackingFilter(){}
00077
00080 bool Filter(Body * body);
00082 wxString GetAsString(const char * lineSeparator = "\n", const char * atributeSeparator = "\t");
00083 void WriteToLog();
00084 };
00085
00086
00087
00088
00089
00090
00091 #endif