프로젝트

일반

사용자정보

개정판 f67f164e

IDf67f164e624ebe8497aaf9422e2c9cf5d0d88677
상위 9fcc0151
하위 cf2671a6

백흠경이(가) 5년 이상 전에 추가함

issue #923: merge codes for line control when user click left mouse button

Change-Id: I91f7179678821f1cdd05776fb62aaee5eb3e4428

차이점 보기:

KCOM/Views/MainMenu.xaml.cs
2400 2400
                                        currentControl = new CoordinateControl
2401 2401
                                        {
2402 2402
                                            Background = new SolidColorBrush(Colors.Black),
2403
                                            StartPoint = this.canvasDrawingMouseDownPoint,
2403 2404
                                            ControlType = ControlType.Coordinate
2404 2405
                                        };
2405 2406

  
......
2436 2437
                                    currentControl = new InsideWhiteControl
2437 2438
                                    {
2438 2439
                                        Background = new SolidColorBrush(Colors.Black),
2440
                                        StartPoint = this.canvasDrawingMouseDownPoint,
2439 2441
                                        ControlType = ControlType.InsideWhite
2440 2442
                                    };
2441 2443

  
......
2470 2472
                                    currentControl = new OverlapWhiteControl
2471 2473
                                    {
2472 2474
                                        Background = new SolidColorBrush(Colors.Black),
2475
                                        StartPoint = this.canvasDrawingMouseDownPoint,
2473 2476
                                        ControlType = ControlType.OverlapWhite
2474 2477
                                    };
2475 2478

  
......
2522 2525
                        {
2523 2526
                            if (e.LeftButton == MouseButtonState.Pressed)
2524 2527
                            {
2525
                                //if (IsDrawingEnable(canvasZoomPanningMouseDownPoint))
2526
                                //{
2527
                                    if (currentControl is RectangleControl)
2528
                                if (currentControl is RectangleControl)
2529
                                {
2530
                                    //20180906 LJY TEST IsRotationDrawingEnable
2531
                                    if (IsGetoutpoint((currentControl as RectangleControl).PointSet.Where(data => IsRotationDrawingEnable(data) == true).FirstOrDefault()))
2528 2532
                                    {
2529
                                        //20180906 LJY TEST IsRotationDrawingEnable
2530
                                        if (IsGetoutpoint((currentControl as RectangleControl).PointSet.Where(data => IsRotationDrawingEnable(data) == true).FirstOrDefault()))
2531
                                        {
2532
                                            return;
2533
                                        }
2534

  
2535
                                        CreateCommand.Instance.Execute(currentControl);
2533
                                        return;
2534
                                    }
2536 2535

  
2537
                                        currentControl = null;
2538
                                    
2536
                                    CreateCommand.Instance.Execute(currentControl);
2537
                                    currentControl = null;
2539 2538
                                    this.cursor = new Cursor(MainWindow.CursorChange().StreamSource);
2540
                                    }
2541
                                    else
2539
                                }
2540
                                else
2541
                                {
2542
                                    currentControl = new RectangleControl
2542 2543
                                    {
2543
                                        currentControl = new RectangleControl
2544
                                        {
2545
                                            Background = new SolidColorBrush(Colors.Black),
2546
                                            StartPoint = this.canvasDrawingMouseDownPoint,
2547
                                            ControlType = ControlType.Rectangle
2548
                                        };
2544
                                        Background = new SolidColorBrush(Colors.Black),
2545
                                        StartPoint = this.canvasDrawingMouseDownPoint,
2546
                                        ControlType = ControlType.Rectangle
2547
                                    };
2549 2548

  
2550
                                        currentControl.CommentID = Commons.shortGuid();
2551
                                        currentControl.MarkupInfoID = App.Custom_ViewInfoId;
2552
                                        currentControl.IsNew = true;
2553
                                        ViewerDataModel.Instance.MarkupControls_USER.Add(currentControl);
2549
                                    currentControl.CommentID = Commons.shortGuid();
2550
                                    currentControl.MarkupInfoID = App.Custom_ViewInfoId;
2551
                                    currentControl.IsNew = true;
2552
                                    ViewerDataModel.Instance.MarkupControls_USER.Add(currentControl);
2554 2553

  
2555
                                        currentControl.SetValue(Canvas.ZIndexProperty, 3);
2556
                                    }
2557
                                //}
2554
                                    currentControl.SetValue(Canvas.ZIndexProperty, 3);
2555
                                }
2558 2556
                            }
2559 2557
                        }
2560 2558
                        break;
......
2562 2560
                        {
2563 2561
                            if (e.LeftButton == MouseButtonState.Pressed)
2564 2562
                            {
2565
                                //if (IsDrawingEnable(canvasZoomPanningMouseDownPoint))
2566
                                //{
2567
                                    if (currentControl is RectCloudControl)
2563
                                if (currentControl is RectCloudControl)
2564
                                {
2565
                                    //20180906 LJY TEST IsRotationDrawingEnable
2566
                                    if (IsGetoutpoint((currentControl as RectCloudControl).PointSet.Where(data => IsRotationDrawingEnable(data) == true).FirstOrDefault()))
2568 2567
                                    {
2569
                                        //20180906 LJY TEST IsRotationDrawingEnable
2570
                                        if (IsGetoutpoint((currentControl as RectCloudControl).PointSet.Where(data => IsRotationDrawingEnable(data) == true).FirstOrDefault()))
2571
                                        {
2572
                                            return;
2573
                                        }
2568
                                        return;
2569
                                    }
2574 2570

  
2575
                                        CreateCommand.Instance.Execute(currentControl);
2571
                                    CreateCommand.Instance.Execute(currentControl);
2576 2572

  
2577
                                        currentControl = null;
2578
                                    
2579
                                        this.cursor = new Cursor(MainWindow.CursorChange().StreamSource);
2580
                                    }
2581
                                    else
2573
                                    currentControl = null;
2574
                                
2575
                                    this.cursor = new Cursor(MainWindow.CursorChange().StreamSource);
2576
                                }
2577
                                else
2578
                                {
2579
                                    currentControl = new RectCloudControl
2582 2580
                                    {
2583
                                        currentControl = new RectCloudControl
2584
                                        {
2585
                                            StartPoint = this.canvasDrawingMouseDownPoint,
2586
                                            ControlType = ControlType.RectCloud,
2587
                                            Background = new SolidColorBrush(Colors.Black)
2588
                                        };
2581
                                        StartPoint = this.canvasDrawingMouseDownPoint,
2582
                                        ControlType = ControlType.RectCloud,
2583
                                        Background = new SolidColorBrush(Colors.Black)
2584
                                    };
2589 2585

  
2590
                                        currentControl.MarkupInfoID = App.Custom_ViewInfoId;
2591
                                        currentControl.CommentID = Commons.shortGuid();
2592
                                        currentControl.IsNew = true;
2593
                                        ViewerDataModel.Instance.MarkupControls_USER.Add(currentControl);
2594
                                    }
2595
                                //}
2586
                                    currentControl.MarkupInfoID = App.Custom_ViewInfoId;
2587
                                    currentControl.CommentID = Commons.shortGuid();
2588
                                    currentControl.IsNew = true;
2589
                                    ViewerDataModel.Instance.MarkupControls_USER.Add(currentControl);
2590
                                }
2596 2591
                            }
2597 2592
                        }
2598 2593
                        break;
......
2600 2595
                        {
2601 2596
                            if (e.LeftButton == MouseButtonState.Pressed)
2602 2597
                            {
2603
                                //if (IsDrawingEnable(canvasZoomPanningMouseDownPoint))
2604
                                //{
2605
                                    if (currentControl is CircleControl)
2598
                                if (currentControl is CircleControl)
2599
                                {
2600
                                    //20180906 LJY TEST IsRotationDrawingEnable
2601
                                    if (IsGetoutpoint((currentControl as CircleControl).PointSet.Where(data => IsRotationDrawingEnable(data) == true).FirstOrDefault()))
2606 2602
                                    {
2607
                                        //20180906 LJY TEST IsRotationDrawingEnable
2608
                                        if (IsGetoutpoint((currentControl as CircleControl).PointSet.Where(data => IsRotationDrawingEnable(data) == true).FirstOrDefault()))
2609
                                        {
2610
                                            return;
2611
                                        }
2603
                                        return;
2604
                                    }
2612 2605

  
2613
                                        CreateCommand.Instance.Execute(currentControl);
2606
                                    CreateCommand.Instance.Execute(currentControl);
2614 2607

  
2615
                                        currentControl = null;
2616
                                    }
2617
                                    else
2608
                                    currentControl = null;
2609
                                }
2610
                                else
2611
                                {
2612
                                    currentControl = new CircleControl
2618 2613
                                    {
2619
                                        currentControl = new CircleControl
2620
                                        {
2621
                                            StartPoint = this.canvasDrawingMouseDownPoint,
2622
                                            LeftBottomPoint = this.canvasDrawingMouseDownPoint,
2623
                                            Background = new SolidColorBrush(Colors.Black)
2624
                                        };
2614
                                        StartPoint = this.canvasDrawingMouseDownPoint,
2615
                                        LeftBottomPoint = this.canvasDrawingMouseDownPoint,
2616
                                        Background = new SolidColorBrush(Colors.Black)
2617
                                    };
2625 2618

  
2626
                                        currentControl.MarkupInfoID = App.Custom_ViewInfoId;
2627
                                        currentControl.CommentID = Commons.shortGuid();
2628
                                        currentControl.IsNew = true;
2629
                                        ViewerDataModel.Instance.MarkupControls_USER.Add(currentControl);
2630
                                    }
2631
                                //}
2619
                                    currentControl.MarkupInfoID = App.Custom_ViewInfoId;
2620
                                    currentControl.CommentID = Commons.shortGuid();
2621
                                    currentControl.IsNew = true;
2622
                                    ViewerDataModel.Instance.MarkupControls_USER.Add(currentControl);
2623
                                }
2632 2624
                            }
2633 2625
                        }
2634 2626
                        break;
......
2636 2628
                        {
2637 2629
                            if (e.LeftButton == MouseButtonState.Pressed)
2638 2630
                            {
2639
                                //if (IsDrawingEnable(canvasZoomPanningMouseDownPoint))
2640
                                //{
2641
                                    if (currentControl is TriControl)
2631
                                if (currentControl is TriControl)
2632
                                {
2633
                                    var content = currentControl as TriControl;
2634
                                    if (content.MidPoint == new Point(0, 0))
2642 2635
                                    {
2643
                                        var content = currentControl as TriControl;
2644
                                        if (content.MidPoint == new Point(0, 0))
2645
                                        {
2646
                                            content.MidPoint = new Point(canvasDrawingMouseDownPoint.X, canvasDrawingMouseDownPoint.Y);
2647
                                        }
2648
                                        else
2649
                                        {
2650
                                            //20180906 LJY TEST IsRotationDrawingEnable
2651
                                            if (IsGetoutpoint((currentControl as TriControl).PointSet.Where(data => IsRotationDrawingEnable(data) == true).FirstOrDefault()))
2652
                                            {
2653
                                                return;
2654
                                            }
2655

  
2656
                                            CreateCommand.Instance.Execute(currentControl);
2657

  
2658
                                            currentControl = null;
2659
                                        }
2636
                                        content.MidPoint = new Point(canvasDrawingMouseDownPoint.X, canvasDrawingMouseDownPoint.Y);
2660 2637
                                    }
2661 2638
                                    else
2662 2639
                                    {
2663
                                        currentControl = new TriControl
2664
                                        {
2665
                                            StartPoint = new Point(canvasDrawingMouseDownPoint.X, canvasDrawingMouseDownPoint.Y),
2666
                                            Background = new SolidColorBrush(Colors.Black),
2667
                                        };
2668

  
2669
                                        currentControl.MarkupInfoID = App.Custom_ViewInfoId;
2670
                                        currentControl.CommentID = Commons.shortGuid();
2671
                                        currentControl.IsNew = true;
2672
                                        ViewerDataModel.Instance.MarkupControls_USER.Add(currentControl);
2673
                                    }
2674
                                //}
2675
                            }
2676
                        }
2677
                        break;
2678
                    case ControlType.SingleLine:
2679
                        {
2680
                            if (e.LeftButton == MouseButtonState.Pressed)
2681
                            {
2682
                                //if (IsDrawingEnable(canvasZoomPanningMouseDownPoint))
2683
                                //{
2684
                                    if (currentControl is LineControl)
2685
                                    {
2686 2640
                                        //20180906 LJY TEST IsRotationDrawingEnable
2687
                                        if (IsGetoutpoint((currentControl as LineControl).PointSet.Where(data => IsRotationDrawingEnable(data) == true).FirstOrDefault()))
2641
                                        if (IsGetoutpoint((currentControl as TriControl).PointSet.Where(data => IsRotationDrawingEnable(data) == true).FirstOrDefault()))
2688 2642
                                        {
2689 2643
                                            return;
2690 2644
                                        }
......
2692 2646
                                        CreateCommand.Instance.Execute(currentControl);
2693 2647

  
2694 2648
                                        currentControl = null;
2695
                                        this.MainAngle.Visibility = Visibility.Collapsed;
2696 2649
                                    }
2697
                                    else
2650
                                }
2651
                                else
2652
                                {
2653
                                    currentControl = new TriControl
2698 2654
                                    {
2699
                                        currentControl = new LineControl
2700
                                        {
2701
                                            ControlType = ControlType.SingleLine,
2702
                                            StartPoint = new Point(canvasDrawingMouseDownPoint.X, canvasDrawingMouseDownPoint.Y),
2703
                                            Background = new SolidColorBrush(Colors.Black)
2704
                                        };
2655
                                        StartPoint = new Point(canvasDrawingMouseDownPoint.X, canvasDrawingMouseDownPoint.Y),
2656
                                        Background = new SolidColorBrush(Colors.Black),
2657
                                    };
2705 2658

  
2706
                                        currentControl.MarkupInfoID = App.Custom_ViewInfoId;
2707
                                        currentControl.CommentID = Commons.shortGuid();
2708
                                        currentControl.IsNew = true;
2709
                                        ViewerDataModel.Instance.MarkupControls_USER.Add(currentControl);
2710
                                        this.MainAngle.Visibility = Visibility.Visible;
2711
                                    }
2712
                                //}
2659
                                    currentControl.MarkupInfoID = App.Custom_ViewInfoId;
2660
                                    currentControl.CommentID = Commons.shortGuid();
2661
                                    currentControl.IsNew = true;
2662
                                    ViewerDataModel.Instance.MarkupControls_USER.Add(currentControl);
2663
                                }
2713 2664
                            }
2714 2665
                        }
2715 2666
                        break;
2716 2667
                    case ControlType.CancelLine:
2668
                    case ControlType.SingleLine:
2669
                    case ControlType.ArrowLine:
2670
                    case ControlType.TwinLine:
2671
                    case ControlType.DimLine:
2717 2672
                        {
2718 2673
                            if (e.LeftButton == MouseButtonState.Pressed)
2719 2674
                            {
2720
                                //if (IsDrawingEnable(canvasZoomPanningMouseDownPoint))
2721
                                //{
2722
                                    if (currentControl is LineControl)
2675
                                if (currentControl is LineControl)
2676
                                {
2677
                                    //20180906 LJY TEST IsRotationDrawingEnable
2678
                                    if (IsGetoutpoint((currentControl as LineControl).PointSet.Where(data => IsRotationDrawingEnable(data) == true).FirstOrDefault()))
2723 2679
                                    {
2724
                                        //20180906 LJY TEST IsRotationDrawingEnable
2725
                                        if (IsGetoutpoint((currentControl as LineControl).PointSet.Where(data => IsRotationDrawingEnable(data) == true).FirstOrDefault()))
2726
                                        {
2727
                                            return;
2728
                                        }
2729

  
2730
                                        CreateCommand.Instance.Execute(currentControl);
2731

  
2732
                                        currentControl = null;
2733
                                        this.MainAngle.Visibility = Visibility.Collapsed;
2680
                                        return;
2734 2681
                                    }
2735
                                    else
2682

  
2683
                                    CreateCommand.Instance.Execute(currentControl);
2684
                                    currentControl = null;
2685
                                    this.MainAngle.Visibility = Visibility.Collapsed;
2686
                                }
2687
                                else
2688
                                {
2689
                                    currentControl = new LineControl
2736 2690
                                    {
2737
                                        currentControl = new LineControl
2738
                                        {
2739
                                            ControlType = ControlType.CancelLine,
2740
                                            StartPoint = new Point(canvasDrawingMouseDownPoint.X, canvasDrawingMouseDownPoint.Y),
2741
                                            Background = new SolidColorBrush(Colors.Black)
2742
                                        };
2691
                                        ControlType = this.controlType,
2692
                                        StartPoint = new Point(canvasDrawingMouseDownPoint.X, canvasDrawingMouseDownPoint.Y),
2693
                                        Background = new SolidColorBrush(Colors.Black)
2694
                                    };
2743 2695

  
2744
                                        currentControl.MarkupInfoID = App.Custom_ViewInfoId;
2745
                                        currentControl.CommentID = Commons.shortGuid();
2746
                                        currentControl.IsNew = true;
2747
                                        ViewerDataModel.Instance.MarkupControls_USER.Add(currentControl);
2748
                                        this.MainAngle.Visibility = Visibility.Visible;
2749
                                    }
2750
                                //}
2696
                                    currentControl.MarkupInfoID = App.Custom_ViewInfoId;
2697
                                    currentControl.CommentID = Commons.shortGuid();
2698
                                    currentControl.IsNew = true;
2699
                                    ViewerDataModel.Instance.MarkupControls_USER.Add(currentControl);
2700
                                    this.MainAngle.Visibility = Visibility.Visible;
2701
                                }
2751 2702
                            }
2752 2703
                        }
2753 2704
                        break;
2754
                    case ControlType.ArrowLine:
2705
                    case ControlType.PolygonControl:
2755 2706
                        {
2756
                            if (e.LeftButton == MouseButtonState.Pressed)
2707
                            if (currentControl is PolygonControl)
2757 2708
                            {
2758
                                //if (IsDrawingEnable(canvasZoomPanningMouseDownPoint))
2759
                                //{
2760
                                    if (currentControl is LineControl)
2761
                                    {
2762
                                        //20180906 LJY TEST IsRotationDrawingEnable
2763
                                        if (IsGetoutpoint((currentControl as LineControl).PointSet.Where(data => IsRotationDrawingEnable(data) == true).FirstOrDefault()))
2764
                                        {
2765
                                            return;
2766
                                        }
2709
                                var control = currentControl as PolygonControl;
2767 2710

  
2768
                                        CreateCommand.Instance.Execute(currentControl);
2711
                                if (e.RightButton == MouseButtonState.Pressed)
2712
                                {
2713
                                    control.IsCompleted = true;
2714
                                }
2769 2715

  
2770
                                        currentControl = null;
2771
                                        this.MainAngle.Visibility = Visibility.Collapsed;
2772
                                    }
2773
                                    else
2716
                                if (!control.IsCompleted)
2717
                                {
2718
                                    control.PointSet.Add(control.EndPoint);
2719
                                }
2720
                                else
2721
                                {
2722
                                    //20180906 LJY TEST IsRotationDrawingEnable
2723
                                    if (IsGetoutpoint((currentControl as PolygonControl).PointSet.Where(data => IsRotationDrawingEnable(data) == true).FirstOrDefault()))
2774 2724
                                    {
2775
                                        currentControl = new LineControl
2776
                                        {
2777
                                            ControlType = ControlType.ArrowLine,
2778
                                            StartPoint = new Point(canvasDrawingMouseDownPoint.X, canvasDrawingMouseDownPoint.Y),
2779
                                            Background = new SolidColorBrush(Colors.Black)
2780
                                        };
2781

  
2782
                                        currentControl.MarkupInfoID = App.Custom_ViewInfoId;
2783
                                        currentControl.CommentID = Commons.shortGuid();
2784
                                        currentControl.IsNew = true;
2785
                                        ViewerDataModel.Instance.MarkupControls_USER.Add(currentControl);
2786
                                        this.MainAngle.Visibility = Visibility.Visible;
2725
                                        return;
2787 2726
                                    }
2788
                                //}
2789
                            }
2790
                        }
2791
                        break;
2792
                    case ControlType.TwinLine:
2793
                        {
2794
                            if (e.LeftButton == MouseButtonState.Pressed)
2795
                            {
2796
                                //if (IsDrawingEnable(canvasZoomPanningMouseDownPoint))
2797
                                //{
2798
                                    if (currentControl is LineControl)
2799
                                    {
2800
                                        //20180906 LJY TEST IsRotationDrawingEnable
2801
                                        if (IsGetoutpoint((currentControl as LineControl).PointSet.Where(data => IsRotationDrawingEnable(data) == true).FirstOrDefault()))
2802
                                        {
2803
                                            return;
2804
                                        }
2805 2727

  
2806
                                        CreateCommand.Instance.Execute(currentControl);
2728
                                    var firstPoint = control.PointSet.First();
2729
                                    control.DashSize = ViewerDataModel.Instance.DashSize;
2730
                                    control.LineSize = ViewerDataModel.Instance.LineSize;
2731
                                    control.PointSet.Add(firstPoint);
2807 2732

  
2808
                                        currentControl = null;
2809
                                        this.MainAngle.Visibility = Visibility.Collapsed;
2810
                                    }
2811
                                    else
2812
                                    {
2813
                                        currentControl = new LineControl
2814
                                        {
2815
                                            ControlType = ControlType.TwinLine,
2816
                                            StartPoint = new Point(canvasDrawingMouseDownPoint.X, canvasDrawingMouseDownPoint.Y),
2817
                                            Background = new SolidColorBrush(Colors.Black)
2818
                                        };
2819
                                        currentControl.MarkupInfoID = App.Custom_ViewInfoId;
2820
                                        currentControl.CommentID = Commons.shortGuid();
2821
                                        currentControl.IsNew = true;
2822
                                        ViewerDataModel.Instance.MarkupControls_USER.Add(currentControl);
2823
                                        this.MainAngle.Visibility = Visibility.Visible;
2824
                                    }
2825
                                //}
2733
                                    control.ApplyOverViewData();
2734

  
2735
                                    CreateCommand.Instance.Execute(currentControl);
2736
                                    control.updateControl();
2737
                                    currentControl = null;
2738
                                }
2826 2739
                            }
2827
                        }
2828
                        break;
2829
                    case ControlType.DimLine:
2830
                        {
2831
                            if (e.LeftButton == MouseButtonState.Pressed)
2740
                            else
2832 2741
                            {
2833
                                //if (IsDrawingEnable(canvasZoomPanningMouseDownPoint))
2834
                                //{
2835
                                    if (currentControl is LineControl)
2742
                                if (e.LeftButton == MouseButtonState.Pressed)
2743
                                {
2744
                                    currentControl = new PolygonControl
2836 2745
                                    {
2837
                                        //20180906 LJY TEST IsRotationDrawingEnable
2838
                                        if (IsGetoutpoint((currentControl as LineControl).PointSet.Where(data => IsRotationDrawingEnable(data) == true).FirstOrDefault()))
2839
                                        {
2840
                                            return;
2841
                                        }
2842
                                        CreateCommand.Instance.Execute(currentControl);
2746
                                        PointSet = new List<Point>(),
2747
                                    };
2843 2748

  
2844
                                        currentControl = null;
2845
                                        this.MainAngle.Visibility = Visibility.Collapsed;
2846
                                    }
2847
                                    else
2848
                                    {
2849
                                        currentControl = new LineControl
2850
                                        {
2851
                                            ControlType = ControlType.DimLine,
2852
                                            StartPoint = new Point(canvasDrawingMouseDownPoint.X, canvasDrawingMouseDownPoint.Y),
2853
                                            Background = new SolidColorBrush(Colors.Black)
2854
                                        };
2855
                                        currentControl.MarkupInfoID = App.Custom_ViewInfoId;
2856
                                        currentControl.CommentID = Commons.shortGuid();
2857
                                        currentControl.IsNew = true;
2858
                                        ViewerDataModel.Instance.MarkupControls_USER.Add(currentControl);
2859
                                        this.MainAngle.Visibility = Visibility.Visible;
2860
                                    }
2861
                                //}
2749
                                    var polygonControl = (currentControl as PolygonControl);
2750
                                    currentControl.CommentID = Commons.shortGuid();
2751
                                    currentControl.IsNew = true;
2752
                                    currentControl.MarkupInfoID = App.Custom_ViewInfoId;
2753
                                    polygonControl.StartPoint = canvasDrawingMouseDownPoint;
2754
                                    polygonControl.EndPoint = canvasDrawingMouseDownPoint;
2755
                                    polygonControl.PointSet.Add(canvasDrawingMouseDownPoint);
2756
                                    polygonControl.PointSet.Add(canvasDrawingMouseDownPoint);
2757
                                    ViewerDataModel.Instance.MarkupControls_USER.Add(currentControl);
2758
                                    polygonControl.ApplyTemplate();
2759
                                    polygonControl.Visibility = Visibility.Visible;
2760
                                }
2862 2761
                            }
2863 2762
                        }
2864 2763
                        break;
......
2925 2824
                        {
2926 2825
                            if (e.LeftButton == MouseButtonState.Pressed)
2927 2826
                            {
2928
                                //if (IsDrawingEnable(canvasZoomPanningMouseDownPoint))
2929
                                //{
2930
                                    if (currentControl is ArcControl)
2827
                                if (currentControl is ArcControl)
2828
                                {
2829
                                    //20180906 LJY TEST IsRotationDrawingEnable
2830
                                    if (IsGetoutpoint((currentControl as ArcControl).PointSet.Where(data => IsRotationDrawingEnable(data) == true).FirstOrDefault()))
2931 2831
                                    {
2932
                                        //20180906 LJY TEST IsRotationDrawingEnable
2933
                                        if (IsGetoutpoint((currentControl as ArcControl).PointSet.Where(data => IsRotationDrawingEnable(data) == true).FirstOrDefault()))
2934
                                        {
2935
                                            return;
2936
                                        }
2832
                                        return;
2833
                                    }
2937 2834

  
2938
                                        CreateCommand.Instance.Execute(currentControl);
2835
                                    CreateCommand.Instance.Execute(currentControl);
2939 2836

  
2940
                                        currentControl = null;
2941
                                        this.MainAngle.Visibility = Visibility.Collapsed;
2942
                                    }
2943
                                    else
2837
                                    currentControl = null;
2838
                                    this.MainAngle.Visibility = Visibility.Collapsed;
2839
                                }
2840
                                else
2841
                                {
2842
                                    currentControl = new ArcControl
2944 2843
                                    {
2945
                                        currentControl = new ArcControl
2946
                                        {
2947
                                            StartPoint = new Point(canvasDrawingMouseDownPoint.X, canvasDrawingMouseDownPoint.Y),
2948
                                            Background = new SolidColorBrush(Colors.Black)
2949
                                        };
2950
                                        currentControl.CommentID = Commons.shortGuid();
2951
                                        currentControl.MarkupInfoID = App.Custom_ViewInfoId;
2952
                                        currentControl.IsNew = true;
2953
                                        ViewerDataModel.Instance.MarkupControls_USER.Add(currentControl);
2954
                                        this.MainAngle.Visibility = Visibility.Visible;
2955
                                    }
2956
                                //}
2844
                                        StartPoint = new Point(canvasDrawingMouseDownPoint.X, canvasDrawingMouseDownPoint.Y),
2845
                                        Background = new SolidColorBrush(Colors.Black)
2846
                                    };
2847
                                    currentControl.CommentID = Commons.shortGuid();
2848
                                    currentControl.MarkupInfoID = App.Custom_ViewInfoId;
2849
                                    currentControl.IsNew = true;
2850
                                    ViewerDataModel.Instance.MarkupControls_USER.Add(currentControl);
2851
                                    this.MainAngle.Visibility = Visibility.Visible;
2852
                                }
2957 2853
                            }
2958 2854
                            else if (e.RightButton == MouseButtonState.Pressed)
2959 2855
                            {
......
2961 2857
                                {
2962 2858
                                    (currentControl as ArcControl).setClock();
2963 2859
                                    (currentControl as ArcControl).MidPoint = new Point(0, 0);
2964
                                    //(currentControl as ArcControl).ApplyTemplate();
2965 2860
                                }
2966 2861
                            }
2967 2862
                        }
......
3266 3161
                                    (currentControl as TextControl).ApplyTemplate();
3267 3162
                                    (currentControl as TextControl).Base_TextBox.Focus();
3268 3163

  
3269
                                    //System.Diagnostics.Debug.WriteLine("CanvasX" + (currentControl as TextControl).CanvasX);
3270
                                    //System.Diagnostics.Debug.WriteLine("CanvasY" + (currentControl as TextControl).CanvasY);
3271

  
3272 3164
                                    CreateCommand.Instance.Execute(currentControl);
3273

  
3274 3165
                                }
3275 3166
                            }
3276 3167
                        }
......
3301 3192
                                    (currentControl as TextControl).ApplyTemplate();
3302 3193
                                    (currentControl as TextControl).Base_TextBox.Focus();
3303 3194
                                    CreateCommand.Instance.Execute(currentControl);
3304

  
3305
                                    //currentControl = null;
3306 3195
                                }
3307 3196
                            }
3308 3197
                        }
......
3635 3524
                            }
3636 3525
                        }
3637 3526
                        break;
3638
                    case ControlType.PolygonControl:
3639
                        {
3640
                            if (currentControl is PolygonControl)
3641
                            {
3642
                                var control = currentControl as PolygonControl;
3643

  
3644
                                if (e.RightButton == MouseButtonState.Pressed)
3645
                                {
3646
                                    control.IsCompleted = true;
3647
                                }
3648

  
3649
                                if (!control.IsCompleted)
3650
                                {
3651
                                    control.PointSet.Add(control.EndPoint);
3652
                                }
3653
                                else
3654
                                {
3655
                                    //20180906 LJY TEST IsRotationDrawingEnable
3656
                                    if (IsGetoutpoint((currentControl as PolygonControl).PointSet.Where(data => IsRotationDrawingEnable(data) == true).FirstOrDefault()))
3657
                                    {
3658
                                        return;
3659
                                    }
3660

  
3661
                                    var firstPoint = control.PointSet.First();
3662
                                    control.DashSize = ViewerDataModel.Instance.DashSize;
3663
                                    control.LineSize = ViewerDataModel.Instance.LineSize;
3664
                                    control.PointSet.Add(firstPoint);
3665

  
3666
                                    control.ApplyOverViewData();
3667

  
3668
                                    CreateCommand.Instance.Execute(currentControl);
3669
                                    control.updateControl();
3670
                                    currentControl = null;
3671
                                }
3672
                            }
3673
                            else
3674
                            {
3675
                                if (e.LeftButton == MouseButtonState.Pressed)
3676
                                {
3677
                                    currentControl = new PolygonControl
3678
                                    {
3679
                                        PointSet = new List<Point>(),
3680
                                    };
3681

  
3682
                                    var polygonControl = (currentControl as PolygonControl);
3683
                                    currentControl.CommentID = Commons.shortGuid();
3684
                                    currentControl.IsNew = true;
3685
                                    currentControl.MarkupInfoID = App.Custom_ViewInfoId;
3686
                                    polygonControl.StartPoint = canvasDrawingMouseDownPoint;
3687
                                    polygonControl.EndPoint = canvasDrawingMouseDownPoint;
3688
                                    polygonControl.PointSet.Add(canvasDrawingMouseDownPoint);
3689
                                    polygonControl.PointSet.Add(canvasDrawingMouseDownPoint);
3690
                                    ViewerDataModel.Instance.MarkupControls_USER.Add(currentControl);
3691
                                    polygonControl.ApplyTemplate();
3692
                                    polygonControl.Visibility = Visibility.Visible;
3693
                                }
3694
                            }
3695
                        }
3696
                        break;
3697 3527
                    //강인구 추가
3698 3528
                    case ControlType.Sign:
3699 3529
                        {

내보내기 Unified diff

클립보드 이미지 추가 (최대 크기: 500 MB)