Tracklet.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. //
  2. // Created by wrede on 25.04.16.
  3. //
  4. #ifndef GBMOT_TRACKLET_H
  5. #define GBMOT_TRACKLET_H
  6. #include <cstdlib>
  7. #include <vector>
  8. #include "ObjectData.h"
  9. namespace core
  10. {
  11. //TODO sorted insert
  12. /**
  13. * A class for storing multiple object data objects.
  14. * The object data objects are handled as a path.
  15. */
  16. class Tracklet : public ObjectData
  17. {
  18. private:
  19. /**
  20. * The path objects.
  21. */
  22. std::vector<ObjectData> path_objects_;
  23. /**
  24. * The highest frame index of all objects in the path.
  25. */
  26. size_t last_frame_index_;
  27. public:
  28. /**
  29. * Creates a empty tracklet to store path object in.
  30. * This is NOT a virtual object.
  31. */
  32. Tracklet();
  33. /**
  34. * Creates a tracklet with the given initial object.
  35. * @see ObjectData
  36. * @param first_object The first object to store in the path
  37. */
  38. Tracklet(ObjectData first_object);
  39. /**
  40. * Adds the object in the first place of the path.
  41. * @param obj The object to add
  42. */
  43. void AddPathObjectFirst(ObjectData obj);
  44. /**
  45. * Adds the object in the last place of the path.
  46. * @param obj The object to add
  47. */
  48. void AddPathObjectLast(ObjectData obj);
  49. /**
  50. * Gets the lowest frame index of all path objects.
  51. * @return The lowest frame index
  52. */
  53. size_t GetFirstFrameIndex();
  54. /**
  55. * Gets the highest frame index of all path objects.
  56. * @return The highest frame index
  57. */
  58. size_t GetLastFrameIndex();
  59. /**
  60. * Gets the path object at the given index.
  61. */
  62. ObjectData GetPathObject(size_t i);
  63. /**
  64. * Compares this object with the given object.
  65. * @param obj A pointer to the object to compare this object to
  66. * @return A double value indicating the comparison result
  67. */
  68. virtual double CompareTo(ObjectData *obj);
  69. //TODO point interpolation -> object data (last object of this with first of other)
  70. //TODO implement CompareTo (last object of this with first of other)
  71. };
  72. }
  73. #endif //GBMOT_TRACKLET_H