ToFix(dev): début archi

pull/19/head
Louis DUFOUR 1 year ago
parent 083f08a901
commit c54a3efd48

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

@ -7,27 +7,36 @@ using Lib;
namespace KinectUtils
{
static class GestureManager
public static class GestureManager
{
static event EventHandler GestureRecognized;
static KinectManager KinectManager { get; set; }
static List<BaseGesture> KnownGestures { get; set; }
public static event EventHandler<GestureRecognizedEventArgs> GestureRecognized;
public static List<BaseGesture> KnownGestures = new List<BaseGesture>();
static public void AddGestures(IGestureFactory factory)
public static void AddGestures(IGestureFactory factory)
{
KnownGestures = (List<BaseGesture>)factory.CreateGestures();
var gestures = factory.CreateGestures();
foreach (var gesture in gestures)
{
AddGesture(gesture);
}
}
static public void AddGestures(params BaseGesture[] gestures)
public static void AddGesture(BaseGesture gesture)
{
foreach (var gesture in gestures)
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)
{
KnownGestures.Remove(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();

@ -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>

@ -48,13 +48,10 @@
<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>

@ -4,7 +4,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LibMyGesturesBank
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;
}
}
}

@ -4,7 +4,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LibMyGesturesBank
namespace MyGesturesBank
{
internal class TwoHandsDragon
{

Loading…
Cancel
Save