개정판 ca40e004
issue #650 rotating modify
KCOM/Views/MainMenu.xaml.cs | ||
---|---|---|
235 | 235 |
private bool IsDrawingEnable(Point _canvasZoomPanningMouseDownPoint) |
236 | 236 |
{ |
237 | 237 |
if ((_canvasZoomPanningMouseDownPoint.X > 0 && |
238 |
zoomAndPanCanvas.ActualWidth > _canvasZoomPanningMouseDownPoint.X) &&
|
|
239 |
(_canvasZoomPanningMouseDownPoint.Y > 0 &&
|
|
240 |
zoomAndPanCanvas.ActualHeight > _canvasZoomPanningMouseDownPoint.Y))
|
|
238 |
zoomAndPanCanvas.ActualWidth > _canvasZoomPanningMouseDownPoint.X) && |
|
239 |
(_canvasZoomPanningMouseDownPoint.Y > 0 && |
|
240 |
zoomAndPanCanvas.ActualHeight > _canvasZoomPanningMouseDownPoint.Y)) |
|
241 | 241 |
{ |
242 | 242 |
return true; |
243 | 243 |
} |
... | ... | |
245 | 245 |
return false; |
246 | 246 |
} |
247 | 247 |
|
248 |
private bool IsRotationDrawingEnable(Point _canvasZoomPanningMouseDownPoint) |
|
249 |
{ |
|
250 |
if (rotate.Angle == 90 || rotate.Angle == 270) |
|
251 |
{ |
|
252 |
if ((_canvasZoomPanningMouseDownPoint.X > 0 && |
|
253 |
zoomAndPanCanvas.ActualHeight > _canvasZoomPanningMouseDownPoint.X) && |
|
254 |
(_canvasZoomPanningMouseDownPoint.Y > 0 && |
|
255 |
zoomAndPanCanvas.ActualWidth > _canvasZoomPanningMouseDownPoint.Y)) |
|
256 |
{ |
|
257 |
return true; |
|
258 |
} |
|
259 |
} |
|
260 |
else |
|
261 |
{ |
|
262 |
if ((_canvasZoomPanningMouseDownPoint.X > 0 && |
|
263 |
zoomAndPanCanvas.ActualWidth > _canvasZoomPanningMouseDownPoint.X) && |
|
264 |
(_canvasZoomPanningMouseDownPoint.Y > 0 && |
|
265 |
zoomAndPanCanvas.ActualHeight > _canvasZoomPanningMouseDownPoint.Y)) |
|
266 |
{ |
|
267 |
return true; |
|
268 |
} |
|
269 |
} |
|
270 |
|
|
271 |
return false; |
|
272 |
} |
|
273 |
|
|
248 | 274 |
public void DeleteItem(MarkupInfoItem item) |
249 | 275 |
{ |
250 | 276 |
if (PreviewUserMarkupInfoItem != null && item.Consolidate == 1 && item.AvoidConsolidate == 0) |
... | ... | |
998 | 1024 |
if (!floatingTip.IsOpen) { floatingTip.IsOpen = true; } |
999 | 1025 |
|
1000 | 1026 |
Point currentPos = e.GetPosition(rect); |
1001 |
|
|
1027 |
|
|
1002 | 1028 |
floatingTip.HorizontalOffset = currentPos.X + 20; |
1003 | 1029 |
floatingTip.VerticalOffset = currentPos.Y; |
1004 | 1030 |
|
... | ... | |
2723 | 2749 |
ViewerDataModel.Instance.AngleOffsetX = translate.X; |
2724 | 2750 |
ViewerDataModel.Instance.AngleOffsetY = translate.Y; |
2725 | 2751 |
ViewerDataModel.Instance.Angle = rotate.Angle; |
2726 |
|
|
2727 |
|
|
2728 | 2752 |
} |
2729 | 2753 |
|
2730 | 2754 |
private void zoomAndPanControl_MouseDown(object sender, MouseButtonEventArgs e) |
... | ... | |
2777 | 2801 |
} |
2778 | 2802 |
} |
2779 | 2803 |
|
2780 |
double Ang = 0; |
|
2804 |
double Ang = 0;
|
|
2781 | 2805 |
if (rotate.Angle != 0) |
2782 | 2806 |
{ |
2783 | 2807 |
Ang = 360 - rotate.Angle; |
... | ... | |
3076 | 3100 |
Markup_List = new List<Multi_Undo_data>() |
3077 | 3101 |
}; |
3078 | 3102 |
|
3079 |
switch (controlType) |
|
3103 |
switch (controlType)
|
|
3080 | 3104 |
{ |
3081 | 3105 |
case ControlType.Rectangle: |
3082 | 3106 |
{ |
... | ... | |
3086 | 3110 |
//{ |
3087 | 3111 |
if (currentControl is RectangleControl) |
3088 | 3112 |
{ |
3089 |
if(IsGetoutpoint((currentControl as RectangleControl).PointSet.Where(data => IsDrawingEnable(data) == true).FirstOrDefault())) |
|
3113 |
//20180906 LJY TEST IsRotationDrawingEnable |
|
3114 |
if (IsGetoutpoint((currentControl as RectangleControl).PointSet.Where(data => IsRotationDrawingEnable(data) == true).FirstOrDefault())) |
|
3090 | 3115 |
{ |
3091 | 3116 |
return; |
3092 | 3117 |
} |
... | ... | |
3124 | 3149 |
//{ |
3125 | 3150 |
if (currentControl is RectCloudControl) |
3126 | 3151 |
{ |
3127 |
if (IsGetoutpoint((currentControl as RectCloudControl).PointSet.Where(data => IsDrawingEnable(data) == true).FirstOrDefault())) |
|
3152 |
//20180906 LJY TEST IsRotationDrawingEnable |
|
3153 |
if (IsGetoutpoint((currentControl as RectCloudControl).PointSet.Where(data => IsRotationDrawingEnable(data) == true).FirstOrDefault())) |
|
3128 | 3154 |
{ |
3129 | 3155 |
return; |
3130 | 3156 |
} |
... | ... | |
3159 | 3185 |
//{ |
3160 | 3186 |
if (currentControl is CircleControl) |
3161 | 3187 |
{ |
3162 |
if (IsGetoutpoint((currentControl as CircleControl).PointSet.Where(data => IsDrawingEnable(data) == true).FirstOrDefault())) |
|
3188 |
//20180906 LJY TEST IsRotationDrawingEnable |
|
3189 |
if (IsGetoutpoint((currentControl as CircleControl).PointSet.Where(data => IsRotationDrawingEnable(data) == true).FirstOrDefault())) |
|
3163 | 3190 |
{ |
3164 | 3191 |
return; |
3165 | 3192 |
} |
... | ... | |
3200 | 3227 |
} |
3201 | 3228 |
else |
3202 | 3229 |
{ |
3203 |
if (IsGetoutpoint((currentControl as TriControl).PointSet.Where(data => IsDrawingEnable(data) == true).FirstOrDefault())) |
|
3230 |
//20180906 LJY TEST IsRotationDrawingEnable |
|
3231 |
if (IsGetoutpoint((currentControl as TriControl).PointSet.Where(data => IsRotationDrawingEnable(data) == true).FirstOrDefault())) |
|
3204 | 3232 |
{ |
3205 | 3233 |
return; |
3206 | 3234 |
} |
... | ... | |
3236 | 3264 |
//{ |
3237 | 3265 |
if (currentControl is LineControl) |
3238 | 3266 |
{ |
3239 |
if (IsGetoutpoint((currentControl as LineControl).PointSet.Where(data => IsDrawingEnable(data) == true).FirstOrDefault())) |
|
3267 |
//20180906 LJY TEST IsRotationDrawingEnable |
|
3268 |
if (IsGetoutpoint((currentControl as LineControl).PointSet.Where(data => IsRotationDrawingEnable(data) == true).FirstOrDefault())) |
|
3240 | 3269 |
{ |
3241 | 3270 |
return; |
3242 | 3271 |
} |
... | ... | |
3272 | 3301 |
//{ |
3273 | 3302 |
if (currentControl is LineControl) |
3274 | 3303 |
{ |
3275 |
if (IsGetoutpoint((currentControl as LineControl).PointSet.Where(data => IsDrawingEnable(data) == true).FirstOrDefault())) |
|
3304 |
//20180906 LJY TEST IsRotationDrawingEnable |
|
3305 |
if (IsGetoutpoint((currentControl as LineControl).PointSet.Where(data => IsRotationDrawingEnable(data) == true).FirstOrDefault())) |
|
3276 | 3306 |
{ |
3277 | 3307 |
return; |
3278 | 3308 |
} |
... | ... | |
3308 | 3338 |
//{ |
3309 | 3339 |
if (currentControl is LineControl) |
3310 | 3340 |
{ |
3311 |
if (IsGetoutpoint((currentControl as LineControl).PointSet.Where(data => IsDrawingEnable(data) == true).FirstOrDefault())) |
|
3341 |
//20180906 LJY TEST IsRotationDrawingEnable |
|
3342 |
if (IsGetoutpoint((currentControl as LineControl).PointSet.Where(data => IsRotationDrawingEnable(data) == true).FirstOrDefault())) |
|
3312 | 3343 |
{ |
3313 | 3344 |
return; |
3314 | 3345 |
} |
... | ... | |
3344 | 3375 |
//{ |
3345 | 3376 |
if (currentControl is LineControl) |
3346 | 3377 |
{ |
3347 |
if (IsGetoutpoint((currentControl as LineControl).PointSet.Where(data => IsDrawingEnable(data) == true).FirstOrDefault())) |
|
3378 |
//20180906 LJY TEST IsRotationDrawingEnable |
|
3379 |
if (IsGetoutpoint((currentControl as LineControl).PointSet.Where(data => IsRotationDrawingEnable(data) == true).FirstOrDefault())) |
|
3348 | 3380 |
{ |
3349 | 3381 |
return; |
3350 | 3382 |
} |
... | ... | |
3379 | 3411 |
//{ |
3380 | 3412 |
if (currentControl is LineControl) |
3381 | 3413 |
{ |
3382 |
if (IsGetoutpoint((currentControl as LineControl).PointSet.Where(data => IsDrawingEnable(data) == true).FirstOrDefault())) |
|
3414 |
//20180906 LJY TEST IsRotationDrawingEnable |
|
3415 |
if (IsGetoutpoint((currentControl as LineControl).PointSet.Where(data => IsRotationDrawingEnable(data) == true).FirstOrDefault())) |
|
3383 | 3416 |
{ |
3384 | 3417 |
return; |
3385 | 3418 |
} |
... | ... | |
3413 | 3446 |
|
3414 | 3447 |
if (mouseButtonDown == MouseButton.Right) |
3415 | 3448 |
{ |
3416 |
if (IsGetoutpoint((currentControl as PolygonControl).PointSet.Where(data => IsDrawingEnable(data) == true).FirstOrDefault())) |
|
3449 |
//20180906 LJY TEST IsRotationDrawingEnable |
|
3450 |
if (IsGetoutpoint((currentControl as PolygonControl).PointSet.Where(data => IsRotationDrawingEnable(data) == true).FirstOrDefault())) |
|
3417 | 3451 |
{ |
3418 | 3452 |
return; |
3419 | 3453 |
} |
... | ... | |
3472 | 3506 |
//{ |
3473 | 3507 |
if (currentControl is ArcControl) |
3474 | 3508 |
{ |
3475 |
if (IsGetoutpoint((currentControl as ArcControl).PointSet.Where(data => IsDrawingEnable(data) == true).FirstOrDefault())) |
|
3509 |
//20180906 LJY TEST IsRotationDrawingEnable |
|
3510 |
if (IsGetoutpoint((currentControl as ArcControl).PointSet.Where(data => IsRotationDrawingEnable(data) == true).FirstOrDefault())) |
|
3476 | 3511 |
{ |
3477 | 3512 |
return; |
3478 | 3513 |
} |
... | ... | |
3516 | 3551 |
//{ |
3517 | 3552 |
if (currentControl is ArcControl) |
3518 | 3553 |
{ |
3519 |
if (IsGetoutpoint((currentControl as ArcControl).PointSet.Where(data => IsDrawingEnable(data) == true).FirstOrDefault())) |
|
3554 |
//20180906 LJY TEST IsRotationDrawingEnable |
|
3555 |
if (IsGetoutpoint((currentControl as ArcControl).PointSet.Where(data => IsRotationDrawingEnable(data) == true).FirstOrDefault())) |
|
3520 | 3556 |
{ |
3521 | 3557 |
return; |
3522 | 3558 |
} |
... | ... | |
3571 | 3607 |
} |
3572 | 3608 |
else |
3573 | 3609 |
{ |
3574 |
if (IsGetoutpoint((currentControl as ArrowControl_Multi).PointSet.Where(data => IsDrawingEnable(data) == true).FirstOrDefault())) |
|
3610 |
//20180906 LJY TEST IsRotationDrawingEnable |
|
3611 |
if (IsGetoutpoint((currentControl as ArrowControl_Multi).PointSet.Where(data => IsRotationDrawingEnable(data) == true).FirstOrDefault())) |
|
3575 | 3612 |
{ |
3576 | 3613 |
return; |
3577 | 3614 |
} |
... | ... | |
3616 | 3653 |
} |
3617 | 3654 |
else |
3618 | 3655 |
{ |
3619 |
if (IsGetoutpoint((currentControl as CloudControl).PointSet.Where(data => IsDrawingEnable(data) == true).FirstOrDefault())) |
|
3656 |
//20180906 LJY TEST IsRotationDrawingEnable |
|
3657 |
if (IsGetoutpoint((currentControl as CloudControl).PointSet.Where(data => IsRotationDrawingEnable(data) == true).FirstOrDefault())) |
|
3620 | 3658 |
{ |
3621 | 3659 |
return; |
3622 | 3660 |
} |
... | ... | |
3666 | 3704 |
//{ |
3667 | 3705 |
if (currentControl is ImgControl) |
3668 | 3706 |
{ |
3669 |
if (IsGetoutpoint((currentControl as ImgControl).PointSet.Where(data => IsDrawingEnable(data) == true).FirstOrDefault())) |
|
3707 |
//20180906 LJY TEST IsRotationDrawingEnable |
|
3708 |
if (IsGetoutpoint((currentControl as ImgControl).PointSet.Where(data => IsRotationDrawingEnable(data) == true).FirstOrDefault())) |
|
3670 | 3709 |
{ |
3671 | 3710 |
return; |
3672 | 3711 |
} |
... | ... | |
3700 | 3739 |
currentControl.MarkupInfoID = App.Custom_ViewInfoId; |
3701 | 3740 |
currentControl.IsNew = true; |
3702 | 3741 |
ViewerDataModel.Instance.MarkupControls_USER.Add(currentControl); |
3703 |
} |
|
3742 |
|
|
3743 |
//20180903 LJY 회전된 방향으로 화면에 출력되지 않는 문제 수정 |
|
3744 |
(currentControl as ImgControl).Angle -= rotate.Angle; |
|
3745 |
} |
|
3704 | 3746 |
} |
3705 | 3747 |
//} |
3706 | 3748 |
} |
... | ... | |
3714 | 3756 |
//{ |
3715 | 3757 |
if (currentControl is DateControl) |
3716 | 3758 |
{ |
3717 |
if (IsGetoutpoint((currentControl as DateControl).PointSet.Where(data => IsDrawingEnable(data) == true).FirstOrDefault())) |
|
3759 |
//20180906 LJY TEST IsRotationDrawingEnable |
|
3760 |
if (IsGetoutpoint((currentControl as DateControl).PointSet.Where(data => IsRotationDrawingEnable(data) == true).FirstOrDefault())) |
|
3718 | 3761 |
{ |
3719 | 3762 |
return; |
3720 | 3763 |
} |
... | ... | |
3745 | 3788 |
currentControl.MarkupInfoID = App.Custom_ViewInfoId; |
3746 | 3789 |
currentControl.IsNew = true; |
3747 | 3790 |
ViewerDataModel.Instance.MarkupControls_USER.Add(currentControl); |
3748 |
} |
|
3791 |
|
|
3792 |
//20180903 LJY 회전된 방향으로 화면에 출력되지 않는 문제 수정 |
|
3793 |
(currentControl as DateControl).Angle -= rotate.Angle; |
|
3794 |
} |
|
3749 | 3795 |
//} |
3750 | 3796 |
} |
3751 | 3797 |
} |
... | ... | |
3844 | 3890 |
} |
3845 | 3891 |
break; |
3846 | 3892 |
case ControlType.ArrowTextControl: |
3847 |
{ |
|
3893 |
{
|
|
3848 | 3894 |
if (mouseButtonDown == MouseButton.Left) |
3849 | 3895 |
{ |
3850 | 3896 |
if (currentControl is ArrowTextControl) |
3851 | 3897 |
{ |
3852 |
if (IsGetoutpoint((currentControl as ArrowTextControl).PointSet.Where(data => IsDrawingEnable(data) == true).FirstOrDefault())) |
|
3898 |
//20180906 LJY TEST IsRotationDrawingEnable |
|
3899 |
if (IsGetoutpoint((currentControl as ArrowTextControl).PointSet.Where(data => IsRotationDrawingEnable(data) == true).FirstOrDefault())) |
|
3853 | 3900 |
{ |
3854 | 3901 |
return; |
3855 |
} |
|
3902 |
}
|
|
3856 | 3903 |
|
3857 | 3904 |
CreateControl(); |
3858 | 3905 |
|
... | ... | |
3861 | 3908 |
(currentControl as ArrowTextControl).EnableEditing = false; |
3862 | 3909 |
(currentControl as ArrowTextControl).IsNew = false; |
3863 | 3910 |
currentControl = null; |
3864 |
this.MainAngle.Visibility = Visibility.Collapsed; |
|
3865 | 3911 |
} |
3866 | 3912 |
else |
3867 | 3913 |
{ |
... | ... | |
3874 | 3920 |
ViewerDataModel.Instance.MarkupControls_USER.Add(currentControl); |
3875 | 3921 |
|
3876 | 3922 |
currentControl.SetValue(Canvas.ZIndexProperty, 3); |
3877 |
|
|
3878 | 3923 |
currentControl.SetValue(ArrowTextControl.StartPointProperty, canvasDrawingMouseDownPoint); |
3879 |
|
|
3880 | 3924 |
currentControl.SetValue(ArrowTextControl.EndPointProperty, canvasDrawingMouseDownPoint); |
3881 |
|
|
3882 | 3925 |
(currentControl as ArrowTextControl).TextSize = ViewerDataModel.Instance.TextSize; |
3883 | 3926 |
(currentControl as ArrowTextControl).isHighLight = ViewerDataModel.Instance.checkHighShape; |
3884 | 3927 |
|
3885 |
(currentControl as ArrowTextControl).ApplyTemplate(); |
|
3928 |
//20180903 LJY 회전된 방향으로 화면에 출력되지 않는 문제 수정 |
|
3929 |
(currentControl as ArrowTextControl).Angle -= rotate.Angle; |
|
3886 | 3930 |
|
3931 |
(currentControl as ArrowTextControl).ApplyTemplate(); |
|
3887 | 3932 |
(currentControl as ArrowTextControl).Base_TextBox.Focus(); |
3888 | 3933 |
this.MainAngle.Visibility = Visibility.Visible; |
3934 |
|
|
3935 |
|
|
3889 | 3936 |
//} |
3890 | 3937 |
} |
3891 | 3938 |
} |
... | ... | |
3897 | 3944 |
{ |
3898 | 3945 |
if (currentControl is ArrowTextControl) |
3899 | 3946 |
{ |
3900 |
if (IsGetoutpoint((currentControl as ArrowTextControl).PointSet.Where(data => IsDrawingEnable(data) == true).FirstOrDefault())) |
|
3947 |
//20180906 LJY TEST IsRotationDrawingEnable |
|
3948 |
if (IsGetoutpoint((currentControl as ArrowTextControl).PointSet.Where(data => IsRotationDrawingEnable(data) == true).FirstOrDefault())) |
|
3901 | 3949 |
{ |
3902 | 3950 |
return; |
3903 |
} |
|
3951 |
}
|
|
3904 | 3952 |
|
3905 | 3953 |
CreateControl(); |
3906 | 3954 |
(currentControl as ArrowTextControl).Base_TextBox.IsHitTestVisible = false; |
... | ... | |
3912 | 3960 |
{ |
3913 | 3961 |
//if (IsDrawingEnable(canvasZoomPanningMouseDownPoint)) |
3914 | 3962 |
//{ |
3915 |
currentControl = new ArrowTextControl(); |
|
3963 |
currentControl = new ArrowTextControl();
|
|
3916 | 3964 |
currentControl.CommentID = Save.shortGuid(); |
3917 | 3965 |
currentControl.IsNew = true; |
3918 | 3966 |
currentControl.MarkupInfoID = App.Custom_ViewInfoId; |
3919 | 3967 |
ViewerDataModel.Instance.MarkupControls_USER.Add(currentControl); |
3920 |
|
|
3921 | 3968 |
currentControl.SetValue(Canvas.ZIndexProperty, 3); |
3922 |
|
|
3923 | 3969 |
currentControl.SetValue(ArrowTextControl.StartPointProperty, canvasDrawingMouseDownPoint); |
3924 |
|
|
3925 |
currentControl.SetValue(ArrowTextControl.EndPointProperty, canvasDrawingMouseDownPoint); |
|
3926 |
|
|
3927 |
(currentControl as ArrowTextControl).ApplyTemplate(); |
|
3970 |
currentControl.SetValue(ArrowTextControl.EndPointProperty, canvasDrawingMouseDownPoint); |
|
3928 | 3971 |
(currentControl as ArrowTextControl).TextSize = ViewerDataModel.Instance.TextSize; |
3929 | 3972 |
(currentControl as ArrowTextControl).isFixed = true; |
3930 | 3973 |
(currentControl as ArrowTextControl).isHighLight = ViewerDataModel.Instance.checkHighShape; |
3931 | 3974 |
|
3975 |
//20180903 LJY 회전된 방향으로 화면에 출력되지 않는 문제 수정 |
|
3976 |
(currentControl as ArrowTextControl).Angle -= rotate.Angle; |
|
3977 |
|
|
3978 |
(currentControl as ArrowTextControl).ApplyTemplate(); |
|
3932 | 3979 |
(currentControl as ArrowTextControl).Base_TextBox.Focus(); |
3933 |
this.MainAngle.Visibility = Visibility.Visible; |
|
3934 |
//} |
|
3980 |
(currentControl as ArrowTextControl).isTrans = true; |
|
3935 | 3981 |
} |
3936 | 3982 |
} |
3937 | 3983 |
} |
3938 | 3984 |
break; |
3939 | 3985 |
case ControlType.ArrowTextBorderControl: |
3940 |
{ |
|
3986 |
{
|
|
3941 | 3987 |
if (mouseButtonDown == MouseButton.Left) |
3942 | 3988 |
{ |
3943 | 3989 |
if (currentControl is ArrowTextControl) |
3944 | 3990 |
{ |
3945 |
if (IsGetoutpoint((currentControl as ArrowTextControl).PointSet.Where(data => IsDrawingEnable(data) == true).FirstOrDefault())) |
|
3991 |
//20180906 LJY TEST IsRotationDrawingEnable |
|
3992 |
if (IsGetoutpoint((currentControl as ArrowTextControl).PointSet.Where(data => IsRotationDrawingEnable(data) == true).FirstOrDefault())) |
|
3946 | 3993 |
{ |
3947 | 3994 |
return; |
3948 | 3995 |
} |
... | ... | |
3973 | 4020 |
currentControl.SetValue(ArrowTextControl.EndPointProperty, canvasDrawingMouseDownPoint); |
3974 | 4021 |
(currentControl as ArrowTextControl).isHighLight = ViewerDataModel.Instance.checkHighShape; |
3975 | 4022 |
(currentControl as ArrowTextControl).TextSize = ViewerDataModel.Instance.TextSize; |
3976 |
(currentControl as ArrowTextControl).ApplyTemplate(); |
|
3977 | 4023 |
|
4024 |
//20180903 LJY 회전된 방향으로 화면에 출력되지 않는 문제 수정 |
|
4025 |
(currentControl as ArrowTextControl).Angle -= rotate.Angle; |
|
4026 |
(currentControl as ArrowTextControl).ApplyTemplate(); |
|
3978 | 4027 |
(currentControl as ArrowTextControl).Base_TextBox.Focus(); |
3979 |
this.MainAngle.Visibility = Visibility.Visible; |
|
4028 |
this.MainAngle.Visibility = Visibility.Visible;
|
|
3980 | 4029 |
//} |
3981 | 4030 |
} |
3982 | 4031 |
} |
... | ... | |
3988 | 4037 |
{ |
3989 | 4038 |
if (currentControl is ArrowTextControl) |
3990 | 4039 |
{ |
3991 |
if (IsGetoutpoint((currentControl as ArrowTextControl).PointSet.Where(data => IsDrawingEnable(data) == true).FirstOrDefault())) |
|
4040 |
//20180906 LJY TEST IsRotationDrawingEnable |
|
4041 |
if (IsGetoutpoint((currentControl as ArrowTextControl).PointSet.Where(data => IsRotationDrawingEnable(data) == true).FirstOrDefault())) |
|
3992 | 4042 |
{ |
3993 | 4043 |
return; |
3994 | 4044 |
} |
... | ... | |
4002 | 4052 |
{ |
4003 | 4053 |
//if (IsDrawingEnable(canvasZoomPanningMouseDownPoint)) |
4004 | 4054 |
//{ |
4005 |
currentControl = new ArrowTextControl() |
|
4055 |
|
|
4056 |
|
|
4057 |
currentControl = new ArrowTextControl() |
|
4006 | 4058 |
{ |
4007 | 4059 |
ArrowTextStyle = MarkupToPDF.Controls.Text.ArrowTextControl.ArrowTextStyleSet.Rect |
4008 | 4060 |
}; |
... | ... | |
4014 | 4066 |
currentControl.SetValue(Canvas.ZIndexProperty, 3); |
4015 | 4067 |
|
4016 | 4068 |
currentControl.SetValue(ArrowTextControl.StartPointProperty, canvasDrawingMouseDownPoint); |
4017 |
|
|
4018 |
currentControl.SetValue(ArrowTextControl.EndPointProperty, canvasDrawingMouseDownPoint); |
|
4069 |
currentControl.SetValue(ArrowTextControl.EndPointProperty, canvasDrawingMouseDownPoint); |
|
4019 | 4070 |
(currentControl as ArrowTextControl).TextSize = ViewerDataModel.Instance.TextSize; |
4020 | 4071 |
(currentControl as ArrowTextControl).isFixed = true; |
4021 | 4072 |
(currentControl as ArrowTextControl).isHighLight = ViewerDataModel.Instance.checkHighShape; |
4022 |
|
|
4073 |
|
|
4074 |
//20180903 LJY 회전된 방향으로 화면에 출력되지 않는 문제 수정 |
|
4075 |
(currentControl as ArrowTextControl).Angle -= rotate.Angle; |
|
4023 | 4076 |
(currentControl as ArrowTextControl).ApplyTemplate(); |
4024 | 4077 |
|
4025 |
(currentControl as ArrowTextControl).Base_TextBox.Focus(); |
|
4078 |
(currentControl as ArrowTextControl).Base_TextBox.Focus();
|
|
4026 | 4079 |
this.MainAngle.Visibility = Visibility.Visible; |
4080 |
|
|
4081 |
//20180911 LJY |
|
4082 |
(currentControl as ArrowTextControl).isTrans = true; |
|
4083 |
|
|
4084 |
|
|
4027 | 4085 |
//} |
4028 | 4086 |
} |
4029 | 4087 |
} |
... | ... | |
4035 | 4093 |
{ |
4036 | 4094 |
if (currentControl is ArrowTextControl) |
4037 | 4095 |
{ |
4038 |
if (IsGetoutpoint((currentControl as ArrowTextControl).PointSet.Where(data => IsDrawingEnable(data) == true).FirstOrDefault())) |
|
4096 |
//20180906 LJY TEST IsRotationDrawingEnable |
|
4097 |
if (IsGetoutpoint((currentControl as ArrowTextControl).PointSet.Where(data => IsRotationDrawingEnable(data) == true).FirstOrDefault())) |
|
4039 | 4098 |
{ |
4040 | 4099 |
return; |
4041 | 4100 |
} |
... | ... | |
4059 | 4118 |
ViewerDataModel.Instance.MarkupControls_USER.Add(currentControl); |
4060 | 4119 |
|
4061 | 4120 |
currentControl.SetValue(Canvas.ZIndexProperty, 3); |
4062 |
|
|
4063 | 4121 |
currentControl.SetValue(ArrowTextControl.StartPointProperty, canvasDrawingMouseDownPoint); |
4064 |
currentControl.SetValue(ArrowTextControl.EndPointProperty, canvasDrawingMouseDownPoint); |
|
4122 |
currentControl.SetValue(ArrowTextControl.EndPointProperty, canvasDrawingMouseDownPoint);
|
|
4065 | 4123 |
(currentControl as ArrowTextControl).TextSize = ViewerDataModel.Instance.TextSize; |
4066 | 4124 |
(currentControl as ArrowTextControl).isHighLight = ViewerDataModel.Instance.checkHighShape; |
4067 |
(currentControl as ArrowTextControl).ApplyTemplate(); |
|
4068 | 4125 |
|
4126 |
//20180903 LJY 회전된 방향으로 화면에 출력되지 않는 문제 수정 |
|
4127 |
(currentControl as ArrowTextControl).Angle -= rotate.Angle; |
|
4128 |
|
|
4129 |
(currentControl as ArrowTextControl).ApplyTemplate(); |
|
4069 | 4130 |
(currentControl as ArrowTextControl).Base_TextBox.Focus(); |
4070 |
this.MainAngle.Visibility = Visibility.Visible; |
|
4131 |
this.MainAngle.Visibility = Visibility.Visible;
|
|
4071 | 4132 |
//} |
4072 | 4133 |
} |
4073 | 4134 |
} |
... | ... | |
4079 | 4140 |
{ |
4080 | 4141 |
if (currentControl is ArrowTextControl) |
4081 | 4142 |
{ |
4082 |
if (IsGetoutpoint((currentControl as ArrowTextControl).PointSet.Where(data => IsDrawingEnable(data) == true).FirstOrDefault())) |
|
4143 |
//20180906 LJY TEST IsRotationDrawingEnable |
|
4144 |
if (IsGetoutpoint((currentControl as ArrowTextControl).PointSet.Where(data => IsRotationDrawingEnable(data) == true).FirstOrDefault())) |
|
4083 | 4145 |
{ |
4084 | 4146 |
return; |
4085 | 4147 |
} |
... | ... | |
4098 | 4160 |
ArrowTextStyle = MarkupToPDF.Controls.Text.ArrowTextControl.ArrowTextStyleSet.Cloud |
4099 | 4161 |
}; |
4100 | 4162 |
currentControl.CommentID = Save.shortGuid(); |
4101 |
currentControl.IsNew = true; |
|
4163 |
currentControl.IsNew = true;
|
|
4102 | 4164 |
currentControl.MarkupInfoID = App.Custom_ViewInfoId; |
4103 | 4165 |
ViewerDataModel.Instance.MarkupControls_USER.Add(currentControl); |
4104 |
|
|
4105 | 4166 |
currentControl.SetValue(Canvas.ZIndexProperty, 3); |
4106 | 4167 |
|
4107 | 4168 |
currentControl.SetValue(ArrowTextControl.StartPointProperty, canvasDrawingMouseDownPoint); |
4108 |
|
|
4109 |
currentControl.SetValue(ArrowTextControl.EndPointProperty, canvasDrawingMouseDownPoint); |
|
4169 |
currentControl.SetValue(ArrowTextControl.EndPointProperty, canvasDrawingMouseDownPoint); |
|
4110 | 4170 |
(currentControl as ArrowTextControl).TextSize = ViewerDataModel.Instance.TextSize; |
4111 | 4171 |
(currentControl as ArrowTextControl).isFixed = true; |
4112 | 4172 |
(currentControl as ArrowTextControl).isHighLight = ViewerDataModel.Instance.checkHighShape; |
4113 | 4173 |
|
4114 |
(currentControl as ArrowTextControl).ApplyTemplate(); |
|
4174 |
//20180903 LJY 회전된 방향으로 화면에 출력되지 않는 문제 수정 |
|
4175 |
(currentControl as ArrowTextControl).Angle -= rotate.Angle; |
|
4115 | 4176 |
|
4177 |
(currentControl as ArrowTextControl).ApplyTemplate(); |
|
4116 | 4178 |
(currentControl as ArrowTextControl).Base_TextBox.Focus(); |
4117 |
this.MainAngle.Visibility = Visibility.Visible; |
|
4179 |
this.MainAngle.Visibility = Visibility.Visible; |
|
4180 |
|
|
4181 |
//20180911 LJY |
|
4182 |
(currentControl as ArrowTextControl).isTrans = true; |
|
4118 | 4183 |
//} |
4119 | 4184 |
} |
4120 | 4185 |
} |
... | ... | |
4137 | 4202 |
} |
4138 | 4203 |
else |
4139 | 4204 |
{ |
4140 |
if (IsGetoutpoint((currentControl as PolygonControl).PointSet.Where(data => IsDrawingEnable(data) == true).FirstOrDefault())) |
|
4205 |
//20180906 LJY TEST IsRotationDrawingEnable |
|
4206 |
if (IsGetoutpoint((currentControl as PolygonControl).PointSet.Where(data => IsRotationDrawingEnable(data) == true).FirstOrDefault())) |
|
4141 | 4207 |
{ |
4142 | 4208 |
return; |
4143 | 4209 |
} |
... | ... | |
4204 | 4270 |
|
4205 | 4271 |
if (currentControl is SignControl) |
4206 | 4272 |
{ |
4207 |
if (IsGetoutpoint((currentControl as SignControl).PointSet.Where(data => IsDrawingEnable(data) == true).FirstOrDefault())) |
|
4273 |
//20180906 LJY TEST IsRotationDrawingEnable |
|
4274 |
if (IsGetoutpoint((currentControl as SignControl).PointSet.Where(data => IsRotationDrawingEnable(data) == true).FirstOrDefault())) |
|
4208 | 4275 |
{ |
4209 | 4276 |
return; |
4210 | 4277 |
} |
... | ... | |
4232 | 4299 |
currentControl.IsNew = true; |
4233 | 4300 |
currentControl.MarkupInfoID = App.Custom_ViewInfoId; |
4234 | 4301 |
ViewerDataModel.Instance.MarkupControls_USER.Add(currentControl); |
4235 |
} |
|
4302 |
|
|
4303 |
//20180903 LJY 회전된 방향으로 화면에 출력되지 않는 문제 수정 |
|
4304 |
(currentControl as SignControl).Angle -= rotate.Angle; |
|
4305 |
} |
|
4236 | 4306 |
//} |
4237 | 4307 |
} |
4238 | 4308 |
} |
... | ... | |
4245 | 4315 |
//{ |
4246 | 4316 |
if (currentControl is RectangleControl) |
4247 | 4317 |
{ |
4248 |
if (IsGetoutpoint((currentControl as RectangleControl).PointSet.Where(data => IsDrawingEnable(data) == true).FirstOrDefault())) |
|
4318 |
//20180906 LJY TEST IsRotationDrawingEnable |
|
4319 |
if (IsGetoutpoint((currentControl as RectangleControl).PointSet.Where(data => IsRotationDrawingEnable(data) == true).FirstOrDefault())) |
|
4249 | 4320 |
{ |
4250 | 4321 |
return; |
4251 | 4322 |
} |
... | ... | |
4287 | 4358 |
//{ |
4288 | 4359 |
if (currentControl is SymControl) |
4289 | 4360 |
{ |
4290 |
if (IsGetoutpoint((currentControl as SymControl).PointSet.Where(data => IsDrawingEnable(data) == true).FirstOrDefault())) |
|
4361 |
//20180906 LJY TEST IsRotationDrawingEnable |
|
4362 |
if (IsGetoutpoint((currentControl as SymControl).PointSet.Where(data => IsRotationDrawingEnable(data) == true).FirstOrDefault())) |
|
4291 | 4363 |
{ |
4292 | 4364 |
return; |
4293 | 4365 |
} |
... | ... | |
4308 | 4380 |
currentControl.MarkupInfoID = App.Custom_ViewInfoId; |
4309 | 4381 |
currentControl.CommentID = Save.shortGuid(); |
4310 | 4382 |
ViewerDataModel.Instance.MarkupControls_USER.Add(currentControl); |
4311 |
} |
|
4383 |
|
|
4384 |
//20180903 LJY 회전된 방향으로 화면에 출력되지 않는 문제 수정 |
|
4385 |
(currentControl as SymControl).Angle -= rotate.Angle; |
|
4386 |
} |
|
4312 | 4387 |
//} |
4313 | 4388 |
} |
4314 | 4389 |
} |
... | ... | |
4321 | 4396 |
//{ |
4322 | 4397 |
if (currentControl is SymControlN) |
4323 | 4398 |
{ |
4324 |
if (IsGetoutpoint((currentControl as SymControlN).PointSet.Where(data => IsDrawingEnable(data) == true).FirstOrDefault())) |
|
4399 |
//20180906 LJY TEST IsRotationDrawingEnable |
|
4400 |
if (IsGetoutpoint((currentControl as SymControlN).PointSet.Where(data => IsRotationDrawingEnable(data) == true).FirstOrDefault())) |
|
4325 | 4401 |
{ |
4326 | 4402 |
return; |
4327 | 4403 |
} |
... | ... | |
4343 | 4419 |
currentControl.MarkupInfoID = App.Custom_ViewInfoId; |
4344 | 4420 |
currentControl.CommentID = Save.shortGuid(); |
4345 | 4421 |
ViewerDataModel.Instance.MarkupControls_USER.Add(currentControl); |
4346 |
} |
|
4422 |
//20180903 LJY 회전된 방향으로 화면에 출력되지 않는 문제 수정 |
|
4423 |
(currentControl as SymControlN).Angle -= rotate.Angle; |
|
4424 |
} |
|
4347 | 4425 |
//} |
4348 | 4426 |
} |
4349 | 4427 |
} |
MarkupToPDF/Controls/Text/ArrowTextControl.cs | ||
---|---|---|
1139 | 1139 |
connectorMEGeometry.StartPoint = this.MidPoint; //핵심 |
1140 | 1140 |
//Canvas.SetLeft(Base_TextBox, this.EndPoint.X - BoxWidth / 2); |
1141 | 1141 |
//Canvas.SetTop(Base_TextBox, this.EndPoint.Y - BoxHeight / 2); |
1142 |
|
|
1143 |
//Canvas.SetLeft(Base_TextBox, this.EndPoint.X); |
|
1142 | 1144 |
Canvas.SetLeft(Base_TextBox, this.EndPoint.X); |
1143 | 1145 |
Canvas.SetTop(Base_TextBox, this.EndPoint.Y); |
1144 |
|
|
1146 |
|
|
1145 | 1147 |
List<Point> ps = new List<Point>(); |
1146 | 1148 |
ps.Add(new Point(Canvas.GetLeft(Base_TextBox) + this.BoxWidth / 2, Canvas.GetTop(Base_TextBox))); //상단 |
1147 | 1149 |
ps.Add(new Point(Canvas.GetLeft(Base_TextBox) + this.BoxWidth / 2, Canvas.GetTop(Base_TextBox) + this.BoxHeight)); // 하단 |
... | ... | |
1185 | 1187 |
break; |
1186 | 1188 |
case "270": |
1187 | 1189 |
{ |
1190 |
|
|
1188 | 1191 |
ps.Clear(); |
1189 | 1192 |
ps.Add(new Point(Canvas.GetLeft(Base_TextBox), Canvas.GetTop(Base_TextBox))); //위 왼쪽 |
1190 | 1193 |
ps.Add(new Point(Canvas.GetLeft(Base_TextBox), Canvas.GetTop(Base_TextBox) + this.BoxWidth / 2)); // 위 중간 |
... | ... | |
1202 | 1205 |
default: |
1203 | 1206 |
break; |
1204 | 1207 |
} |
1208 |
|
|
1209 |
|
|
1205 | 1210 |
var endP = MathSet.getNearPoint(ps, this.MidPoint); |
1206 | 1211 |
|
1207 | 1212 |
connectorMEGeometry.EndPoint = endP; |
1208 |
instanceGroup.Children.Add(SingleAllow(this.MidPoint, this.StartPoint, this.LineSize)); |
|
1213 |
|
|
1214 |
//20180911 LJY 꺾이는 부분 수정 |
|
1215 |
Point testP = endP; |
|
1216 |
if (this.ArrowTextStyle == ArrowTextStyleSet.Cloud || this.ArrowTextStyle == ArrowTextStyleSet.Rect) |
|
1217 |
{ |
|
1218 |
switch (Math.Abs(this.Angle).ToString()) |
|
1219 |
{ |
|
1220 |
case "90": |
|
1221 |
testP = new Point(endP.X + 50, endP.Y); |
|
1222 |
break; |
|
1223 |
case "270": |
|
1224 |
testP = new Point(endP.X - 50, endP.Y); |
|
1225 |
break; |
|
1226 |
} |
|
1227 |
} |
|
1228 |
|
|
1229 |
//20180910 LJY 각도에 따라. |
|
1230 |
switch (Math.Abs(this.Angle).ToString()) |
|
1231 |
{ |
|
1232 |
case "90": |
|
1233 |
if (isFixed) |
|
1234 |
{ |
|
1235 |
if (ps[0] == endP) //상단 |
|
1236 |
{ |
|
1237 |
testP = new Point(endP.X , endP.Y + 50); |
|
1238 |
//System.Diagnostics.Debug.WriteLine("상단"+ testP); |
|
1239 |
} |
|
1240 |
else if (ps[1] == endP) //하단 |
|
1241 |
{ |
|
1242 |
testP = new Point(endP.X , endP.Y - 50); |
|
1243 |
//System.Diagnostics.Debug.WriteLine("하단"+ testP); |
|
1244 |
} |
|
1245 |
else if (ps[2] == endP) //좌단 |
|
1246 |
{ |
|
1247 |
testP = new Point(endP.X - 50, endP.Y); |
|
1248 |
//System.Diagnostics.Debug.WriteLine("좌단"+ testP); |
|
1249 |
} |
|
1250 |
else if (ps[3] == endP) //우단 |
|
1251 |
{ |
|
1252 |
testP = new Point(endP.X + 50, endP.Y); |
|
1253 |
//System.Diagnostics.Debug.WriteLine("우단"+ testP); |
|
1254 |
} |
|
1255 |
} |
|
1256 |
break; |
|
1257 |
case "270": |
|
1258 |
if (isFixed) |
|
1259 |
{ |
|
1260 |
if (ps[0] == endP) //상단 |
|
1261 |
{ |
|
1262 |
testP = new Point(endP.X , endP.Y - 50); |
|
1263 |
//System.Diagnostics.Debug.WriteLine("상단" + testP); |
|
1264 |
} |
|
1265 |
else if (ps[1] == endP) //하단 |
|
1266 |
{ |
|
1267 |
testP = new Point(endP.X, endP.Y + 50); |
|
1268 |
//System.Diagnostics.Debug.WriteLine("하단" + testP); |
|
1269 |
} |
|
1270 |
else if (ps[2] == endP) //좌단 |
|
1271 |
{ |
|
1272 |
testP = new Point(endP.X + 50, endP.Y); |
|
1273 |
//System.Diagnostics.Debug.WriteLine("좌단" + testP); |
|
1274 |
} |
|
1275 |
else if (ps[3] == endP) //우단 |
|
1276 |
{ |
|
1277 |
testP = new Point(endP.X - 50, endP.Y); |
|
1278 |
//System.Diagnostics.Debug.WriteLine("우단" + testP); |
|
1279 |
} |
|
1280 |
} |
|
1281 |
break; |
|
1282 |
default: |
|
1283 |
if (isFixed) |
|
1284 |
{ |
|
1285 |
if (ps[0] == endP) //상단 |
|
1286 |
{ |
|
1287 |
testP = new Point(endP.X, endP.Y - 50); |
|
1288 |
//System.Diagnostics.Debug.WriteLine("상단"); |
|
1289 |
} |
|
1290 |
else if (ps[1] == endP) //하단 |
|
1291 |
{ |
|
1292 |
testP = new Point(endP.X, endP.Y + 50); |
|
1293 |
//System.Diagnostics.Debug.WriteLine("하단"); |
|
1294 |
} |
|
1295 |
else if (ps[2] == endP) //좌단 |
|
1296 |
{ |
|
1297 |
testP = new Point(endP.X - 50, endP.Y); |
|
1298 |
//System.Diagnostics.Debug.WriteLine("좌단"); |
|
1299 |
} |
|
1300 |
else if (ps[3] == endP) //우단 |
|
1301 |
{ |
|
1302 |
testP = new Point(endP.X + 50, endP.Y); |
|
1303 |
//System.Diagnostics.Debug.WriteLine("우단"); |
|
1304 |
} |
|
1305 |
} |
|
1306 |
break; |
|
1307 |
} |
|
1308 |
|
|
1309 |
|
|
1310 |
connectorSMGeometry.EndPoint = testP; |
|
1311 |
connectorMEGeometry.StartPoint = testP; |
|
1312 |
//20180910 LJY 각도에 따라. |
|
1313 |
|
|
1314 |
//instanceGroup.Children.Add(SingleAllow(this.MidPoint, this.StartPoint, this.LineSize)); |
|
1315 |
instanceGroup.Children.Add(SingleAllow(testP, this.StartPoint, this.LineSize)); |
|
1209 | 1316 |
} |
1210 | 1317 |
else |
1211 | 1318 |
{ |
... | ... | |
1214 | 1321 |
case "90": |
1215 | 1322 |
{ |
1216 | 1323 |
ps.Clear(); |
1324 |
|
|
1217 | 1325 |
ps.Add(new Point(Canvas.GetLeft(Base_TextBox), Canvas.GetTop(Base_TextBox))); //위 왼쪽 |
1218 | 1326 |
ps.Add(new Point(Canvas.GetLeft(Base_TextBox), Canvas.GetTop(Base_TextBox) - this.BoxWidth / 2)); // 위 중간 |
1219 | 1327 |
ps.Add(new Point(Canvas.GetLeft(Base_TextBox), Canvas.GetTop(Base_TextBox) - this.BoxWidth)); // 위 오른쪽 |
... | ... | |
1223 | 1331 |
|
1224 | 1332 |
ps.Add(new Point(Canvas.GetLeft(Base_TextBox) + this.BoxHeight, Canvas.GetTop(Base_TextBox) - this.BoxWidth / 2)); //중간 하단 |
1225 | 1333 |
ps.Add(new Point(Canvas.GetLeft(Base_TextBox) + this.BoxHeight, Canvas.GetTop(Base_TextBox) - this.BoxWidth)); //오른쪽 하단 |
1226 |
|
|
1227 |
ps.Add(new Point(Canvas.GetLeft(Base_TextBox) + this.BoxHeight / 2, Canvas.GetTop(Base_TextBox) - this.BoxWidth)); //오른쪽 중간 |
|
1334 |
ps.Add(new Point(Canvas.GetLeft(Base_TextBox) + this.BoxHeight / 2, Canvas.GetTop(Base_TextBox) - this.BoxWidth)); //오른쪽 중간 |
|
1228 | 1335 |
} |
1229 | 1336 |
break; |
1230 | 1337 |
case "270": |
1231 | 1338 |
{ |
1232 | 1339 |
ps.Clear(); |
1340 |
|
|
1233 | 1341 |
ps.Add(new Point(Canvas.GetLeft(Base_TextBox), Canvas.GetTop(Base_TextBox))); //위 왼쪽 |
1234 | 1342 |
ps.Add(new Point(Canvas.GetLeft(Base_TextBox), Canvas.GetTop(Base_TextBox) + this.BoxWidth / 2)); // 위 중간 |
1235 | 1343 |
ps.Add(new Point(Canvas.GetLeft(Base_TextBox), Canvas.GetTop(Base_TextBox) + this.BoxWidth)); // 위 오른쪽 |
... | ... | |
1240 | 1348 |
ps.Add(new Point(Canvas.GetLeft(Base_TextBox) - this.BoxHeight, Canvas.GetTop(Base_TextBox) + this.BoxWidth / 2)); //중간 하단 |
1241 | 1349 |
ps.Add(new Point(Canvas.GetLeft(Base_TextBox) - this.BoxHeight, Canvas.GetTop(Base_TextBox) + this.BoxWidth)); //오른쪽 하단 |
1242 | 1350 |
|
1243 |
ps.Add(new Point(Canvas.GetLeft(Base_TextBox) - this.BoxHeight / 2, Canvas.GetTop(Base_TextBox) + this.BoxWidth)); //오른쪽 중간 |
|
1351 |
ps.Add(new Point(Canvas.GetLeft(Base_TextBox) - this.BoxHeight / 2, Canvas.GetTop(Base_TextBox) + this.BoxWidth)); //오른쪽 중간
|
|
1244 | 1352 |
} |
1245 | 1353 |
break; |
1246 | 1354 |
default: |
... | ... | |
1252 | 1360 |
//connectorMEGeometry.EndPoint = endP; |
1253 | 1361 |
//connectorMEGeometry.EndPoint = endP; |
1254 | 1362 |
connectorMEGeometry.EndPoint = endP; //최상단 |
1255 |
//connectorMEGeometry.EndPoint = this.EndPoint; //핵심 |
|
1256 |
//this.MidPoint= MathSet.getMiddlePoint(this.StartPoint, endP); |
|
1363 |
//connectorMEGeometry.EndPoint = this.EndPoint; //핵심
|
|
1364 |
//this.MidPoint= MathSet.getMiddlePoint(this.StartPoint, endP);
|
|
1257 | 1365 |
#region 보정치 |
1258 | 1366 |
//enP는 그 점 |
1259 | 1367 |
//Point testP = new Point(endP.X-100,endP.Y); |
1260 |
Point testP = endP; |
|
1261 | 1368 |
|
1369 |
Point testP = endP; |
|
1370 |
|
|
1371 |
|
|
1262 | 1372 |
//Point testP = new Point(endP.X, endP.Y - 50); |
1263 | 1373 |
|
1264 |
|
|
1374 |
/* 20180910 LJY TEST 주석 |
|
1265 | 1375 |
if (isFixed) |
1266 | 1376 |
{ |
1267 | 1377 |
if (ps[0] == endP) //상단 |
... | ... | |
1285 | 1395 |
//System.Diagnostics.Debug.WriteLine("우단"); |
1286 | 1396 |
} |
1287 | 1397 |
} |
1398 |
*/ |
|
1399 |
|
|
1400 |
//20180910 LJY 각도에 따라. |
|
1401 |
switch (Math.Abs(this.Angle).ToString()) |
|
1402 |
{ |
|
1403 |
case "90": |
|
1404 |
if (isFixed) |
|
1405 |
{ |
|
1406 |
if (ps[0] == endP) //상단 |
|
1407 |
{ |
|
1408 |
testP = new Point(endP.X - 50, endP.Y); |
|
1409 |
//System.Diagnostics.Debug.WriteLine("상단"+ testP); |
|
1410 |
} |
|
1411 |
else if (ps[1] == endP) //하단 |
|
1412 |
{ |
|
1413 |
testP = new Point(endP.X + 50, endP.Y); |
|
1414 |
//System.Diagnostics.Debug.WriteLine("하단"+ testP); |
|
1415 |
} |
|
1416 |
else if (ps[2] == endP) //좌단 |
|
1417 |
{ |
|
1418 |
testP = new Point(endP.X - 50, endP.Y); |
|
1419 |
//System.Diagnostics.Debug.WriteLine("좌단"+ testP); |
|
1420 |
} |
|
1421 |
else if (ps[3] == endP) //우단 |
|
1422 |
{ |
|
1423 |
testP = new Point(endP.X + 50 , endP.Y); |
|
1424 |
//System.Diagnostics.Debug.WriteLine("우단"+ testP); |
|
1425 |
} |
|
1426 |
} |
|
1427 |
break; |
|
1428 |
case "270": |
|
1429 |
if (isFixed) |
|
1430 |
{ |
|
1431 |
if (ps[0] == endP) //상단 |
|
1432 |
{ |
|
1433 |
testP = new Point(endP.X + 50, endP.Y); |
|
1434 |
//System.Diagnostics.Debug.WriteLine("상단" + testP); |
|
1435 |
} |
|
1436 |
else if (ps[1] == endP) //하단 |
|
1437 |
{ |
|
1438 |
testP = new Point(endP.X - 50, endP.Y); |
|
1439 |
//System.Diagnostics.Debug.WriteLine("하단" + testP); |
|
1440 |
} |
|
1441 |
else if (ps[2] == endP) //좌단 |
|
1442 |
{ |
|
1443 |
testP = new Point(endP.X + 50, endP.Y); |
|
1444 |
//System.Diagnostics.Debug.WriteLine("좌단" + testP); |
|
1445 |
} |
|
1446 |
else if (ps[3] == endP) //우단 |
|
1447 |
{ |
|
1448 |
testP = new Point(endP.X + 50, endP.Y ); |
|
1449 |
//System.Diagnostics.Debug.WriteLine("우단" + testP); |
|
1450 |
} |
|
1451 |
} |
|
1452 |
break; |
|
1453 |
default: |
|
1454 |
if (isFixed) |
|
1455 |
{ |
|
1456 |
if (ps[0] == endP) //상단 |
|
1457 |
{ |
|
1458 |
testP = new Point(endP.X, endP.Y - 50); |
|
1459 |
//System.Diagnostics.Debug.WriteLine("상단"); |
|
1460 |
} |
|
1461 |
else if (ps[1] == endP) //하단 |
|
1462 |
{ |
|
1463 |
testP = new Point(endP.X, endP.Y + 50); |
|
1464 |
//System.Diagnostics.Debug.WriteLine("하단"); |
|
1465 |
} |
|
1466 |
else if (ps[2] == endP) //좌단 |
|
1467 |
{ |
|
1468 |
testP = new Point(endP.X - 50, endP.Y); |
|
1469 |
//System.Diagnostics.Debug.WriteLine("좌단"); |
|
1470 |
} |
|
1471 |
else if (ps[3] == endP) //우단 |
|
1472 |
{ |
|
1473 |
testP = new Point(endP.X + 50, endP.Y); |
|
1474 |
//System.Diagnostics.Debug.WriteLine("우단"); |
|
1475 |
} |
|
1476 |
} |
|
1477 |
break; |
|
1478 |
} |
|
1479 |
|
|
1480 |
|
|
1288 | 1481 |
connectorSMGeometry.EndPoint = testP; |
1289 | 1482 |
connectorMEGeometry.StartPoint = testP; |
1290 | 1483 |
//connectorSMGeometry.EndPoint = endP; |
... | ... | |
1374 | 1567 |
|
1375 | 1568 |
private void DrawingCloud() |
1376 | 1569 |
{ |
1377 |
List<Point> pCloud = new List<Point>() |
|
1570 |
//20180906 LJY Textbox guide |
|
1571 |
string angle = Math.Abs(this.Angle).ToString(); |
|
1572 |
if (angle == "180") |
|
1378 | 1573 |
{ |
1379 |
#if SILVERLIGHT |
|
1380 |
new Point(Canvas.GetLeft(Base_TextBox), Canvas.GetTop(Base_TextBox)), //위 |
|
1381 |
new Point(Canvas.GetLeft(Base_TextBox), Canvas.GetTop(Base_TextBox)+ BoxHeight), //왼쪽 아래 |
|
1382 |
new Point(Canvas.GetLeft(Base_TextBox)+ BoxWidth, Canvas.GetTop(Base_TextBox) + BoxHeight), |
|
1383 |
new Point(Canvas.GetLeft(Base_TextBox) + BoxWidth, Canvas.GetTop(Base_TextBox)), |
|
1384 |
new Point(Canvas.GetLeft(Base_TextBox), Canvas.GetTop(Base_TextBox)), //위 |
|
1385 |
|
|
1386 |
#else |
|
1387 |
new Point(Canvas.GetLeft(Base_TextBox), Canvas.GetTop(Base_TextBox)), //위 |
|
1388 |
new Point(Canvas.GetLeft(Base_TextBox), Canvas.GetTop(Base_TextBox)+ BoxHeight), //왼쪽 아래 |
|
1389 |
new Point(Canvas.GetLeft(Base_TextBox)+ BoxWidth, Canvas.GetTop(Base_TextBox) + BoxHeight), |
|
1390 |
new Point(Canvas.GetLeft(Base_TextBox) + BoxWidth, Canvas.GetTop(Base_TextBox)), |
|
1391 |
new Point(Canvas.GetLeft(Base_TextBox), Canvas.GetTop(Base_TextBox)), //위 |
|
1392 |
|
|
1393 |
//new Point(Canvas.GetLeft(Base_TextBox), Canvas.GetTop(Base_TextBox)), //위 |
|
1394 |
//new Point(Canvas.GetLeft(Base_TextBox), Canvas.GetTop(Base_TextBox)+ BoxHeight-4), //왼쪽 아래 |
|
1395 |
//new Point(Canvas.GetLeft(Base_TextBox)+ BoxWidth-1, Canvas.GetTop(Base_TextBox) + BoxHeight-4), |
|
1396 |
//new Point(Canvas.GetLeft(Base_TextBox) + BoxWidth-1, Canvas.GetTop(Base_TextBox)), |
|
1397 |
//new Point(Canvas.GetLeft(Base_TextBox), Canvas.GetTop(Base_TextBox)), //위 |
|
1398 |
#endif |
|
1399 |
}; |
|
1400 |
//instanceGroup.Children.Add(Generate(pCloud)); |
|
1401 |
SubPathData = (Generate(pCloud)); |
|
1402 |
PathDataInner = (GenerateInner(pCloud)); |
|
1574 |
List<Point> pCloud = new List<Point>() |
|
1575 |
{ |
|
1576 |
new Point(Canvas.GetLeft(Base_TextBox), Canvas.GetTop(Base_TextBox)), //위 |
|
1577 |
new Point(Canvas.GetLeft(Base_TextBox), Canvas.GetTop(Base_TextBox) - BoxHeight), //왼쪽 아래 |
|
1578 |
new Point(Canvas.GetLeft(Base_TextBox) - BoxWidth, Canvas.GetTop(Base_TextBox) - BoxHeight), |
|
1579 |
new Point(Canvas.GetLeft(Base_TextBox) - BoxWidth, Canvas.GetTop(Base_TextBox)), |
|
1580 |
new Point(Canvas.GetLeft(Base_TextBox), Canvas.GetTop(Base_TextBox)), //위 |
|
1581 |
}; |
|
1582 |
SubPathData = (Generate(pCloud)); |
|
1583 |
PathDataInner = (GenerateInnerCloud(pCloud, angle)); |
|
1584 |
|
|
1585 |
}//20180906 LJY Textbox guide |
|
1586 |
else |
|
1587 |
{ |
|
1588 |
List<Point> pCloud = new List<Point>() |
|
1589 |
{ |
|
1590 |
#if SILVERLIGHT |
|
1591 |
new Point(Canvas.GetLeft(Base_TextBox), Canvas.GetTop(Base_TextBox)), //위 |
|
1592 |
new Point(Canvas.GetLeft(Base_TextBox), Canvas.GetTop(Base_TextBox)+ BoxHeight), //왼쪽 아래 |
|
1593 |
new Point(Canvas.GetLeft(Base_TextBox)+ BoxWidth, Canvas.GetTop(Base_TextBox) + BoxHeight), |
|
1594 |
new Point(Canvas.GetLeft(Base_TextBox) + BoxWidth, Canvas.GetTop(Base_TextBox)), |
|
1595 |
new Point(Canvas.GetLeft(Base_TextBox), Canvas.GetTop(Base_TextBox)), //위 |
|
1596 |
|
|
1597 |
#else |
|
1598 |
new Point(Canvas.GetLeft(Base_TextBox), Canvas.GetTop(Base_TextBox)), //위 |
|
1599 |
new Point(Canvas.GetLeft(Base_TextBox), Canvas.GetTop(Base_TextBox)+ BoxHeight), //왼쪽 아래 |
|
1600 |
new Point(Canvas.GetLeft(Base_TextBox)+ BoxWidth, Canvas.GetTop(Base_TextBox) + BoxHeight), |
|
1601 |
new Point(Canvas.GetLeft(Base_TextBox) + BoxWidth, Canvas.GetTop(Base_TextBox)), |
|
1602 |
new Point(Canvas.GetLeft(Base_TextBox), Canvas.GetTop(Base_TextBox)), //위 |
|
1603 |
|
|
1604 |
//new Point(Canvas.GetLeft(Base_TextBox), Canvas.GetTop(Base_TextBox)), //위 |
|
1605 |
//new Point(Canvas.GetLeft(Base_TextBox), Canvas.GetTop(Base_TextBox)+ BoxHeight-4), //왼쪽 아래 |
|
1606 |
//new Point(Canvas.GetLeft(Base_TextBox)+ BoxWidth-1, Canvas.GetTop(Base_TextBox) + BoxHeight-4), |
|
1607 |
//new Point(Canvas.GetLeft(Base_TextBox) + BoxWidth-1, Canvas.GetTop(Base_TextBox)), |
|
1608 |
//new Point(Canvas.GetLeft(Base_TextBox), Canvas.GetTop(Base_TextBox)), //위 |
|
1609 |
#endif |
|
1610 |
}; |
|
1611 |
//instanceGroup.Children.Add(Generate(pCloud)); |
|
1612 |
SubPathData = (Generate(pCloud)); |
|
1613 |
PathDataInner = (GenerateInnerCloud(pCloud, angle)); |
|
1614 |
// } |
|
1615 |
} |
|
1616 |
|
|
1403 | 1617 |
} |
1404 | 1618 |
|
1405 | 1619 |
private void DrawingRect() |
1406 | 1620 |
{ |
1407 |
List<Point> pCloud = new List<Point>() |
|
1621 |
//20180906 LJY Textbox guide |
|
1622 |
|
|
1623 |
if (Math.Abs(this.Angle).ToString() == "90") |
|
1408 | 1624 |
{ |
1409 |
#if SILVERLIGHT |
|
1410 |
new Point(Canvas.GetLeft(Base_TextBox), Canvas.GetTop(Base_TextBox)), //위 |
|
1411 |
new Point(Canvas.GetLeft(Base_TextBox), Canvas.GetTop(Base_TextBox)+ BoxHeight), //왼쪽 아래 |
|
1412 |
new Point(Canvas.GetLeft(Base_TextBox)+ BoxWidth, Canvas.GetTop(Base_TextBox) + BoxHeight), |
|
1413 |
new Point(Canvas.GetLeft(Base_TextBox) + BoxWidth, Canvas.GetTop(Base_TextBox)), |
|
1414 |
new Point(Canvas.GetLeft(Base_TextBox), Canvas.GetTop(Base_TextBox)), //위 |
|
1415 |
|
|
1416 |
#else |
|
1417 |
new Point(Canvas.GetLeft(Base_TextBox), Canvas.GetTop(Base_TextBox)), //위 |
|
1418 |
new Point(Canvas.GetLeft(Base_TextBox), Canvas.GetTop(Base_TextBox)+ BoxHeight), //왼쪽 아래 |
|
1419 |
new Point(Canvas.GetLeft(Base_TextBox)+ BoxWidth, Canvas.GetTop(Base_TextBox) + BoxHeight), |
|
1420 |
new Point(Canvas.GetLeft(Base_TextBox) + BoxWidth, Canvas.GetTop(Base_TextBox)), |
|
1421 |
new Point(Canvas.GetLeft(Base_TextBox), Canvas.GetTop(Base_TextBox)), //위 |
|
1422 |
|
|
1423 |
//new Point(Canvas.GetLeft(Base_TextBox), Canvas.GetTop(Base_TextBox)), //위 |
|
1424 |
//new Point(Canvas.GetLeft(Base_TextBox), Canvas.GetTop(Base_TextBox)+ BoxHeight-4), //왼쪽 아래 |
|
1425 |
//new Point(Canvas.GetLeft(Base_TextBox)+ BoxWidth-1, Canvas.GetTop(Base_TextBox) + BoxHeight-4), |
|
1426 |
//new Point(Canvas.GetLeft(Base_TextBox) + BoxWidth-1, Canvas.GetTop(Base_TextBox)), |
|
1427 |
//new Point(Canvas.GetLeft(Base_TextBox), Canvas.GetTop(Base_TextBox)), //위 |
|
1428 |
#endif |
|
1429 |
}; |
|
1430 |
//instanceGroup.Children.Add(Generate(pCloud)); |
|
1431 |
PathDataInner = (GenerateInner(pCloud)); |
|
1625 |
List<Point> pCloud = new List<Point>() |
|
1626 |
{ |
|
1627 |
new Point(Canvas.GetLeft(Base_TextBox), Canvas.GetTop(Base_TextBox)), //위 |
|
1628 |
new Point(Canvas.GetLeft(Base_TextBox), Canvas.GetTop(Base_TextBox) - BoxWidth), //왼쪽 아래 |
|
1629 |
new Point(Canvas.GetLeft(Base_TextBox) + BoxHeight, Canvas.GetTop(Base_TextBox) - BoxWidth), |
|
1630 |
new Point(Canvas.GetLeft(Base_TextBox) + BoxHeight, Canvas.GetTop(Base_TextBox)), |
|
1631 |
new Point(Canvas.GetLeft(Base_TextBox), Canvas.GetTop(Base_TextBox)), //위 |
|
1632 |
}; |
|
1633 |
PathDataInner = (GenerateInner(pCloud)); |
|
1634 |
} |
|
1635 |
else if(Math.Abs(this.Angle).ToString() == "270") |
|
1636 |
{ |
|
1637 |
List<Point> pCloud = new List<Point>() |
|
1638 |
{ |
|
1639 |
new Point(Canvas.GetLeft(Base_TextBox), Canvas.GetTop(Base_TextBox)), //위 |
|
1640 |
new Point(Canvas.GetLeft(Base_TextBox), Canvas.GetTop(Base_TextBox) + BoxWidth), //왼쪽 아래 |
|
1641 |
new Point(Canvas.GetLeft(Base_TextBox) - BoxHeight, Canvas.GetTop(Base_TextBox) + BoxWidth), |
|
1642 |
new Point(Canvas.GetLeft(Base_TextBox) - BoxHeight, Canvas.GetTop(Base_TextBox)), |
|
1643 |
new Point(Canvas.GetLeft(Base_TextBox), Canvas.GetTop(Base_TextBox)), //위 |
|
1644 |
}; |
|
1645 |
PathDataInner = (GenerateInner(pCloud)); |
|
1646 |
}//20180906 LJY Textbox guide |
|
1647 |
else |
|
1648 |
{ |
|
1649 |
List<Point> pCloud = new List<Point>() |
|
1650 |
{ |
|
1651 |
#if SILVERLIGHT |
|
1652 |
new Point(Canvas.GetLeft(Base_TextBox), Canvas.GetTop(Base_TextBox)), //위 |
|
1653 |
new Point(Canvas.GetLeft(Base_TextBox), Canvas.GetTop(Base_TextBox)+ BoxHeight), //왼쪽 아래 |
|
1654 |
new Point(Canvas.GetLeft(Base_TextBox)+ BoxWidth, Canvas.GetTop(Base_TextBox) + BoxHeight), |
|
1655 |
new Point(Canvas.GetLeft(Base_TextBox) + BoxWidth, Canvas.GetTop(Base_TextBox)), |
|
1656 |
new Point(Canvas.GetLeft(Base_TextBox), Canvas.GetTop(Base_TextBox)), //위 |
|
1657 |
|
|
1658 |
#else |
|
1659 |
new Point(Canvas.GetLeft(Base_TextBox), Canvas.GetTop(Base_TextBox)), //위 |
|
1660 |
new Point(Canvas.GetLeft(Base_TextBox), Canvas.GetTop(Base_TextBox)+ BoxHeight), //왼쪽 아래 |
|
1661 |
new Point(Canvas.GetLeft(Base_TextBox)+ BoxWidth, Canvas.GetTop(Base_TextBox) + BoxHeight), |
|
1662 |
new Point(Canvas.GetLeft(Base_TextBox) + BoxWidth, Canvas.GetTop(Base_TextBox)), |
|
1663 |
new Point(Canvas.GetLeft(Base_TextBox), Canvas.GetTop(Base_TextBox)), //위 |
|
1664 |
|
|
1665 |
//new Point(Canvas.GetLeft(Base_TextBox), Canvas.GetTop(Base_TextBox)), //위 |
|
1666 |
//new Point(Canvas.GetLeft(Base_TextBox), Canvas.GetTop(Base_TextBox)+ BoxHeight-4), //왼쪽 아래 |
|
1667 |
//new Point(Canvas.GetLeft(Base_TextBox)+ BoxWidth-1, Canvas.GetTop(Base_TextBox) + BoxHeight-4), |
|
1668 |
//new Point(Canvas.GetLeft(Base_TextBox) + BoxWidth-1, Canvas.GetTop(Base_TextBox)), |
|
1669 |
//new Point(Canvas.GetLeft(Base_TextBox), Canvas.GetTop(Base_TextBox)), //위 |
|
1670 |
#endif |
|
1671 |
}; |
|
1672 |
//instanceGroup.Children.Add(Generate(pCloud)); |
|
1673 |
PathDataInner = (GenerateInner(pCloud)); |
|
1674 |
} |
|
1432 | 1675 |
} |
1433 | 1676 |
|
1434 | 1677 |
public void updateControl() |
... | ... | |
1469 | 1712 |
dx /= l; |
1470 | 1713 |
dy /= l; |
1471 | 1714 |
Double j = 1; |
1472 |
for (j = 1; j < (count - 1); j++) |
|
1715 |
for (j = 1; j < (count - 1); j++)
|
|
1473 | 1716 |
{ |
1474 | 1717 |
ArcSegment arcSeg = new ArcSegment(); |
1475 | 1718 |
arcSeg.Size = new Size(arcLength * _CloudArcDepth, arcLength * _CloudArcDepth); /// x size and y size of arc |
... | ... | |
1499 | 1742 |
public static PathGeometry Generate(List<Point> pData) |
1500 | 1743 |
{ |
1501 | 1744 |
var _pathGeometry = new PathGeometry(); |
1745 |
|
|
1502 | 1746 |
double area = MathSet.AreaOf(pData); |
1503 | 1747 |
bool reverse = (area > 0); |
1504 | 1748 |
int count = pData.Count; |
... | ... | |
1509 | 1753 |
pathFigure.IsFilled = true; |
1510 | 1754 |
_pathGeometry.Figures.Add(pathFigure); |
1511 | 1755 |
} |
1756 |
|
|
1512 | 1757 |
return _pathGeometry; |
1513 | 1758 |
} |
1759 |
|
|
1760 |
|
|
1514 | 1761 |
public static PathGeometry GenerateInner(List<Point> pData) |
1515 | 1762 |
{ |
1516 | 1763 |
var _pathGeometry = new PathGeometry(); |
... | ... | |
1540 | 1787 |
|
1541 | 1788 |
pathFigur2.IsClosed = true; |
1542 | 1789 |
pathFigur2.IsFilled = true; |
1543 |
_pathGeometry.Figures.Add(pathFigur2); |
|
1790 |
_pathGeometry.Figures.Add(pathFigur2);
|
|
1544 | 1791 |
|
1545 | 1792 |
return _pathGeometry; |
1546 | 1793 |
} |
1547 | 1794 |
|
1795 |
//20180910 LJY Cloud rotation 추가 |
|
1796 |
public static PathGeometry GenerateInnerCloud(List<Point> pData, string angle) |
|
1797 |
{ |
|
1798 |
var _pathGeometry = new PathGeometry(); |
|
1799 |
double area = MathSet.AreaOf(pData); |
|
1800 |
bool reverse = (area > 0); |
|
1801 |
int count = pData.Count; |
|
1802 |
|
|
1803 |
PathFigure pathFigur2 = new PathFigure(); |
|
1804 |
pathFigur2.StartPoint = pData[0]; |
|
1805 |
|
|
1806 |
LineSegment lineSegment0 = new LineSegment(); |
|
1807 |
lineSegment0.Point = pData[0]; |
|
1808 |
pathFigur2.Segments.Add(lineSegment0); |
|
1809 |
|
|
1810 |
LineSegment lineSegment1 = new LineSegment(); |
|
1811 |
lineSegment1.Point = pData[1]; |
|
1812 |
pathFigur2.Segments.Add(lineSegment1); |
|
1813 |
|
|
1814 |
LineSegment lineSegment2 = new LineSegment(); |
|
1815 |
lineSegment2.Point = pData[2]; |
|
1816 |
pathFigur2.Segments.Add(lineSegment2); |
|
1817 |
|
|
1818 |
LineSegment lineSegment3 = new LineSegment(); |
|
1819 |
lineSegment3.Point = pData[3]; |
|
1820 |
pathFigur2.Segments.Add(lineSegment3); |
|
1821 |
|
|
1822 |
RotateTransform transform = new RotateTransform(); |
|
1823 |
switch (angle) |
|
1824 |
{ |
|
1825 |
case "90": |
|
1826 |
transform.Angle = -90; |
|
1827 |
break; |
|
1828 |
case "180": |
|
1829 |
transform.Angle = -180; |
|
1830 |
break; |
|
1831 |
case "270": |
|
1832 |
transform.Angle = -270; |
|
1833 |
break; |
|
1834 |
} |
|
1835 |
transform.CenterX = pData[0].X; |
|
1836 |
transform.CenterY = pData[0].Y; |
|
1837 |
_pathGeometry.Transform = transform; |
|
1838 |
|
|
1839 |
pathFigur2.IsClosed = true; |
|
1840 |
pathFigur2.IsFilled = true; |
|
1841 |
_pathGeometry.Figures.Add(pathFigur2); |
|
1842 |
|
|
1843 |
return _pathGeometry; |
|
1844 |
} |
|
1548 | 1845 |
public static PathGeometry SingleAllow(Point p2, Point p1, double lineSize) |
1549 | 1846 |
{ |
1550 | 1847 |
double theta = Math.Atan2((p2.Y - p1.Y), (p2.X - p1.X)) * 180 / Math.PI; |
내보내기 Unified diff