412 * Affiche la distance de l'utilisateur dans le rendu visuel. |
417 * Affiche la distance de l'utilisateur dans le rendu visuel. |
413 * Sous forme de nombre en m et de rectangles changeant de couleur en fonction de la distance. |
418 * Sous forme de nombre en m et de rectangles changeant de couleur en fonction de la distance. |
414 */ |
419 */ |
415 public void showDistance(float proximity) |
420 public void showDistance(float proximity) |
416 { |
421 { |
417 DistanceLbl.Content = "Proximity : " + proximity + "%"; |
422 UserImage.Margin = new System.Windows.Thickness(552, 350 - 350 / 100 * proximity, 0, 0); |
418 |
|
419 if (proximity == 0) |
|
420 { |
|
421 R0.Fill = System.Windows.Media.Brushes.DarkGray; |
|
422 R1.Fill = System.Windows.Media.Brushes.DarkGray; |
|
423 R2.Fill = System.Windows.Media.Brushes.DarkGray; |
|
424 R3.Fill = System.Windows.Media.Brushes.DarkGray; |
|
425 R4.Fill = System.Windows.Media.Brushes.DarkGray; |
|
426 R5.Fill = System.Windows.Media.Brushes.DarkGray; |
|
427 R6.Fill = System.Windows.Media.Brushes.DarkGray; |
|
428 R7.Fill = System.Windows.Media.Brushes.DarkGray; |
|
429 R8.Fill = System.Windows.Media.Brushes.DarkGray; |
|
430 R9.Fill = System.Windows.Media.Brushes.DarkGray; |
|
431 R10.Fill = System.Windows.Media.Brushes.DarkGray; |
|
432 } |
|
433 else if (proximity > 0 && proximity < 10) |
|
434 { |
|
435 R0.Fill = System.Windows.Media.Brushes.DarkGray; |
|
436 R1.Fill = System.Windows.Media.Brushes.DarkGray; |
|
437 R2.Fill = System.Windows.Media.Brushes.DarkGray; |
|
438 R3.Fill = System.Windows.Media.Brushes.DarkGray; |
|
439 R4.Fill = System.Windows.Media.Brushes.DarkGray; |
|
440 R5.Fill = System.Windows.Media.Brushes.DarkGray; |
|
441 R6.Fill = System.Windows.Media.Brushes.DarkGray; |
|
442 R7.Fill = System.Windows.Media.Brushes.DarkGray; |
|
443 R8.Fill = System.Windows.Media.Brushes.DarkGray; |
|
444 R9.Fill = System.Windows.Media.Brushes.DarkGray; |
|
445 R10.Fill = System.Windows.Media.Brushes.Red; |
|
446 } |
|
447 else if (proximity > 10 && proximity < 20) |
|
448 { |
|
449 R0.Fill = System.Windows.Media.Brushes.DarkGray; |
|
450 R1.Fill = System.Windows.Media.Brushes.DarkGray; |
|
451 R2.Fill = System.Windows.Media.Brushes.DarkGray; |
|
452 R3.Fill = System.Windows.Media.Brushes.DarkGray; |
|
453 R4.Fill = System.Windows.Media.Brushes.DarkGray; |
|
454 R5.Fill = System.Windows.Media.Brushes.DarkGray; |
|
455 R6.Fill = System.Windows.Media.Brushes.DarkGray; |
|
456 R7.Fill = System.Windows.Media.Brushes.DarkGray; |
|
457 R8.Fill = System.Windows.Media.Brushes.DarkGray; |
|
458 R9.Fill = System.Windows.Media.Brushes.Red; |
|
459 R10.Fill = System.Windows.Media.Brushes.Red; |
|
460 } |
|
461 else if (proximity > 20 && proximity < 30) |
|
462 { |
|
463 R0.Fill = System.Windows.Media.Brushes.DarkGray; |
|
464 R1.Fill = System.Windows.Media.Brushes.DarkGray; |
|
465 R2.Fill = System.Windows.Media.Brushes.DarkGray; |
|
466 R3.Fill = System.Windows.Media.Brushes.DarkGray; |
|
467 R4.Fill = System.Windows.Media.Brushes.DarkGray; |
|
468 R5.Fill = System.Windows.Media.Brushes.DarkGray; |
|
469 R6.Fill = System.Windows.Media.Brushes.DarkGray; |
|
470 R7.Fill = System.Windows.Media.Brushes.DarkGray; |
|
471 R8.Fill = System.Windows.Media.Brushes.Red; |
|
472 R9.Fill = System.Windows.Media.Brushes.Red; |
|
473 R10.Fill = System.Windows.Media.Brushes.Red; |
|
474 } |
|
475 else if (proximity > 30 && proximity < 40) |
|
476 { |
|
477 R0.Fill = System.Windows.Media.Brushes.DarkGray; |
|
478 R1.Fill = System.Windows.Media.Brushes.DarkGray; |
|
479 R2.Fill = System.Windows.Media.Brushes.DarkGray; |
|
480 R3.Fill = System.Windows.Media.Brushes.DarkGray; |
|
481 R4.Fill = System.Windows.Media.Brushes.DarkGray; |
|
482 R5.Fill = System.Windows.Media.Brushes.DarkGray; |
|
483 R6.Fill = System.Windows.Media.Brushes.DarkGray; |
|
484 R7.Fill = System.Windows.Media.Brushes.Orange; |
|
485 R8.Fill = System.Windows.Media.Brushes.Red; |
|
486 R9.Fill = System.Windows.Media.Brushes.Red; |
|
487 R10.Fill = System.Windows.Media.Brushes.Red; |
|
488 } |
|
489 else if (proximity > 40 && proximity < 50) |
|
490 { |
|
491 R0.Fill = System.Windows.Media.Brushes.DarkGray; |
|
492 R1.Fill = System.Windows.Media.Brushes.DarkGray; |
|
493 R2.Fill = System.Windows.Media.Brushes.DarkGray; |
|
494 R3.Fill = System.Windows.Media.Brushes.DarkGray; |
|
495 R4.Fill = System.Windows.Media.Brushes.DarkGray; |
|
496 R5.Fill = System.Windows.Media.Brushes.DarkGray; |
|
497 R6.Fill = System.Windows.Media.Brushes.Orange; |
|
498 R7.Fill = System.Windows.Media.Brushes.Orange; |
|
499 R8.Fill = System.Windows.Media.Brushes.Red; |
|
500 R9.Fill = System.Windows.Media.Brushes.Red; |
|
501 R10.Fill = System.Windows.Media.Brushes.Red; |
|
502 } |
|
503 else if (proximity > 50 && proximity < 60) |
|
504 { |
|
505 R0.Fill = System.Windows.Media.Brushes.DarkGray; |
|
506 R1.Fill = System.Windows.Media.Brushes.DarkGray; |
|
507 R2.Fill = System.Windows.Media.Brushes.DarkGray; |
|
508 R3.Fill = System.Windows.Media.Brushes.DarkGray; |
|
509 R4.Fill = System.Windows.Media.Brushes.DarkGray; |
|
510 R5.Fill = System.Windows.Media.Brushes.Orange; |
|
511 R6.Fill = System.Windows.Media.Brushes.Orange; |
|
512 R7.Fill = System.Windows.Media.Brushes.Orange; |
|
513 R8.Fill = System.Windows.Media.Brushes.Red; |
|
514 R9.Fill = System.Windows.Media.Brushes.Red; |
|
515 R10.Fill = System.Windows.Media.Brushes.Red; |
|
516 } |
|
517 else if (proximity > 60 && proximity < 70) |
|
518 { |
|
519 R0.Fill = System.Windows.Media.Brushes.DarkGray; |
|
520 R1.Fill = System.Windows.Media.Brushes.DarkGray; |
|
521 R2.Fill = System.Windows.Media.Brushes.DarkGray; |
|
522 R3.Fill = System.Windows.Media.Brushes.DarkGray; |
|
523 R4.Fill = System.Windows.Media.Brushes.Yellow; |
|
524 R5.Fill = System.Windows.Media.Brushes.Orange; |
|
525 R6.Fill = System.Windows.Media.Brushes.Orange; |
|
526 R7.Fill = System.Windows.Media.Brushes.Orange; |
|
527 R8.Fill = System.Windows.Media.Brushes.Red; |
|
528 R9.Fill = System.Windows.Media.Brushes.Red; |
|
529 R10.Fill = System.Windows.Media.Brushes.Red; |
|
530 } |
|
531 else if (proximity > 70 && proximity < 80) |
|
532 { |
|
533 R0.Fill = System.Windows.Media.Brushes.DarkGray; |
|
534 R1.Fill = System.Windows.Media.Brushes.DarkGray; |
|
535 R2.Fill = System.Windows.Media.Brushes.DarkGray; |
|
536 R3.Fill = System.Windows.Media.Brushes.Yellow; |
|
537 R4.Fill = System.Windows.Media.Brushes.Yellow; |
|
538 R5.Fill = System.Windows.Media.Brushes.Orange; |
|
539 R6.Fill = System.Windows.Media.Brushes.Orange; |
|
540 R7.Fill = System.Windows.Media.Brushes.Orange; |
|
541 R8.Fill = System.Windows.Media.Brushes.Red; |
|
542 R9.Fill = System.Windows.Media.Brushes.Red; |
|
543 R10.Fill = System.Windows.Media.Brushes.Red; |
|
544 } |
|
545 else if (proximity > 80 && proximity < 90) |
|
546 { |
|
547 R0.Fill = System.Windows.Media.Brushes.DarkGray; |
|
548 R1.Fill = System.Windows.Media.Brushes.DarkGray; |
|
549 R2.Fill = System.Windows.Media.Brushes.Yellow; |
|
550 R3.Fill = System.Windows.Media.Brushes.Yellow; |
|
551 R4.Fill = System.Windows.Media.Brushes.Yellow; |
|
552 R5.Fill = System.Windows.Media.Brushes.Orange; |
|
553 R6.Fill = System.Windows.Media.Brushes.Orange; |
|
554 R7.Fill = System.Windows.Media.Brushes.Orange; |
|
555 R8.Fill = System.Windows.Media.Brushes.Red; |
|
556 R9.Fill = System.Windows.Media.Brushes.Red; |
|
557 R10.Fill = System.Windows.Media.Brushes.Red; |
|
558 } |
|
559 else if (proximity > 90 && proximity < 100) |
|
560 { |
|
561 R0.Fill = System.Windows.Media.Brushes.DarkGray; |
|
562 R1.Fill = System.Windows.Media.Brushes.Yellow; |
|
563 R2.Fill = System.Windows.Media.Brushes.Yellow; |
|
564 R3.Fill = System.Windows.Media.Brushes.Yellow; |
|
565 R4.Fill = System.Windows.Media.Brushes.Yellow; |
|
566 R5.Fill = System.Windows.Media.Brushes.Orange; |
|
567 R6.Fill = System.Windows.Media.Brushes.Orange; |
|
568 R7.Fill = System.Windows.Media.Brushes.Orange; |
|
569 R8.Fill = System.Windows.Media.Brushes.Red; |
|
570 R9.Fill = System.Windows.Media.Brushes.Red; |
|
571 R10.Fill = System.Windows.Media.Brushes.Red; |
|
572 } |
|
573 else if (proximity == 100) |
|
574 { |
|
575 R0.Fill = System.Windows.Media.Brushes.Green; |
|
576 R1.Fill = System.Windows.Media.Brushes.Yellow; |
|
577 R2.Fill = System.Windows.Media.Brushes.Yellow; |
|
578 R3.Fill = System.Windows.Media.Brushes.Yellow; |
|
579 R4.Fill = System.Windows.Media.Brushes.Yellow; |
|
580 R5.Fill = System.Windows.Media.Brushes.Orange; |
|
581 R6.Fill = System.Windows.Media.Brushes.Orange; |
|
582 R7.Fill = System.Windows.Media.Brushes.Orange; |
|
583 R8.Fill = System.Windows.Media.Brushes.Red; |
|
584 R9.Fill = System.Windows.Media.Brushes.Red; |
|
585 R10.Fill = System.Windows.Media.Brushes.Red; |
|
586 } |
|
587 } |
423 } |
588 |
424 |
589 /* |
425 /* |
590 * Affiche la détection de la main droite via un label. |
426 * Affiche la détection de la main droite via un label. |
591 */ |
427 */ |
592 public void showRightHandRect(bool show) |
428 public void showRightHandRect(bool show) |
593 { |
429 { |
|
430 Bitmap bitmap = null; |
|
431 |
594 if (show) |
432 if (show) |
595 RightHand.Background = System.Windows.Media.Brushes.Blue; |
433 bitmap = getImage(imgLocation + "\\right_hand_on.png"); |
596 else |
434 else |
597 RightHand.Background = System.Windows.Media.Brushes.DarkGray; |
435 bitmap = getImage(imgLocation + "\\right_hand_off.png"); |
|
436 |
|
437 RightHand.Source = CreateBitmapSourceFromBitmap(bitmap); |
598 } |
438 } |
599 |
439 |
600 /* |
440 /* |
601 * Affiche la détection de la main gauche via un label. |
441 * Affiche la détection de la main gauche via un label. |
602 */ |
442 */ |
603 public void showLeftHandRect(bool show) |
443 public void showLeftHandRect(bool show) |
604 { |
444 { |
|
445 Bitmap bitmap = null; |
|
446 |
605 if (show) |
447 if (show) |
606 LeftHand.Background = System.Windows.Media.Brushes.Blue; |
448 bitmap = getImage(imgLocation + "\\left_hand_on.png"); |
607 else |
449 else |
608 LeftHand.Background = System.Windows.Media.Brushes.DarkGray; |
450 bitmap = getImage(imgLocation + "\\left_hand_off.png"); |
|
451 |
|
452 LeftHand.Source = CreateBitmapSourceFromBitmap(bitmap); |
609 } |
453 } |
610 |
454 |
611 /* |
455 /* |
612 * Dessine les noeuds du squelette dans le rendu visuel. |
456 * Dessine les noeuds du squelette dans le rendu visuel. |
613 */ |
457 */ |