public void addTuioCursor(TuioCursor tcur) { lock (_lockObj) { _eventQueue.Enqueue(new TuioEvent(ETuioEventType.ADD_CURSOR, tcur)); } }
public void UpdateTuioCursor(TuioCursor tuioCursor) { _refreshTimer.Stop(); int pid = tuioCursor.getCursorID(); int i = _pointerTouchInfos.FindIndex(pti => pti.PointerInfo.PointerId == pid); if (i != -1) { int x = (int)((tuioCursor.getX() * (_screenRect.Width + _calibrationBuffer.Width)) + _calibrationBuffer.Left + _screenRect.Left); int y = (int)((tuioCursor.getY() * (_screenRect.Height + _calibrationBuffer.Height)) + _calibrationBuffer.Top + _screenRect.Top); PointerTouchInfo pointerTouchInfo = _pointerTouchInfos[i]; pointerTouchInfo.PointerInfo.PointerFlags = PointerFlags.UPDATE | PointerFlags.INRANGE | ((this.IsContactEnabled) ? PointerFlags.INCONTACT : PointerFlags.NONE); pointerTouchInfo.PointerInfo.PtPixelLocation = new PointerTouchPoint { X = x, Y = y }; pointerTouchInfo.ContactArea = new ContactArea { Left = x - CONTACT_AREA_RADIUS, Right = x + CONTACT_AREA_RADIUS, Top = y - CONTACT_AREA_RADIUS, Bottom = y + CONTACT_AREA_RADIUS }; _pointerTouchInfos[i] = pointerTouchInfo; Trace.WriteLine(string.Format("set cur {0} ({1}) {2} {3} {4} {5}", pid, tuioCursor.getSessionID(), x, y, tuioCursor.getMotionSpeed(), tuioCursor.getMotionAccel()), "TUIO"); } }
// Cursor down is for new touch events. we take the TUIO cursor object and convert it // into a touch event, and add it to our active list of events public virtual void cursorDown(TuioCursor cursor) { // first, make a new BBTouchEvent, tag it with the unique touch id BBTouchEvent newEvent = new BBTouchEvent(cursor.getSessionID()); // set the initial information newEvent.screenPosition = new Vector3(cursor.getX() * cameraPixelWidth, (1.0f - cursor.getY()) * cameraPixelHeight, 0.3f); newEvent.eventState = BBTouchEventState.Began; newEvent.didChange = true; // set all the rest of the info updateEvent(newEvent, cursor); // add it to our active event dictionary so we can retireve it based on it's unique ID // some times badness happens and we get an error adding one here for some reason // it should not ever be the case that the ID is already there. // if it is, then we need to behave if (activeEvents.ContainsKey(cursor.getSessionID())) { // then something is not right.. remove the old one and add a new one activeEvents.Remove(cursor.getSessionID()); } activeEvents.Add(cursor.getSessionID(), newEvent); // queue it up for processing lock (eventQueueLock) eventQueue.Add(newEvent); }
internal void EnqueueContact(TuioCursor cursor, ContactState state) { lock (contactsQueue) { contactsQueue.Enqueue(new TuioContact(cursor, state, monitorSize)); } }
public void removeTuioCursor(TuioCursor tcur) { lock (_lockObj) { _eventQueue.Enqueue(new TuioEvent(ETuioEventType.REMOVE_CURSOR, tcur)); } }
public void removeTuioCursor(TuioCursor c) { TUIOTouchDevice.tuioInfoCache.Add(new TUIOINFO() { action = TUIOAction.Up, cursor = c }); }
public void updateTuioCursor(TuioCursor tcur) { lock (_lockObj) { _eventQueue.Enqueue(new TuioEvent(ETuioEventType.UPDATE_CURSOR, tcur)); } }
public void updateTuioCursor(TuioCursor c) { if (verbose) { Console.WriteLine("set cur " + c.CursorID + " (" + c.SessionID + ") " + c.X + " " + c.Y + " " + c.MotionSpeed + " " + c.MotionAccel); } }
public void removeTuioCursor(TuioCursor c) { lock (cursorSync) { cursorList.Remove(c.SessionID); } // Debug.Log("del cur " + c.CursorID + " (" + c.SessionID + ")"); }
public void addTuioCursor(TuioCursor c) { lock (cursorSync) { cursorList.Add(c.SessionID, c); } //Debug.Log("add cur " + c.CursorID + " (" + c.SessionID + ") " + c.X + " " + c.Y); }
public void removeTuioCursor(TuioCursor tcur) { lock (cursorSync) { cursorList.Remove(tcur.getSessionID()); } Console.WriteLine("del cur " + tcur.getCursorID() + " (" + tcur.getSessionID() + ")"); }
public void removeTuioCursor(TuioCursor c) { cursorDidChange = true; if (eventDelegate) { eventDelegate.cursorUp(c); } }
public void updateTuioCursor(TuioCursor c) { cursorDidChange = true; if (eventDelegate) { eventDelegate.cursorMove(c); } }
public void addTuioCursor(TuioCursor tcur) { Console.WriteLine("add cur " + tcur.CursorID + " (" + tcur.SessionID + ") " + tcur.X + " " + tcur.Y); if (cursors.FirstOrDefault <TuioCursor>(tmp => tmp.CursorID == tcur.CursorID) == null) { cursors.Add(tcur); } }
public void addTuioCursor(TuioCursor tcur) { if (GestureManager != null) { TouchPoint tp = this.CreateTouchPoint(tcur); OnTouchDown(tp); } }
public void removeTuioCursor(TuioCursor c) { cursorDidChange = true; if (mtM) { mtM.removeCursor(c); } }
private void updateEvent(BBTouchEvent anEvent, TuioCursor cursor) { anEvent.lastScreenPosition = anEvent.screenPosition; anEvent.tuioPosition = new Vector2(cursor.getX(), (1.0f - cursor.getY())); anEvent.screenPosition = new Vector3(cursor.getX() * cameraPixelWidth, (1.0f - cursor.getY()) * cameraPixelHeight, 0.3f); anEvent.lastTouchTime = anEvent.touchTime; anEvent.touchTime = Time.time; }
// for now we are only interested in cursor objects, ie touch events public void addTuioCursor(TuioCursor c) { cursorDidChange = true; if (mtM) { mtM.newCursor(c); } }
public void updateTuioCursor(TuioCursor c) { cursorDidChange = true; if (mtM) { mtM.updateCursor(c); } }
// // for now we are only interested in cursor objects, ie touch events public void addTuioCursor(TuioCursor c) { cursorDidChange = true; if (eventDelegate) { eventDelegate.cursorDown(c); } }
public void removeTuioCursor(TuioCursor c) { lock (objectSync) { if (collectEvents) { activeCursorEvents.Add(new mtCursorEvent(c, mtCursorState.Remove)); } } }
public void updateTuioCursor(TuioCursor c) { lock (objectSync) { if (collectEvents) { activeCursorEvents.Add(new BBCursorEvent(c, BBCursorState.Update)); } } }
public void removeTuioCursor(TuioCursor tuioCursor) { this.Dispatcher.Invoke( DispatcherPriority.Normal, (Action)(() => { BSQSim.RemoveTouchDevice((int)tuioCursor.getSessionID()); })); }
public TuioContact(TuioCursor cursor, ContactState state, System.Drawing.Size monitorSize) : base(cursor.getFingerID(), state, new Point(0, 0), 20, 20) { float x = cursor.getScreenX(monitorSize.Width); float y = cursor.getScreenY(monitorSize.Height); Position = new Point(x, y); Orientation = 0; }
// enterframe function public void ProcessTUIO(List <TrackingPoint> trackingPoints) { if (this.server == null) { return; } // init this.server.initFrame(TuioTime.SessionTime); // event process foreach (TrackingPoint pt in trackingPoints) { switch (pt.ptEvent) { case TrackingPoint.POINT_EVENT.DOWN: // cursor add TuioCursor tcur_new = this.server.addTuioCursor((float)pt.position.X, (float)pt.position.Y); break; case TrackingPoint.POINT_EVENT.MOVE: // cursor update foreach (TuioCursor tcur_move in this.server.getTuioCursors()) { if (tcur_move.getDistance((float)pt.pre_position.X, (float)pt.pre_position.Y) == 0.0) { this.server.updateTuioCursor(tcur_move, (float)pt.position.X, (float)pt.position.Y); break; } } break; case TrackingPoint.POINT_EVENT.UP: // cursor remove foreach (TuioCursor tcur_del in this.server.getTuioCursors()) { if (tcur_del.getDistance((float)pt.position.X, (float)pt.position.Y) == 0.0f) { this.server.removeTuioCursor(tcur_del); break; } } break; default: break; } } // commit this.server.stopUntouchedMovingCursors(); this.server.removeUntouchedStoppedCursors(); this.server.commitFrame(); }
public void addTuioCursor(TuioCursor tcur) { lock (cursorSync) { cursorList.Add(tcur.getSessionID(), tcur); } Console.WriteLine("add cur " + tcur.getCursorID() + " (" + tcur.getSessionID() + ") " + tcur.getX() + " " + tcur.getY()); // VisualFeedback.InvalidateVisual(); }
public void updateTuioCursor(TuioCursor tcur) { Console.WriteLine("set cur " + tcur.CursorID + " (" + tcur.SessionID + ") " + tcur.X + " " + tcur.Y + " " + tcur.MotionSpeed + " " + tcur.MotionAccel); TuioCursor cursor = cursors.FirstOrDefault <TuioCursor>(tmp => tmp.CursorID == tcur.CursorID); if (cursor != null) { cursor.update(tcur); } }
public void removeTuioCursor(TuioCursor tcur) { Console.WriteLine("del cur " + tcur.CursorID + " (" + tcur.SessionID + ")"); TuioCursor cursor = cursors.FirstOrDefault <TuioCursor>(tmp => tmp.CursorID == tcur.CursorID); if (cursors != null) { cursors.Remove(cursor); } }
public void updateTuioCursor(TuioCursor tuioCursor) { this.Dispatcher.Invoke( DispatcherPriority.Normal, (Action)(() => { BSQSim.UpdateTouchDevice((int)tuioCursor.getSessionID(), new Point(tuioCursor.getScreenX(Convert.ToInt32(DISPLAY_W)), tuioCursor.getScreenY(Convert.ToInt32(DISPLAY_H)))); })); }
public void removeTuioCursor(TuioCursor c) { lock (cursorList) { cursorList.Remove(c.SessionID); } if (verbose) { Console.WriteLine("del cur " + c.CursorID + " (" + c.SessionID + ")"); } }