TouchTracker.cs 1.1 KB

12345678910111213141516171819202122232425262728293031
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Drawing;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. using bbiwarg.Images;
  8. using bbiwarg.Graphics;
  9. using bbiwarg.Recognition.Tracking;
  10. using bbiwarg.Utility;
  11. namespace bbiwarg.Recognition.TouchRecognition
  12. {
  13. class TouchTracker : Tracker<TouchEvent, TrackedTouchEvent>
  14. {
  15. public List<TouchEvent> TouchEvents { get { return getCurrentObjectsWithState(TrackingState.Tracked); } }
  16. public event TouchEventHandler TouchDown;
  17. public event TouchEventHandler TouchMove;
  18. public event TouchEventHandler TouchUp;
  19. protected override TrackedTouchEvent createTrackedObject(TouchEvent detectedObject)
  20. {
  21. TrackedTouchEvent tte = new TrackedTouchEvent(idPool.getNextUnusedID(), detectedObject, Parameters.TouchTrackerNumFramesDetectedUntilTracked, Parameters.TouchTrackerNumFramesLostUntilDeleted);
  22. tte.TouchDown += TouchDown;
  23. tte.TouchMove += TouchMove;
  24. tte.TouchUp += TouchUp;
  25. return tte;
  26. }
  27. }
  28. }