개정판 f959ea6f
issue #923: rename and fix InkControl_Convert
Change-Id: Iec4f34a4743f33987c05ea42674495491afa1166
KCOM/Events/Event_KeyEvent.cs | ||
---|---|---|
86 | 86 |
{ |
87 | 87 |
if (ViewerDataModel.Instance.IsPressCtrl && (App.ViewInfo.CreateFinalPDFPermission || App.ViewInfo.NewCommentPermission)) |
88 | 88 |
{ |
89 |
this.dzMainMenu.InkControl_Convert();
|
|
89 |
this.dzMainMenu.ConvertInkControlToPolygon();
|
|
90 | 90 |
|
91 | 91 |
if (Common.ViewerDataModel.Instance.MarkupControls_USER.Count > 0) |
92 | 92 |
{ |
KCOM/Events/Implementation/TopMenuEvent.cs | ||
---|---|---|
334 | 334 |
// update mylist and gridview |
335 | 335 |
menu.UpdateMyMarkupList(); |
336 | 336 |
|
337 |
this.ParentOfType<MainWindow>().dzMainMenu.InkControl_Convert();
|
|
337 |
this.ParentOfType<MainWindow>().dzMainMenu.ConvertInkControlToPolygon();
|
|
338 | 338 |
|
339 | 339 |
if (menu.PreviewUserMarkupInfoItem != null && menu.PreviewUserMarkupInfoItem.IsPreviewUser == true) |
340 | 340 |
{ |
... | ... | |
414 | 414 |
|
415 | 415 |
try |
416 | 416 |
{ |
417 |
this.ParentOfType<MainWindow>().dzMainMenu.InkControl_Convert();
|
|
417 |
this.ParentOfType<MainWindow>().dzMainMenu.ConvertInkControlToPolygon();
|
|
418 | 418 |
|
419 | 419 |
List<IKCOM.MarkupInfoItem> SelectedMarkupInfos = new List<IKCOM.MarkupInfoItem>(); |
420 | 420 |
foreach (var item in menu.gridViewMarkup.SelectedItems) |
KCOM/Views/MainMenu.xaml.cs | ||
---|---|---|
505 | 505 |
Logger.sendCheckLog("pageNavigator_PageChanging_UndoDataListClear", 1); |
506 | 506 |
ViewerDataModel.Instance.UndoDataList.Clear(); |
507 | 507 |
|
508 |
InkControl_Convert();
|
|
508 |
ConvertInkControlToPolygon();
|
|
509 | 509 |
|
510 | 510 |
SelectionSet.Instance.UnSelect(this); |
511 | 511 |
UpdateMyMarkupList(); |
... | ... | |
2043 | 2043 |
set_option.Value = double.Parse(set_option.ContentText); |
2044 | 2044 |
} |
2045 | 2045 |
|
2046 |
InkControl_Convert();
|
|
2046 |
ConvertInkControlToPolygon();
|
|
2047 | 2047 |
|
2048 | 2048 |
///TODO: |
2049 | 2049 |
var text_item = ViewerDataModel.Instance.MarkupControls_USER.Where(data => |
... | ... | |
5063 | 5063 |
} |
5064 | 5064 |
} |
5065 | 5065 |
|
5066 |
public void InkControl_Convert() |
|
5066 |
/// <summary> |
|
5067 |
/// convert inkcontrol to polygoncontrol |
|
5068 |
/// </summary> |
|
5069 |
public void ConvertInkControlToPolygon() |
|
5067 | 5070 |
{ |
5068 |
Logger.sendCheckLog("pageNavigator_PageChanging_InkControl_Convert", 1);
|
|
5071 |
Logger.sendCheckLog("pageNavigator_PageChanging_ConvertInkControlToPolygon", 1);
|
|
5069 | 5072 |
if (inkBoard.Strokes.Count > 0) |
5070 | 5073 |
{ |
5071 | 5074 |
inkBoard.Strokes.ToList().ForEach(stroke => |
5072 | 5075 |
{ |
5073 |
List<Stroke> removingStroke = new List<Stroke>(); |
|
5074 |
StrokeCollection stC = new StrokeCollection(); |
|
5075 |
|
|
5076 |
removingStroke.Add(stroke); |
|
5077 |
|
|
5078 | 5076 |
InkToPath ip = new InkToPath(); |
5077 |
|
|
5079 | 5078 |
List<Point> inkPointSet = new List<Point>(); |
5080 |
PolygonControl pc = null; |
|
5081 |
pc = new PolygonControl() |
|
5079 |
inkPointSet.AddRange(ip.GetPointsFrom(stroke)); |
|
5080 |
|
|
5081 |
PolygonControl pc = new PolygonControl() |
|
5082 | 5082 |
{ |
5083 | 5083 |
Angle = 0, |
5084 |
PointSet = new List<Point>(),
|
|
5084 |
PointSet = inkPointSet,
|
|
5085 | 5085 |
ControlType = ControlType.Ink |
5086 | 5086 |
}; |
5087 |
foreach (var item in removingStroke) |
|
5088 |
{ |
|
5089 |
inkPointSet.AddRange(ip.StrokeGetPointsPlus(item)); |
|
5090 |
inkBoard.Strokes.Remove(item); |
|
5091 |
} |
|
5092 |
if (inkPointSet.Count != 0) |
|
5093 |
{ |
|
5094 |
//강인구 추가(PenControl Undo Redo 추가) |
|
5095 |
UndoData = new Undo_data() |
|
5096 |
{ |
|
5097 |
IsUndo = false, |
|
5098 |
Event = Event_Type.Create, |
|
5099 |
EventTime = DateTime.Now, |
|
5100 |
Markup_List = new List<Multi_Undo_data>() |
|
5101 |
}; |
|
5087 |
pc.StartPoint = inkPointSet[0]; |
|
5088 |
pc.EndPoint = inkPointSet[inkPointSet.Count - 1]; |
|
5089 |
pc.LineSize = 3; |
|
5090 |
pc.CommentID = Commons.shortGuid(); |
|
5091 |
pc.StrokeColor = new SolidColorBrush(Colors.Red); |
|
5102 | 5092 |
|
5103 |
pc.StartPoint = inkPointSet[0]; |
|
5104 |
pc.EndPoint = inkPointSet[inkPointSet.Count - 1]; |
|
5105 |
pc.PointSet = inkPointSet; |
|
5106 |
pc.LineSize = 3; |
|
5107 |
pc.CommentID = Commons.shortGuid(); |
|
5108 |
pc.StrokeColor = new SolidColorBrush(Colors.Red); |
|
5093 |
if (pc.PointSet.Count > 0) |
|
5094 |
{ |
|
5095 |
CreateCommand.Instance.Execute(pc); |
|
5109 | 5096 |
ViewerDataModel.Instance.MarkupControls_USER.Add(pc); |
5110 |
///pc.SetPolyPath(); |
|
5111 |
|
|
5112 |
ViewerDataModel.Instance.UndoDataList.Where(data => data.IsUndo == true).ToList().ForEach(i => |
|
5113 |
{ |
|
5114 |
ViewerDataModel.Instance.UndoDataList.Remove(i); |
|
5115 |
}); |
|
5116 |
multi_Undo_Data.Markup = pc as CommentUserInfo; |
|
5117 |
UndoData.Markup_List.Add(multi_Undo_Data); |
|
5118 |
ViewerDataModel.Instance.UndoDataList.Add(UndoData); |
|
5119 | 5097 |
} |
5120 | 5098 |
}); |
5099 |
inkBoard.Strokes.Clear(); |
|
5121 | 5100 |
} |
5122 | 5101 |
} |
5123 | 5102 |
|
MarkupToPDF/Controls/Common/InkToPath.cs | ||
---|---|---|
1 |
using System; |
|
1 |
using MarkupToPDF.Controls.Polygon; |
|
2 |
using System; |
|
2 | 3 |
using System.Collections.Generic; |
3 | 4 |
using System.Linq; |
4 | 5 |
using System.Text; |
... | ... | |
28 | 29 |
return AllPoints; |
29 | 30 |
} |
30 | 31 |
|
31 |
public List<Point> StrokeGetPointsPlus(Stroke oStroke) |
|
32 |
/// <summary> |
|
33 |
/// get points form a stroke |
|
34 |
/// </summary> |
|
35 |
/// <param name="oStroke"></param> |
|
36 |
/// <returns></returns> |
|
37 |
public List<Point> GetPointsFrom(Stroke oStroke) |
|
32 | 38 |
{ |
33 | 39 |
System.Windows.Input.StylusPointCollection colStylusPoints = |
34 | 40 |
oStroke.StylusPoints; |
... | ... | |
117 | 123 |
|
118 | 124 |
return oPath; |
119 | 125 |
} |
120 |
|
|
121 | 126 |
} |
122 | 127 |
} |
내보내기 Unified diff