You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
46 lines
1.3 KiB
46 lines
1.3 KiB
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using Lib;
|
|
|
|
namespace KinectUtils
|
|
{
|
|
public static class GestureManager
|
|
{
|
|
public static event EventHandler<GestureRecognizedEventArgs> GestureRecognized;
|
|
public static List<BaseGesture> KnownGestures = new List<BaseGesture>();
|
|
|
|
public static void AddGestures(IGestureFactory factory)
|
|
{
|
|
var gestures = factory.CreateGestures();
|
|
foreach (var gesture in gestures)
|
|
{
|
|
AddGesture(gesture);
|
|
}
|
|
}
|
|
public static void AddGesture(BaseGesture gesture)
|
|
{
|
|
if (!KnownGestures.Contains(gesture))
|
|
{
|
|
KnownGestures.Add(gesture);
|
|
gesture.GestureRecognized += (sender, e) => GestureRecognized?.Invoke(sender, e);
|
|
}
|
|
}
|
|
public static void RemoveGesture(BaseGesture gesture)
|
|
{
|
|
if (KnownGestures.Contains(gesture))
|
|
{
|
|
KnownGestures.Remove(gesture);
|
|
gesture.GestureRecognized -= (sender, e) => GestureRecognized?.Invoke(sender, e);
|
|
}
|
|
}
|
|
|
|
static public void StartAcquiringFrames(KinectManager kinectManager)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
}
|
|
}
|