Exemplo n.º 1
0
        public static Point DistanceVectorFrom(this SkeletonPoint point1, SkeletonPoint point2, double controlWidth, double controlHeight)
        {
            var screenPoint1 = point1.ToScreenPoint(controlWidth, controlHeight);
            var screenPoint2 = point2.ToScreenPoint(controlWidth, controlHeight);

            var deltaX = (screenPoint1.X - screenPoint2.X) / controlWidth;
            var deltaY = (screenPoint1.Y - screenPoint2.Y) / controlHeight;

            return new Point(deltaX, deltaY);
        }
Exemplo n.º 2
0
        protected override void RunPanning(SkeletonPoint handPoint)
        {
            var screenCoordinate = handPoint.ToScreenPoint(_map.ActualWidth, _map.ActualHeight);
            var location = Location.GetCoordinates(_map, screenCoordinate);
            DoPan(handPoint);

            if (KinectPanning != null)
            {
                KinectPanning(location.ToMapCoord());
            }
        }
Exemplo n.º 3
0
        protected override void RunZooming(SkeletonPoint rightHandPoint, SkeletonPoint leftHandPoint)
        {
            var rightHandCoordinate = rightHandPoint.ToScreenPoint(_map.ActualWidth, _map.ActualHeight);
            var leftHandCoordinate = leftHandPoint.ToScreenPoint(_map.ActualWidth, _map.ActualHeight);
            DoZoomMap(rightHandCoordinate, leftHandCoordinate);

            if (KinectZooming != null)
            {
                KinectZooming();
            }
        }
Exemplo n.º 4
0
        protected override void StartZoom(SkeletonPoint rightHandPoint, SkeletonPoint leftHandPoint)
        {
            IsZooming = true;
            _startRightHandScreenCoord = rightHandPoint.ToScreenPoint(_map.ActualWidth, _map.ActualHeight);
            _startLeftHandScreenCoord = leftHandPoint.ToScreenPoint(_map.ActualWidth, _map.ActualHeight);
            _startDistance = _startRightHandScreenCoord.DistanceFrom(_startLeftHandScreenCoord);
            _startZoomLevel = _map.ZoomLevel;

            if (KinectZoomStarted != null)
            {
                KinectZoomStarted();
            }
        }
Exemplo n.º 5
0
        protected override void StartPan(SkeletonPoint handPoint)
        {
            IsPanning = true;
            _startHandPoint = handPoint;
            var screenCoordinate = handPoint.ToScreenPoint(_map.ActualWidth, _map.ActualHeight);
            _startHandCoordinate = Location.GetCoordinates(_map, screenCoordinate);

            var rect = _map.GeographicalBounds;

            _startExtent = new Rect(rect.TopLeft, rect.BottomRight);
            var currCenter = _map.Center;
            _startMapCenter = new Location(currCenter.Latitude, currCenter.Longitude);

            if (KinectPanStart != null)
            {
                KinectPanStart(_startHandCoordinate.ToMapCoord());
            }
        }