예제 #1
0
파일: Finger.cs 프로젝트: sugasaki/Kinect
 public Finger Clone()
 {
     Finger f = new Finger(_identifier, _startposition);
     f.Position = _postition;
     f.Shift = _shift;
     return f;
 }
예제 #2
0
파일: Finger.cs 프로젝트: sugasaki/Kinect
 public FingerTouchEventArgs(Finger fingerinfo)
 {
     Finger = new Finger(fingerinfo.Identifier, fingerinfo.StartPosition)
     {
         Position = fingerinfo.Position
     };
 }
예제 #3
0
파일: TButton.cs 프로젝트: sugasaki/Kinect
        public void FingerDown(object sender, FingerTouchEventArgs e)
        {
            if (_myfinger != null) return;

            _starttranslate = _transformhelper.Translate;
            _dragstart = e.Finger.Position;
            _draglimitreached = false;
            _startscale = _transformhelper.Scale;
            _myzindex = (int)this.GetValue(Canvas.ZIndexProperty);
            //
            _transformhelper.Delay = 0.25;
            //
            if (!DisableAnimation)
            {
                if (double.IsInfinity(_dragradius))
                {
                    _transformhelper.Scale = _startscale + .10;
                }
                else
                {
                    _transformhelper.Scale = _startscale - .05;
                }
            }
            this.SetValue(Canvas.ZIndexProperty, 100);
            //
            _myfinger = new Finger(e.Finger.Identifier, e.Finger.Position);

            pz = this.TransformToVisual(this.Parent as UIElement).Transform(new Point());

            _pressed = true;
            if (Pressed != null && _enabled) Pressed(this, new FingerTouchEventArgs( _myfinger.Clone() ));
        }
예제 #4
0
파일: TButton.cs 프로젝트: sugasaki/Kinect
 public void FingerUp(object sender, FingerTouchEventArgs e)
 {
     if (_myfinger != null && _myfinger.Identifier != e.Finger.Identifier) return;
     //            if (double.IsInfinity(_dragradius))
     if (!DisableAnimation)
     {
         _transformhelper.Delay = 0.50;
         _transformhelper.Scale = _startscale;
     }
     this.SetValue(Canvas.ZIndexProperty, _myzindex);
     //
     if (Tapped != null && _enabled && _myfinger != null && Utility.Vector2D.Distance(_myfinger.StartPosition, _myfinger.Position) < 10)
     {
         sfx.Play();
         Tapped(this, new FingerTouchEventArgs(_myfinger.Clone()));
     }
     _pressed = false;
     if (Drop != null && _enabled) Drop(this, new FingerTouchEventArgs( _myfinger.Clone() ));
     _myfinger = null;
     //
     if (Drop == null || !_draglimitreached)
     {
         _transformhelper.Translate = _homelocation;
     }
     _transformhelper.Delay = 0.0;
 }
예제 #5
0
 public GestureTranslateEventArgs(Finger finger, Point translationshift)
 {
     _finger = finger;
     _translationshift = translationshift;
 }
예제 #6
0
 public GestureTapEventArgs(Finger finger, Point taplocation)
 {
     _finger = finger;
     _taplocation = taplocation;
 }
예제 #7
0
 public GestureScaleEventArgs(Finger fingera, Finger fingerb, double scalefactor)
 {
     _fingera = fingera;
     _fingerb = fingerb;
     _scalefactor = scalefactor;
 }
예제 #8
0
        private Finger _fingerb; // clone it before passing to args

        #endregion Fields

        #region Constructors

        public GestureRotateEventArgs(Finger fingera, Finger fingerb, double angleshift)
        {
            _angleshift = angleshift;
            _fingera = fingera;
            _fingerb = fingerb;
        }
예제 #9
0
 public GestureHoldEventArgs(Finger finger, Point holdlocation)
 {
     _finger = finger;
     _holdlocation = holdlocation;
 }