public static Gesture_Event_Cutting_Link Detect(List <My_Point> points, Gesture_Controler controler) { List <My_Point> result = new List <My_Point>(); Gesture_Event_Cutting_Link cuttingEvent = null; if (Link_List.CardLinks.Count > 0 && controler.Control.MainWindow.LinkingGestureLayer.CardLinks.Count > 0) { Gesture_Event_Linking[] links = Link_List.CardLinks.ToArray(); foreach (My_Point p in points) { if (p.Sender is Card_Layer) { foreach (Gesture_Event_Linking link in links) { if (link.Card1 != null && link.Card2 != null) { bool isIntersect = Calculator.DoLinesIntersect(new Point(link.Card1.CurrentPosition.X, link.Card1.CurrentPosition.Y), new Point(link.Card2.CurrentPosition.X, link.Card2.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] = link; cuttingEvent = new Gesture_Event_Cutting_Link(); cuttingEvent.Points = argPoints; Gesture_List.addGesture(cuttingEvent); Gesture_Cutting_Link_Listener gestureListener = new Gesture_Cutting_Link_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_Link Detect(List<My_Point> points,Gesture_Controler controler) { List<My_Point> result = new List<My_Point>(); Gesture_Event_Cutting_Link cuttingEvent = null; if (Link_List.CardLinks.Count > 0 && controler.Control.MainWindow.LinkingGestureLayer.CardLinks.Count > 0) { Gesture_Event_Linking[] links = Link_List.CardLinks.ToArray(); foreach (My_Point p in points) { if (p.Sender is Card_Layer) { foreach (Gesture_Event_Linking link in links) { if (link.Card1 != null && link.Card2 != null) { bool isIntersect = Calculator.DoLinesIntersect(new Point(link.Card1.CurrentPosition.X, link.Card1.CurrentPosition.Y), new Point(link.Card2.CurrentPosition.X, link.Card2.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] = link; cuttingEvent = new Gesture_Event_Cutting_Link(); cuttingEvent.Points = argPoints; Gesture_List.addGesture(cuttingEvent); Gesture_Cutting_Link_Listener gestureListener = new Gesture_Cutting_Link_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); } }
public Gesture_Cutting_Link_Listener(Gesture_Controler gestureControler, Gesture_Event_Cutting_Link gestureEvent) : base(gestureControler, gestureEvent) { }
public Gesture_Cutting_Link_Listener(Gesture_Controler gestureControler, Gesture_Event_Cutting_Link gestureEvent) : base(gestureControler, gestureEvent) { }