/// <summary> /// Initializes a new instance of the <see cref="GestureController"/> class. /// </summary> public GestureController() { // Define the gestures IRelativeGestureSegment[] joinedhandsSegments = new IRelativeGestureSegment[20]; JoinedHandsSegment1 joinedhandsSegment = new JoinedHandsSegment1(); for (int i = 0; i < 20; i++) { // gesture consists of the same thing 10 times joinedhandsSegments[i] = joinedhandsSegment; } AddGesture(GestureType.JoinedHands, joinedhandsSegments); IRelativeGestureSegment[] menuSegments = new IRelativeGestureSegment[20]; MenuSegment1 menuSegment = new MenuSegment1(); for (int i = 0; i < 20; i++) { // gesture consists of the same thing 20 times menuSegments[i] = menuSegment; } AddGesture(GestureType.Menu, menuSegments); IRelativeGestureSegment[] swipeleftSegments = new IRelativeGestureSegment[3]; swipeleftSegments[0] = new SwipeLeftSegment1(); swipeleftSegments[1] = new SwipeLeftSegment2(); swipeleftSegments[2] = new SwipeLeftSegment3(); AddGesture(GestureType.SwipeLeft, swipeleftSegments); IRelativeGestureSegment[] swiperightSegments = new IRelativeGestureSegment[3]; swiperightSegments[0] = new SwipeRightSegment1(); swiperightSegments[1] = new SwipeRightSegment2(); swiperightSegments[2] = new SwipeRightSegment3(); AddGesture(GestureType.SwipeRight, swiperightSegments); IRelativeGestureSegment[] waveRightSegments = new IRelativeGestureSegment[6]; WaveRightSegment1 waveRightSegment1 = new WaveRightSegment1(); WaveRightSegment2 waveRightSegment2 = new WaveRightSegment2(); waveRightSegments[0] = waveRightSegment1; waveRightSegments[1] = waveRightSegment2; waveRightSegments[2] = waveRightSegment1; waveRightSegments[3] = waveRightSegment2; waveRightSegments[4] = waveRightSegment1; waveRightSegments[5] = waveRightSegment2; AddGesture(GestureType.WaveRight, waveRightSegments); IRelativeGestureSegment[] waveLeftSegments = new IRelativeGestureSegment[6]; WaveLeftSegment1 waveLeftSegment1 = new WaveLeftSegment1(); WaveLeftSegment2 waveLeftSegment2 = new WaveLeftSegment2(); waveLeftSegments[0] = waveLeftSegment1; waveLeftSegments[1] = waveLeftSegment2; waveLeftSegments[2] = waveLeftSegment1; waveLeftSegments[3] = waveLeftSegment2; waveLeftSegments[4] = waveLeftSegment1; waveLeftSegments[5] = waveLeftSegment2; AddGesture(GestureType.WaveLeft, waveLeftSegments); IRelativeGestureSegment[] zoomInSegments = new IRelativeGestureSegment[3]; zoomInSegments[0] = new ZoomSegment1(); zoomInSegments[1] = new ZoomSegment2(); zoomInSegments[2] = new ZoomSegment3(); AddGesture(GestureType.ZoomIn, zoomInSegments); IRelativeGestureSegment[] zoomOutSegments = new IRelativeGestureSegment[3]; zoomOutSegments[0] = new ZoomSegment3(); zoomOutSegments[1] = new ZoomSegment2(); zoomOutSegments[2] = new ZoomSegment1(); AddGesture(GestureType.ZoomOut, zoomOutSegments); IRelativeGestureSegment[] swipeUpSegments = new IRelativeGestureSegment[3]; swipeUpSegments[0] = new SwipeUpSegment1(); swipeUpSegments[1] = new SwipeUpSegment2(); swipeUpSegments[2] = new SwipeUpSegment3(); AddGesture(GestureType.SwipeUp, swipeUpSegments); IRelativeGestureSegment[] swipeDownSegments = new IRelativeGestureSegment[3]; swipeDownSegments[0] = new SwipeDownSegment1(); swipeDownSegments[1] = new SwipeDownSegment2(); swipeDownSegments[2] = new SwipeDownSegment3(); AddGesture(GestureType.SwipeDown, swipeDownSegments); }
private void registerGestures() { // Define all recognisable gestures: IRelativeGestureSegment[] joined_hands_segments = new IRelativeGestureSegment[20]; JoinedHandsSegment1 joined_hands_segment = new JoinedHandsSegment1(); for (int i = 0; i < 20; i++) { // Gesture consists of the same thing 10 times joined_hands_segments[i] = joined_hands_segment; } this.fizbin_controller.AddGesture("JoinedHands", joined_hands_segments); IRelativeGestureSegment[] menu_segments = new IRelativeGestureSegment[20]; MenuSegment1 menu_segment = new MenuSegment1(); for (int i = 0; i < 20; i++) { // Festure consists of the same thing 20 times menu_segments[i] = menu_segment; } this.fizbin_controller.AddGesture("Menu", menu_segments); IRelativeGestureSegment[] swipe_left_segments = new IRelativeGestureSegment[3]; swipe_left_segments[0] = new SwipeLeftSegment1(); swipe_left_segments[1] = new SwipeLeftSegment2(); swipe_left_segments[2] = new SwipeLeftSegment3(); this.fizbin_controller.AddGesture("SwipeLeft", swipe_left_segments); IRelativeGestureSegment[] swipe_right_segments = new IRelativeGestureSegment[3]; swipe_right_segments[0] = new SwipeRightSegment1(); swipe_right_segments[1] = new SwipeRightSegment2(); swipe_right_segments[2] = new SwipeRightSegment3(); this.fizbin_controller.AddGesture("SwipeRight", swipe_right_segments); IRelativeGestureSegment[] wave_right_segments = new IRelativeGestureSegment[6]; WaveRightSegment1 wave_right_segment_1 = new WaveRightSegment1(); WaveRightSegment2 wave_right_segment_2 = new WaveRightSegment2(); wave_right_segments[0] = wave_right_segment_1; wave_right_segments[1] = wave_right_segment_2; wave_right_segments[2] = wave_right_segment_1; wave_right_segments[3] = wave_right_segment_2; wave_right_segments[4] = wave_right_segment_1; wave_right_segments[5] = wave_right_segment_2; this.fizbin_controller.AddGesture("WaveRight", wave_right_segments); IRelativeGestureSegment[] wave_left_segments = new IRelativeGestureSegment[6]; WaveLeftSegment1 wave_left_segment_1 = new WaveLeftSegment1(); WaveLeftSegment2 wave_left_segment_2 = new WaveLeftSegment2(); wave_left_segments[0] = wave_left_segment_1; wave_left_segments[1] = wave_left_segment_2; wave_left_segments[2] = wave_left_segment_1; wave_left_segments[3] = wave_left_segment_2; wave_left_segments[4] = wave_left_segment_1; wave_left_segments[5] = wave_left_segment_2; this.fizbin_controller.AddGesture("WaveLeft", wave_left_segments); IRelativeGestureSegment[] zoom_in_segments = new IRelativeGestureSegment[3]; zoom_in_segments[0] = new ZoomSegment1(); zoom_in_segments[1] = new ZoomSegment2(); zoom_in_segments[2] = new ZoomSegment3(); this.fizbin_controller.AddGesture("ZoomIn", zoom_in_segments); IRelativeGestureSegment[] zoom_out_segments = new IRelativeGestureSegment[3]; zoom_out_segments[0] = new ZoomSegment3(); zoom_out_segments[1] = new ZoomSegment2(); zoom_out_segments[2] = new ZoomSegment1(); this.fizbin_controller.AddGesture("ZoomOut", zoom_out_segments); IRelativeGestureSegment[] swipe_up_segments = new IRelativeGestureSegment[3]; swipe_up_segments[0] = new SwipeUpSegment1(); swipe_up_segments[1] = new SwipeUpSegment2(); swipe_up_segments[2] = new SwipeUpSegment3(); this.fizbin_controller.AddGesture("SwipeUp", swipe_up_segments); IRelativeGestureSegment[] swipe_down_segments = new IRelativeGestureSegment[3]; swipe_down_segments[0] = new SwipeDownSegment1(); swipe_down_segments[1] = new SwipeDownSegment2(); swipe_down_segments[2] = new SwipeDownSegment3(); this.fizbin_controller.AddGesture("SwipeDown", swipe_down_segments); }
/// <summary> /// Helper function to register all available /// </summary> private void RegisterGestures() { // define the gestures for the demo IRelativeGestureSegment[] joinedhandsSegments = new IRelativeGestureSegment[20]; JoinedHandsSegment1 joinedhandsSegment = new JoinedHandsSegment1(); for (int i = 0; i < 20; i++) { // gesture consists of the same thing 10 times joinedhandsSegments[i] = joinedhandsSegment; } gestureController.AddGesture("JoinedHands", joinedhandsSegments); IRelativeGestureSegment[] menuSegments = new IRelativeGestureSegment[20]; MenuSegment1 menuSegment = new MenuSegment1(); for (int i = 0; i < 20; i++) { // gesture consists of the same thing 20 times menuSegments[i] = menuSegment; } gestureController.AddGesture("Menu", menuSegments); IRelativeGestureSegment[] swipeleftSegments = new IRelativeGestureSegment[3]; swipeleftSegments[0] = new SwipeLeftSegment1(); swipeleftSegments[1] = new SwipeLeftSegment2(); swipeleftSegments[2] = new SwipeLeftSegment3(); gestureController.AddGesture("SwipeLeft", swipeleftSegments); IRelativeGestureSegment[] swiperightSegments = new IRelativeGestureSegment[3]; swiperightSegments[0] = new SwipeRightSegment1(); swiperightSegments[1] = new SwipeRightSegment2(); swiperightSegments[2] = new SwipeRightSegment3(); gestureController.AddGesture("SwipeRight", swiperightSegments); IRelativeGestureSegment[] waveRightSegments = new IRelativeGestureSegment[6]; WaveRightSegment1 waveRightSegment1 = new WaveRightSegment1(); WaveRightSegment2 waveRightSegment2 = new WaveRightSegment2(); waveRightSegments[0] = waveRightSegment1; waveRightSegments[1] = waveRightSegment2; waveRightSegments[2] = waveRightSegment1; waveRightSegments[3] = waveRightSegment2; waveRightSegments[4] = waveRightSegment1; waveRightSegments[5] = waveRightSegment2; gestureController.AddGesture("WaveRight", waveRightSegments); IRelativeGestureSegment[] waveLeftSegments = new IRelativeGestureSegment[6]; WaveLeftSegment1 waveLeftSegment1 = new WaveLeftSegment1(); WaveLeftSegment2 waveLeftSegment2 = new WaveLeftSegment2(); waveLeftSegments[0] = waveLeftSegment1; waveLeftSegments[1] = waveLeftSegment2; waveLeftSegments[2] = waveLeftSegment1; waveLeftSegments[3] = waveLeftSegment2; waveLeftSegments[4] = waveLeftSegment1; waveLeftSegments[5] = waveLeftSegment2; gestureController.AddGesture("WaveLeft", waveLeftSegments); IRelativeGestureSegment[] zoomInSegments = new IRelativeGestureSegment[3]; zoomInSegments[0] = new ZoomSegment1(); zoomInSegments[1] = new ZoomSegment2(); zoomInSegments[2] = new ZoomSegment3(); gestureController.AddGesture("ZoomIn", zoomInSegments); IRelativeGestureSegment[] zoomOutSegments = new IRelativeGestureSegment[3]; zoomOutSegments[0] = new ZoomSegment3(); zoomOutSegments[1] = new ZoomSegment2(); zoomOutSegments[2] = new ZoomSegment1(); gestureController.AddGesture("ZoomOut", zoomOutSegments); IRelativeGestureSegment[] swipeUpSegments = new IRelativeGestureSegment[3]; swipeUpSegments[0] = new SwipeUpSegment1(); swipeUpSegments[1] = new SwipeUpSegment2(); swipeUpSegments[2] = new SwipeUpSegment3(); gestureController.AddGesture("SwipeUp", swipeUpSegments); IRelativeGestureSegment[] swipeDownSegments = new IRelativeGestureSegment[3]; swipeDownSegments[0] = new SwipeDownSegment1(); swipeDownSegments[1] = new SwipeDownSegment2(); swipeDownSegments[2] = new SwipeDownSegment3(); gestureController.AddGesture("SwipeDown", swipeDownSegments); IRelativeGestureSegment[] swipeSurrenderSegment = new IRelativeGestureSegment[5]; for (int i = 0; i < 5; i++) { swipeSurrenderSegment[i] = new SurrenderSegment1(); } gestureController.AddGesture("Surrender", swipeSurrenderSegment); }
/// <summary> /// Helper function to register all available /// </summary> private void RegisterGestures() { // define the gestures for the demo IRelativeGestureSegment[] joinedhandsSegments = new IRelativeGestureSegment[20]; JoinedHandsSegment1 joinedhandsSegment = new JoinedHandsSegment1(); for (int i = 0; i < 20; i++) { // gesture consists of the same thing 10 times joinedhandsSegments[i] = joinedhandsSegment; } gestureController.AddGesture("JoinedHands", joinedhandsSegments); IRelativeGestureSegment[] menuSegments = new IRelativeGestureSegment[20]; MenuSegment1 menuSegment = new MenuSegment1(); for (int i = 0; i < 20; i++) { // gesture consists of the same thing 20 times menuSegments[i] = menuSegment; } gestureController.AddGesture("Menu", menuSegments); IRelativeGestureSegment[] swipeleftSegments = new IRelativeGestureSegment[3]; swipeleftSegments[0] = new SwipeLeftSegment1(); swipeleftSegments[1] = new SwipeLeftSegment2(); swipeleftSegments[2] = new SwipeLeftSegment3(); gestureController.AddGesture("SwipeLeft", swipeleftSegments); IRelativeGestureSegment[] swiperightSegments = new IRelativeGestureSegment[3]; swiperightSegments[0] = new SwipeRightSegment1(); swiperightSegments[1] = new SwipeRightSegment2(); swiperightSegments[2] = new SwipeRightSegment3(); gestureController.AddGesture("SwipeRight", swiperightSegments); IRelativeGestureSegment[] waveRightSegments = new IRelativeGestureSegment[6]; WaveRightSegment1 waveRightSegment1 = new WaveRightSegment1(); WaveRightSegment2 waveRightSegment2 = new WaveRightSegment2(); waveRightSegments[0] = waveRightSegment1; waveRightSegments[1] = waveRightSegment2; waveRightSegments[2] = waveRightSegment1; waveRightSegments[3] = waveRightSegment2; waveRightSegments[4] = waveRightSegment1; waveRightSegments[5] = waveRightSegment2; gestureController.AddGesture("WaveRight", waveRightSegments); IRelativeGestureSegment[] waveLeftSegments = new IRelativeGestureSegment[6]; WaveLeftSegment1 waveLeftSegment1 = new WaveLeftSegment1(); WaveLeftSegment2 waveLeftSegment2 = new WaveLeftSegment2(); waveLeftSegments[0] = waveLeftSegment1; waveLeftSegments[1] = waveLeftSegment2; waveLeftSegments[2] = waveLeftSegment1; waveLeftSegments[3] = waveLeftSegment2; waveLeftSegments[4] = waveLeftSegment1; waveLeftSegments[5] = waveLeftSegment2; gestureController.AddGesture("WaveLeft", waveLeftSegments); IRelativeGestureSegment[] zoomInSegments = new IRelativeGestureSegment[3]; zoomInSegments[0] = new ZoomSegment1(); zoomInSegments[1] = new ZoomSegment2(); zoomInSegments[2] = new ZoomSegment3(); gestureController.AddGesture("ZoomIn", zoomInSegments); IRelativeGestureSegment[] zoomOutSegments = new IRelativeGestureSegment[3]; zoomOutSegments[0] = new ZoomSegment3(); zoomOutSegments[1] = new ZoomSegment2(); zoomOutSegments[2] = new ZoomSegment1(); gestureController.AddGesture("ZoomOut", zoomOutSegments); IRelativeGestureSegment[] swipeUpSegments = new IRelativeGestureSegment[3]; swipeUpSegments[0] = new SwipeUpSegment1(); swipeUpSegments[1] = new SwipeUpSegment2(); swipeUpSegments[2] = new SwipeUpSegment3(); gestureController.AddGesture("SwipeUp", swipeUpSegments); IRelativeGestureSegment[] swipeDownSegments = new IRelativeGestureSegment[3]; swipeDownSegments[0] = new SwipeDownSegment1(); swipeDownSegments[1] = new SwipeDownSegment2(); swipeDownSegments[2] = new SwipeDownSegment3(); gestureController.AddGesture("SwipeDown", swipeDownSegments); IRelativeGestureSegment[] leanleftSegments = new IRelativeGestureSegment[2]; leanleftSegments[0] = new LeanLeftSegment1(); leanleftSegments[1] = new LeanLeftSegment2(); gestureController.AddGesture("LeanLeft", leanleftSegments); IRelativeGestureSegment[] leanrightSegments = new IRelativeGestureSegment[2]; leanrightSegments[0] = new LeanRightSegment1(); leanrightSegments[1] = new LeanRightSegment2(); gestureController.AddGesture("LeanRight", leanrightSegments); IRelativeGestureSegment[] MRStepRightSegments = new IRelativeGestureSegment[3]; MRStepRightSegments[0] = new MRStepRightSegment1(); MRStepRightSegments[1] = new MRStepRightSegment2(); MRStepRightSegments[2] = new MRStepRightSegment3(); gestureController.AddGesture("MRStepRight", MRStepRightSegments); IRelativeGestureSegment[] RightPushSegments = new IRelativeGestureSegment[2]; RightPushSegments[0] = new RightPushForwardSegment1(); RightPushSegments[1] = new RightPushForwardSegment2(); gestureController.AddGesture("RightPush", RightPushSegments); IRelativeGestureSegment[] LeftPushSegments = new IRelativeGestureSegment[2]; LeftPushSegments[0] = new LeftPushForwardSegment1(); LeftPushSegments[1] = new LeftPushForwardSegment2(); gestureController.AddGesture("LeftPush", LeftPushSegments); IRelativeGestureSegment[] LeftThrowSegments = new IRelativeGestureSegment[3]; LeftPushSegments[0] = new LeftThrowSegment1(); LeftPushSegments[1] = new LeftThrowSegment2(); LeftPushSegments[2] = new LeftThrowSegment3(); gestureController.AddGesture("LeftThrow", LeftThrowSegments); }