Ejemplo n.º 1
0
        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;
        }
Ejemplo n.º 2
0
		public TuioContact(TuioCursor cursor, ContactState state, System.Drawing.Size monitorSize)
			: base(cursor.getFingerID(), state, new Point(0, 0), 20, 20)
		{

            float x, y;

            //Edit by Wander
            if (secondaryScreen == null)
            {
                x = cursor.getScreenX(monitorSize.Width);
                y = cursor.getScreenY(monitorSize.Height);
            }
            else
            {
                x = cursor.getX() * secondaryScreen.WorkingArea.Width + secondaryScreen.WorkingArea.Left;
                y = cursor.getY() * secondaryScreen.WorkingArea.Height + secondaryScreen.WorkingArea.Top;
            }

			Position = new Point(x, y);
			Orientation = 0;
		}
        private void processTouchOnlyUpdateEvent(TuioCursor tcur)
        {
            lock (touchOnlyLock)
            {
                if (draggedObjects.ContainsKey(tcur.getSessionID()))
                {
                    // Move the currently dragged TuioObject according to its dragging cursor
                    Vector2 tcurPosition = new Vector2(tcur.getScreenX(Settings.RESOLUTION_X), tcur.getScreenY(Settings.RESOLUTION_Y));
                    TuioObject tobj = draggedObjects[tcur.getSessionID()];
                    Vector2 dragDiffVector = dragDiffVectors[tcur.getSessionID()];
                    Vector2 newObjPos = new Vector2((tcurPosition.X - dragDiffVector.X) / (float)Settings.RESOLUTION_X, (tcurPosition.Y - dragDiffVector.Y) / (float)Settings.RESOLUTION_Y);
                    // Don't let objects move off screen
                    if (newObjPos.X >= 0 && newObjPos.X <= 1 && newObjPos.Y >= 0 && newObjPos.Y <= 1)
                    {

                        //tobj.update(TuioTime.getSessionTime(), (tcurPosition.X - dragDiffVector.X) / (float)Settings.RESOLUTION_X, (tcurPosition.Y - dragDiffVector.Y) / (float)Settings.RESOLUTION_Y, tcur.getXSpeed(), tcur.getYSpeed(), tcur.getMotionAccel());
                        //tobj.update(TuioTime.getSessionTime(), newObjPos.X, newObjPos.Y);
                        tobj.update(TuioTime.getSessionTime(), newObjPos.X, newObjPos.Y, tcur.getXSpeed(), tcur.getYSpeed(), tcur.getMotionAccel());
                        draggedObjects.AddOrUpdate(tobj.getSymbolID(), tobj, updateTObj);
                        //tuioObjects.AddOrUpdate(tobj.getSymbolID(), tobj, updateTObj);
                        this.updateTuioObject(tobj);
                        Debug.WriteLine("Moving " + tobj.getSymbolID() + " with " + tcur.getSessionID() + " at speed " + tcur.getXSpeed() + ", " + tcur.getYSpeed());
                    }

                    /*
                    // Update corresponding ZoomCircle
                    // Calculate speed from x and y speeds
                    float totalSpeed = (float)Math.Sqrt(Math.Pow(tobj.getXSpeed() * Settings.RESOLUTION_X, 2) + Math.Pow(tobj.getYSpeed() * Settings.RESOLUTION_Y, 2));

                    // Ignore implausibly high values because Multitaction is giving us speeds of "Infinity" every couple updates
                    if (totalSpeed > 1000f)
                        totalSpeed = 0f;

                    //Debug.WriteLine(totalSpeed);
                    zoomedCircles[tobj.getSymbolID()].MoveTo(tobj.getScreenX(Settings.RESOLUTION_X), tobj.getScreenY(Settings.RESOLUTION_Y), tobj.getAngleDegrees(), this.GetMovieTimestamp(), this.GetMovieTimestampRaw(), totalSpeed);
                    */
                }
            }
        }
Ejemplo n.º 4
0
Archivo: Form1.cs Proyecto: solson/DSAE
 public void updateTuioCursor(TuioCursor c)
 {
     if (c.getCursorID() == tuioCursorID)
         tuioCursor = new Point(c.getScreenX(Program.tableWidth), c.getScreenY(Program.tableHeight));
     else if (c.getCursorID() == tuioCursorID2)
         tuioCursor2 = new Point(c.getScreenX(Program.tableWidth), c.getScreenY(Program.tableHeight));
 }
Ejemplo n.º 5
0
Archivo: Form1.cs Proyecto: solson/DSAE
 public void removeTuioCursor(TuioCursor c)
 {
     if (c.getCursorID() == tuioCursorID)
     {
         tuioCursorID = -1;
         tuioCursor = new Point(c.getScreenX(Program.tableWidth), c.getScreenY(Program.tableHeight));
         tuioMouseUp = true;
     }
     else if (c.getCursorID() == tuioCursorID2)
     {
         tuioCursorID2 = -1;
         tuioCursor2 = new Point(c.getScreenX(Program.tableWidth), c.getScreenY(Program.tableHeight));
         tuioMouseUp2 = true;
     }
 }
Ejemplo n.º 6
0
Archivo: Form1.cs Proyecto: solson/DSAE
 public void addTuioCursor(TuioCursor c)
 {
     if (tuioCursorID == -1)
     {
         tuioCursorID = c.getCursorID();
         tuioCursor = new Point(c.getScreenX(Program.tableWidth), c.getScreenY(Program.tableHeight));
         tuioMouseDown = true;
     }
     else if (tuioCursorID2 == -1 && studyController.currentCondition.IsCollocated())
     {
         tuioCursorID2 = c.getCursorID();
         tuioCursor2 = new Point(c.getScreenX(Program.tableWidth), c.getScreenY(Program.tableHeight));
         tuioMouseDown2 = true;
     }
 }
Ejemplo n.º 7
0
 public void addTuioCursor(TuioCursor tuioCursor)
 {
     this.Dispatcher.Invoke(
         DispatcherPriority.Normal,
         (Action)(() =>
         {
             BSQSim.AddTouchDevice((int)tuioCursor.getSessionID(),
                 new Point(tuioCursor.getScreenX(Convert.ToInt32(DISPLAY_W)), tuioCursor.getScreenY(Convert.ToInt32(DISPLAY_H))));
         }));
 }
Ejemplo n.º 8
0
        public void updateTuioCursor(TuioCursor c)
        {
            // Enviando a posição do cursor do mouse!
            // ContaTelefingerMove++;

            if (clienteEnvia.connected)
            {
                // if (ContaTelefingerMove.Equals(4))
                // {
                // TODO: Resolver problema de posicionamento do TeleFinger
                // Enviando os dados para a movimentação do TeleFinger
                // int x = (int)c.getScreenX(width);
                // int y = (int)c.getScreenY(height);
                int x = Convert.ToInt32(c.getScreenX(width) * (0.5 * 5));
                int y = Convert.ToInt32(c.getScreenY(height) * (0.5 * 5));

                this.EnviaMsgBlob(new Point(x, y), clienteEnvia.getCorTelepointer(), c.getFingerID(), clienteEnvia.getLogin(), "fingerMovePointer");
                // ContaTelefingerMove = 0;
                //}
            }
        }
Ejemplo n.º 9
0
        public void removeTuioCursor(TuioCursor c)
        {
            cursorList.Remove(c.getSessionID());

            // this.label1.Text = "Eemoções enviadas:" + ContaTelefingerMove.ToString();
            // ContaTelefingerMove++;

            // this.label1.Text = "Enviado:" + DateTime.Now.ToLongTimeString() + " " + DateTime.Now.Millisecond.ToString() ;

            if (clienteEnvia.connected)
            {

                int x = Convert.ToInt32(c.getScreenX(width) * (0.5 * 5));
                int y = Convert.ToInt32(c.getScreenY(height) * (0.5 * 5));

                this.EnviaMsgBlob(new Point(x, y), clienteEnvia.getCorTelepointer(), c.getFingerID(), clienteEnvia.getLogin(), "fingerRemovePointer");
            }
        }
Ejemplo n.º 10
0
        public void addTuioCursor(TuioCursor c)
        {
            // Adicionando na lista de objetos a serem varidos no método OnPaintBackground
            cursorList.Add(c.getSessionID(), c);

            if (clienteEnvia.connected)
            {
                // TODO: Resolver problema de posicionamento do TeleFinger
                // Enviando os dados para a crição do TeleFinger
                // int x = (int) c.getScreenX(width);
                // int y = (int) c.getScreenY(height);
                int x = Convert.ToInt32(c.getScreenX(width) * (0.5 * 5));
                int y = Convert.ToInt32(c.getScreenY(height) * (0.5 * 5));

                this.EnviaMsgBlob(new Point(x, y), clienteEnvia.getCorTelepointer(), c.getFingerID(), clienteEnvia.getLogin(), "fingerCreatePointer");
            }
        }