public static Gesture_Event_Cutting_Sorting Detect(List <My_Point> points, Gesture_Controler controler) { List <My_Point> result = new List <My_Point>(); Gesture_Event_Cutting_Sorting cuttingEvent = null; if (Group_List.CardGroups.Count > 0 && controler.Control.MainWindow.SortingGestureLayer.GroupLinks.Count > 0) { Menu_Sort_Box[] keys = controler.Control.MainWindow.SortingGestureLayer.GroupLinks.Keys.ToArray(); foreach (My_Point p in points) { if (p.Sender is Card_Layer) { foreach (Menu_Sort_Box key in keys) { if (Group_List.CardGroups.ContainsKey(key)) { Card[] cards = Group_List.CardGroups[key].ToArray(); foreach (Card c in cards) { bool isIntersect = Calculator.DoLinesIntersect(new Point(key.CurrentPosition.X, key.CurrentPosition.Y), new Point(c.CurrentPosition.X, c.CurrentPosition.Y), new Point(p.StartPoint.Position.X, p.StartPoint.Position.Y), new Point(p.CurrentPoint.Position.X, p.CurrentPoint.Position.Y)); if (isIntersect) { result.Add(p); My_Point[] argPoints = result.ToArray(); object[] objects = new object[2]; objects[0] = key; objects[1] = c; cuttingEvent = new Gesture_Event_Cutting_Sorting(); cuttingEvent.Points = argPoints; Gesture_List.addGesture(cuttingEvent); Gesture_Cutting_Sorting_Listener gestureListener = new Gesture_Cutting_Sorting_Listener(controler, cuttingEvent); cuttingEvent.Register(objects, argPoints); foreach (My_Point p2 in result) { points.Remove(p2); } return(cuttingEvent); } } } } } } } return(null); }
public static Gesture_Event_Cutting_Sorting Detect(List<My_Point> points,Gesture_Controler controler) { List<My_Point> result = new List<My_Point>(); Gesture_Event_Cutting_Sorting cuttingEvent = null; if (Group_List.CardGroups.Count > 0 && controler.Control.MainWindow.SortingGestureLayer.GroupLinks.Count > 0) { Menu_Sort_Box[] keys = controler.Control.MainWindow.SortingGestureLayer.GroupLinks.Keys.ToArray(); foreach (My_Point p in points) { if (p.Sender is Card_Layer) { foreach (Menu_Sort_Box key in keys) { if (Group_List.CardGroups.ContainsKey(key)) { Card[] cards = Group_List.CardGroups[key].ToArray(); foreach (Card c in cards) { bool isIntersect = Calculator.DoLinesIntersect(new Point(key.CurrentPosition.X, key.CurrentPosition.Y), new Point(c.CurrentPosition.X, c.CurrentPosition.Y), new Point(p.StartPoint.Position.X, p.StartPoint.Position.Y), new Point(p.CurrentPoint.Position.X, p.CurrentPoint.Position.Y)); if (isIntersect) { result.Add(p); My_Point[] argPoints = result.ToArray(); object[] objects = new object[2]; objects[0] = key; objects[1] = c; cuttingEvent = new Gesture_Event_Cutting_Sorting(); cuttingEvent.Points = argPoints; Gesture_List.addGesture(cuttingEvent); Gesture_Cutting_Sorting_Listener gestureListener = new Gesture_Cutting_Sorting_Listener(controler, cuttingEvent); cuttingEvent.Register(objects, argPoints); foreach (My_Point p2 in result) { points.Remove(p2); } return cuttingEvent; } } } } } } } return null; }
private void detectGesture() { if (newGesturePoints.Count > 0) { // the code that you want to measure comes here Gesture_Event_Linking.Detect(newGesturePoints, this); //Gesture_Event_Copying.Detect(newGesturePoints, this); Gesture_Event_Sorting.Detect(newGesturePoints, this); //Gesture_Event_Emphasizing.Detect(newGesturePoints, this); //Gesture_Event_Grouping.Detect(newGesturePoints,this); //Gesture_Event_Sorting_Group.Detect(newGesturePoints, this); Gesture_Event_Showing.Detect(newGesturePoints, this); Gesture_Event_Showing_Sorting.Detect(newGesturePoints, this); Gesture_Event_Cutting_Sorting.Detect(newGesturePoints, this); Gesture_Event_Cutting_Link.Detect(newGesturePoints, this); Gesture_Event_Deleting_Bin.Detect(newGesturePoints, this); Gesture_Event_Collaborative_Zoon.Detect(newGesturePoints, this); } }
/// <param name="gestureControler">Should be the one created in the MainWindow</param> /// <param name="gestureEvent">The gesture variable which fire the event</param> public Gesture_Cutting_Sorting_Listener(Gesture_Controler gestureControler, Gesture_Event_Cutting_Sorting gestureEvent) : base(gestureControler, gestureEvent) { }
private Gesture_Event_Cutting_Sorting detectCuttingSortingRegister(List<My_Point> points) { List<My_Point> result = new List<My_Point>(); Gesture_Event_Cutting_Sorting cuttingEvent = null; if (Group_List.CardGroups.Count > 0 && mainWindow.SortingGestureLayer.GroupLinks.Count > 0) { String[] keys = mainWindow.SortingGestureLayer.GroupLinks.Keys.ToArray(); foreach (My_Point p in points) { if (p.Sender is Card_Layer) { foreach (String key in keys) { Menu_Sort_Button button = Group_List.GroupButtons[key]; if (Group_List.CardGroups.ContainsKey(key)) { Card[] cards = Group_List.CardGroups[key].ToArray(); foreach (Card c in cards) { bool isIntersect = Calculator.DoLinesIntersect(new Point(button.CurrentPosition.X, button.CurrentPosition.Y), new Point(c.CurrentPosition.X, c.CurrentPosition.Y), new Point(p.StartPoint.Position.X, p.StartPoint.Position.Y), new Point(p.CurrentPoint.Position.X, p.CurrentPoint.Position.Y)); if (isIntersect) { result.Add(p); My_Point[] argPoints = result.ToArray(); object[] objects = new object[2]; objects[0] = button; objects[1] = c; cuttingEvent = new Gesture_Event_Cutting_Sorting(); cuttingEvent.Points = argPoints; Gesture_List.addGesture(cuttingEvent); Gesture_Cutting_Sorting_Listener gestureListener = new Gesture_Cutting_Sorting_Listener(this, cuttingEvent); cuttingEvent.Register(objects, argPoints); foreach (My_Point p2 in result) { points.Remove(p2); } return cuttingEvent; } } } } } } } return null; }