示例#1
0
 private void ComputeChart(Func <threeDimensionalPointDTO, double> Mapping)
 {
     if (LeftLens.Equals(selected))
     {
         NavigationService.Navigate(new ThreeDimensionalLensPage(model.LeftAnalyzeLensResponse.points, Mapping));
     }
     else if (RightLens.Equals(selected))
     {
         NavigationService.Navigate(new ThreeDimensionalLensPage(model.RightAnalyzeLensResponse.points, Mapping));
     }
 }
示例#2
0
 private void Model_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
 {
     if ("RightAnalyzeLensResponse".Equals(e.PropertyName))
     {
         RightLens.InvalidateVisual();
         RightLens.MouseLeftButtonDown -= LensSelected;
         RightLens.MouseLeftButtonDown += LensSelected;
         RightLens.MouseMove           += Tooltip_MouseMove;
     }
     else if ("LeftAnalyzeLensResponse".Equals(e.PropertyName))
     {
         LeftLens.InvalidateVisual();
         LeftLens.MouseLeftButtonDown -= LensSelected;
         LeftLens.MouseLeftButtonDown += LensSelected;
         LeftLens.MouseMove           += Tooltip_MouseMove;
     }
 }
示例#3
0
        private void Tooltip_MouseMove(object sender, MouseEventArgs e)
        {
            double centerX = (sender as FrameworkElement).ActualWidth / 2.0;
            double centerY = (sender as FrameworkElement).ActualHeight / 2.0;
            double radius  = Math.Min(centerX, centerY) * 5 / 6;

            Point currentPos = e.GetPosition(sender as IInputElement);

            double x = centerX - currentPos.X;
            double y = centerY - currentPos.Y;

            bool inside = IsInside(
                new twoDimensionalPointDTO()
            {
                x = x,
                y = y
            },
                radius);

            if (!floatingTip.IsOpen.Equals(inside))
            {
                floatingTip.IsOpen = inside;
            }

            if (inside)
            {
                floatingTip.PlacementTarget = sender as UIElement;

                floatingTip.HorizontalOffset = currentPos.X + 20;
                floatingTip.VerticalOffset   = currentPos.Y;

                analyzedPointDTO[] points = LeftLens.Equals(sender) ? model.LeftAnalyzeLensResponse.points : model.RightAnalyzeLensResponse.points;

                int sqrt = Convert.ToInt32(Math.Sqrt(points.Count()));
                int side = (sqrt - 1) / 2;

                int xPoint = Convert.ToInt32(Math.Round(x * side / radius));
                int yPoint = Convert.ToInt32(Math.Round(y * side / radius));

                int index = (side + xPoint) * sqrt + side - yPoint;

                floatingTip.DataContext = points[index];
            }
        }
示例#4
0
 private void Toolbar_Mask_Clicked(object sender, RoutedEventArgs e)
 {
     mask = !mask;
     RightLens.InvalidateVisual();
     LeftLens.InvalidateVisual();
 }
示例#5
0
 private void Toolbar_Compare_Clicked(object sender, RoutedEventArgs e)
 {
     compare = !compare;
     RightLens.InvalidateVisual();
     LeftLens.InvalidateVisual();
 }
示例#6
0
 private void Toolbar_PowerMap_Clicked(object sender, EventArgs e)
 {
     mapping = ToPowerMap;
     RightLens.InvalidateVisual();
     LeftLens.InvalidateVisual();
 }