pull/19/head
Johan LACHENAL 1 year ago
commit f7821f3a49

@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using MyGesturesBank;
namespace KinectUtils
{
@ -12,7 +13,9 @@ namespace KinectUtils
{
return new List<BaseGesture>
{
new PostureHandsOnHead()
new SwipeRightHand(),
new ClapHands()
// Ajoutez d'autres gestes ici
};
}
}

@ -9,7 +9,7 @@ using Microsoft.Kinect;
namespace KinectUtils
{
static class GestureManager
public static class GestureManager
{
static private BodyFrameReader bodyFrameReader;
static private Body[] bodies;
@ -17,24 +17,31 @@ namespace KinectUtils
static KinectManager KinectManager { get; set; }
static List<BaseGesture> KnownGestures { get; set; }
static public void AddGestures(IGestureFactory factory)
{
KnownGestures = (List<BaseGesture>)factory.CreateGestures();
}
static public void AddGestures(params BaseGesture[] gestures)
public static void AddGestures(IGestureFactory factory)
{
var gestures = factory.CreateGestures();
foreach (var gesture in gestures)
{
if (!gestures.Contains(gesture))
AddGesture(gesture);
}
}
public static void AddGesture(BaseGesture gesture)
{
if (!KnownGestures.Contains(gesture))
{
KnownGestures.Add(gesture);
gesture.GestureRecognized += (sender, e) => GestureRecognized?.Invoke(sender, e);
}
}
}
static public void RemoveGesture(BaseGesture gesture)
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)
{
bodyFrameReader = kinectManager.Sensor.BodyFrameSource.OpenReader();

@ -52,6 +52,10 @@
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\LibMyGesturesBank\MyGesturesBank.csproj">
<Project>{2496dfb1-eb55-47a1-a780-211e079b289d}</Project>
<Name>MyGesturesBank</Name>
</ProjectReference>
<ProjectReference Include="..\Lib\Lib.csproj">
<Project>{0751c83e-7845-4e5f-a5d3-e11aba393aca}</Project>
<Name>Lib</Name>

@ -47,12 +47,11 @@
<Compile Include="PostureHandsOnHead .cs" />
<Compile Include="PostureHandUp.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="RightHandUp.cs" />
<Compile Include="SwipeRightHand.cs" />
<Compile Include="TwoHandsDragon.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\KinectUtils\KinectUtils.csproj">
<Project>{2d44487e-f514-4063-9494-2af1e8c9e9c8}</Project>
<Name>KinectUtils</Name>
</ProjectReference>
<ProjectReference Include="..\Lib\Lib.csproj">
<Project>{0751c83e-7845-4e5f-a5d3-e11aba393aca}</Project>
<Name>Lib</Name>

@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MyGesturesBank
{
internal class RightHandUp
{
}
}

@ -0,0 +1,38 @@
using KinectUtils;
using Microsoft.Kinect;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MyGesturesBank
{
public class SwipeRightHand : Gesture
{
protected override bool TestInitialConditions(Body body)
{
// Implémentez la logique pour vérifier les conditions initiales du balayage à droite
return false;
}
protected override bool TestPosture(Body body)
{
// Implémentez la vérification de la posture pour le balayage à droite
return false;
}
protected override bool TestRunningGesture(Body body)
{
// Implémentez la dynamique du geste de balayage à droite
return false;
}
protected override bool TestEndConditions(Body body)
{
// Vérifiez si les conditions de fin du geste de balayage à droite sont remplies
return false;
}
}
}

@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MyGesturesBank
{
internal class TwoHandsDragon
{
}
}
Loading…
Cancel
Save