ticksPosition.h

Go to the documentation of this file.
00001 #ifndef TICKS_POSITION_H
00002 #define TICKS_POSITION_H
00003 
00013 #include "ticksPositionInterface.h"
00014 #include <list>
00015 #include <functional>
00016 
00017 
00021 class TicksPosition : public VXV::TicksPositionInterface {
00022   typedef struct {
00023     VXV::Position3D pos;
00024     unsigned long ticks;
00025   } ticksPos_t;
00026   std::list<ticksPos_t> pos_list;
00027 
00028   class ticks_less :
00029     public std::binary_function<ticksPos_t, ticksPos_t, bool> {
00030   public:
00031     result_type operator()(const first_argument_type lhs,
00032                            const second_argument_type rhs) {
00033       return lhs.ticks < rhs.ticks;
00034     }
00035   };
00036   double calcAngle(const VXV::Direction& a,
00037                    const VXV::Direction& b, double k) const;
00038 
00039 public:
00040   TicksPosition(void);
00041   ~TicksPosition(void);
00042 
00043   VXV::Position3D getPosition(unsigned long ticks) const;
00044 
00051   void add(const VXV::Position3D& position, unsigned long ticks);
00052 
00056   void clear(void);
00057 
00063   void del_olderThan(unsigned long ticks);
00064 };
00065 
00066 #endif /* !TICKS_POSITION_H */
00067 

Generated on Mon Apr 13 22:52:05 2009 by  doxygen 1.5.7.1