프로젝트

일반

사용자정보

개정판 5ae34a5e

ID5ae34a5e1714c74684251a56bfd6c97204f0b130
상위 15964263
하위 b2c03c2e

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

Feature: 도면 유사도 분류 기능 추가

Change-Id: Ide12dab6e2e4732ed05e0f592303b32ba60c5e78

차이점 보기:

ID2.Manager/ID2.Manager.Data/Models/Documents.cs
29 29
        public string SubSystemCode { get; set; }
30 30
        public string Team { get; set; }
31 31

  
32
        private string _Simularity = string.Empty;
33
        public string Simularity 
34
        { 
35
            get { return _Simularity; }
36
            set 
37
            {
38
                if(!_Simularity.Equals(value))
39
                {
40
                    _Simularity = value;
41
                    RaisePropertyChanged("Simularity");
42
                }
43
            } 
44
        }
45

  
32 46
        private string _RefProjectCode = string.Empty;
33 47
        //[DataMember]
34 48
        public string RefProjectCode
ID2.Manager/ID2.Manager/Controls/Classify.Designer.cs
1

2
namespace ID2.Manager.Controls
3
{
4
    partial class Classify
5
    {
6
        /// <summary> 
7
        /// 필수 디자이너 변수입니다.
8
        /// </summary>
9
        private System.ComponentModel.IContainer components = null;
10

  
11
        /// <summary> 
12
        /// 사용 중인 모든 리소스를 정리합니다.
13
        /// </summary>
14
        /// <param name="disposing">관리되는 리소스를 삭제해야 하면 true이고, 그렇지 않으면 false입니다.</param>
15
        protected override void Dispose(bool disposing)
16
        {
17
            if (disposing && (components != null))
18
            {
19
                components.Dispose();
20
            }
21
            base.Dispose(disposing);
22
        }
23

  
24
        #region 구성 요소 디자이너에서 생성한 코드
25

  
26
        /// <summary> 
27
        /// 디자이너 지원에 필요한 메서드입니다. 
28
        /// 이 메서드의 내용을 코드 편집기로 수정하지 마세요.
29
        /// </summary>
30
        private void InitializeComponent()
31
        {
32
            devDept.Eyeshot.CancelToolBarButton cancelToolBarButton2 = new devDept.Eyeshot.CancelToolBarButton("Cancel", devDept.Eyeshot.ToolBarButton.styleType.ToggleButton, true, true);
33
            devDept.Eyeshot.ProgressBar progressBar2 = new devDept.Eyeshot.ProgressBar(devDept.Eyeshot.ProgressBar.styleType.Circular, 0, "Idle", System.Drawing.Color.Black, System.Drawing.Color.Transparent, System.Drawing.Color.Green, 1D, true, cancelToolBarButton2, false, 0.1D, 0.333D, true);
34
            devDept.Graphics.BackgroundSettings backgroundSettings2 = new devDept.Graphics.BackgroundSettings(devDept.Graphics.backgroundStyleType.Solid, System.Drawing.Color.DeepSkyBlue, System.Drawing.Color.DodgerBlue, System.Drawing.Color.Black, 0.75D, null, devDept.Graphics.colorThemeType.Auto, 0.33D);
35
            devDept.Eyeshot.Camera camera2 = new devDept.Eyeshot.Camera(new devDept.Geometry.Point3D(-4.5374030325107811E-16D, 2.0434646606445308D, 47.596564948558793D), 97.257904648780823D, new devDept.Geometry.Quaternion(0.49999999999999989D, 0.5D, 0.5D, 0.50000000000000011D), devDept.Graphics.projectionType.Orthographic, 40D, 2.3787098441796113D, false, 0.001D);
36
            devDept.Eyeshot.MagnifyingGlassToolBarButton magnifyingGlassToolBarButton2 = new devDept.Eyeshot.MagnifyingGlassToolBarButton("Magnifying Glass", devDept.Eyeshot.ToolBarButton.styleType.ToggleButton, true, true);
37
            devDept.Eyeshot.ZoomWindowToolBarButton zoomWindowToolBarButton2 = new devDept.Eyeshot.ZoomWindowToolBarButton("Zoom Window", devDept.Eyeshot.ToolBarButton.styleType.ToggleButton, true, true);
38
            devDept.Eyeshot.ZoomToolBarButton zoomToolBarButton2 = new devDept.Eyeshot.ZoomToolBarButton("Zoom", devDept.Eyeshot.ToolBarButton.styleType.ToggleButton, true, true);
39
            devDept.Eyeshot.PanToolBarButton panToolBarButton2 = new devDept.Eyeshot.PanToolBarButton("Pan", devDept.Eyeshot.ToolBarButton.styleType.ToggleButton, true, true);
40
            devDept.Eyeshot.ZoomFitToolBarButton zoomFitToolBarButton2 = new devDept.Eyeshot.ZoomFitToolBarButton("Zoom Fit", devDept.Eyeshot.ToolBarButton.styleType.PushButton, true, true);
41
            devDept.Eyeshot.ToolBar toolBar2 = new devDept.Eyeshot.ToolBar(devDept.Eyeshot.ToolBar.positionType.HorizontalTopCenter, true, new devDept.Eyeshot.ToolBarButton[] {
42
            ((devDept.Eyeshot.ToolBarButton)(magnifyingGlassToolBarButton2)),
43
            ((devDept.Eyeshot.ToolBarButton)(zoomWindowToolBarButton2)),
44
            ((devDept.Eyeshot.ToolBarButton)(zoomToolBarButton2)),
45
            ((devDept.Eyeshot.ToolBarButton)(panToolBarButton2)),
46
            ((devDept.Eyeshot.ToolBarButton)(zoomFitToolBarButton2))});
47
            devDept.Eyeshot.Histogram histogram2 = new devDept.Eyeshot.Histogram(30, 80, "Title", System.Drawing.Color.Blue, System.Drawing.Color.Gray, System.Drawing.Color.Black, System.Drawing.Color.Red, System.Drawing.Color.LightYellow, false, true, false, "{0:+0.###;-0.###;0}");
48
            devDept.Eyeshot.Grid grid2 = new devDept.Eyeshot.Grid(new devDept.Geometry.Point2D(-100D, -100D), new devDept.Geometry.Point2D(100D, 100D), 10D, new devDept.Geometry.Plane(new devDept.Geometry.Point3D(0D, 0D, 0D), new devDept.Geometry.Vector3D(0D, 0D, 1D)), System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(128)))), ((int)(((byte)(128)))), ((int)(((byte)(128))))), System.Drawing.Color.FromArgb(((int)(((byte)(127)))), ((int)(((byte)(255)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))), System.Drawing.Color.FromArgb(((int)(((byte)(127)))), ((int)(((byte)(0)))), ((int)(((byte)(128)))), ((int)(((byte)(0))))), false, false, false, false, 10, 100, 10, System.Drawing.Color.FromArgb(((int)(((byte)(127)))), ((int)(((byte)(90)))), ((int)(((byte)(90)))), ((int)(((byte)(90))))), System.Drawing.Color.Transparent, false, System.Drawing.Color.FromArgb(((int)(((byte)(12)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(255))))));
49
            devDept.Eyeshot.OriginSymbol originSymbol2 = new devDept.Eyeshot.OriginSymbol(10, devDept.Eyeshot.originSymbolStyleType.Ball, new System.Drawing.Font("굴림", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129))), System.Drawing.Color.Black, System.Drawing.Color.Black, System.Drawing.Color.Black, System.Drawing.Color.Black, System.Drawing.Color.Red, System.Drawing.Color.Green, System.Drawing.Color.Blue, "Origin", "X", "Y", "Z", true, null, false);
50
            devDept.Eyeshot.RotateSettings rotateSettings2 = new devDept.Eyeshot.RotateSettings(new devDept.Eyeshot.MouseButton(devDept.Eyeshot.mouseButtonsZPR.Middle, devDept.Eyeshot.modifierKeys.None), 10D, false, 1D, devDept.Eyeshot.rotationType.Trackball, devDept.Eyeshot.rotationCenterType.CursorLocation, new devDept.Geometry.Point3D(0D, 0D, 0D), false);
51
            devDept.Eyeshot.ZoomSettings zoomSettings2 = new devDept.Eyeshot.ZoomSettings(new devDept.Eyeshot.MouseButton(devDept.Eyeshot.mouseButtonsZPR.Middle, devDept.Eyeshot.modifierKeys.Shift), 25, true, devDept.Eyeshot.zoomStyleType.AtCursorLocation, false, 1D, System.Drawing.Color.Empty, devDept.Eyeshot.Camera.perspectiveFitType.Accurate, false, 10, true);
52
            devDept.Eyeshot.PanSettings panSettings2 = new devDept.Eyeshot.PanSettings(new devDept.Eyeshot.MouseButton(devDept.Eyeshot.mouseButtonsZPR.Middle, devDept.Eyeshot.modifierKeys.Ctrl), 25, true);
53
            devDept.Eyeshot.NavigationSettings navigationSettings2 = new devDept.Eyeshot.NavigationSettings(devDept.Eyeshot.Camera.navigationType.Examine, new devDept.Eyeshot.MouseButton(devDept.Eyeshot.mouseButtonsZPR.Left, devDept.Eyeshot.modifierKeys.None), new devDept.Geometry.Point3D(-1000D, -1000D, -1000D), new devDept.Geometry.Point3D(1000D, 1000D, 1000D), 8D, 50D, 50D);
54
            devDept.Eyeshot.CoordinateSystemIcon coordinateSystemIcon2 = new devDept.Eyeshot.CoordinateSystemIcon(new System.Drawing.Font("굴림", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129))), System.Drawing.Color.Black, System.Drawing.Color.Black, System.Drawing.Color.Black, System.Drawing.Color.Black, System.Drawing.Color.FromArgb(((int)(((byte)(80)))), ((int)(((byte)(80)))), ((int)(((byte)(80))))), System.Drawing.Color.FromArgb(((int)(((byte)(80)))), ((int)(((byte)(80)))), ((int)(((byte)(80))))), System.Drawing.Color.OrangeRed, "Origin", "X", "Y", "Z", true, devDept.Eyeshot.coordinateSystemPositionType.BottomLeft, 37, null, false);
55
            devDept.Eyeshot.ViewCubeIcon viewCubeIcon2 = new devDept.Eyeshot.ViewCubeIcon(devDept.Eyeshot.coordinateSystemPositionType.TopRight, false, System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(20)))), ((int)(((byte)(60))))), true, "FRONT", "BACK", "LEFT", "RIGHT", "TOP", "BOTTOM", System.Drawing.Color.FromArgb(((int)(((byte)(240)))), ((int)(((byte)(77)))), ((int)(((byte)(77)))), ((int)(((byte)(77))))), System.Drawing.Color.FromArgb(((int)(((byte)(240)))), ((int)(((byte)(77)))), ((int)(((byte)(77)))), ((int)(((byte)(77))))), System.Drawing.Color.FromArgb(((int)(((byte)(240)))), ((int)(((byte)(77)))), ((int)(((byte)(77)))), ((int)(((byte)(77))))), System.Drawing.Color.FromArgb(((int)(((byte)(240)))), ((int)(((byte)(77)))), ((int)(((byte)(77)))), ((int)(((byte)(77))))), System.Drawing.Color.FromArgb(((int)(((byte)(240)))), ((int)(((byte)(77)))), ((int)(((byte)(77)))), ((int)(((byte)(77))))), System.Drawing.Color.FromArgb(((int)(((byte)(240)))), ((int)(((byte)(77)))), ((int)(((byte)(77)))), ((int)(((byte)(77))))), 'S', 'N', 'W', 'E', true, null, System.Drawing.Color.White, System.Drawing.Color.Black, 120, true, true, null, null, null, null, null, null, false, new devDept.Geometry.Quaternion(0D, 0D, 0D, 1D), true);
56
            devDept.Eyeshot.Viewport.SavedViewsManager savedViewsManager2 = new devDept.Eyeshot.Viewport.SavedViewsManager(8);
57
            devDept.Eyeshot.Viewport viewport2 = new devDept.Eyeshot.Viewport(new System.Drawing.Point(0, 0), new System.Drawing.Size(1064, 572), backgroundSettings2, camera2, new devDept.Eyeshot.ToolBar[] {
58
            toolBar2}, new devDept.Eyeshot.Legend[0], histogram2, devDept.Eyeshot.displayType.Wireframe, true, false, false, false, new devDept.Eyeshot.Grid[] {
59
            grid2}, new devDept.Eyeshot.OriginSymbol[] {
60
            originSymbol2}, false, rotateSettings2, zoomSettings2, panSettings2, navigationSettings2, coordinateSystemIcon2, viewCubeIcon2, savedViewsManager2, devDept.Eyeshot.viewType.Top);
61
            Telerik.WinControls.UI.GridViewCheckBoxColumn gridViewCheckBoxColumn2 = new Telerik.WinControls.UI.GridViewCheckBoxColumn();
62
            Telerik.WinControls.UI.GridViewTextBoxColumn gridViewTextBoxColumn3 = new Telerik.WinControls.UI.GridViewTextBoxColumn();
63
            Telerik.WinControls.UI.GridViewTextBoxColumn gridViewTextBoxColumn4 = new Telerik.WinControls.UI.GridViewTextBoxColumn();
64
            Telerik.WinControls.UI.TableViewDefinition tableViewDefinition2 = new Telerik.WinControls.UI.TableViewDefinition();
65
            this.radSplitContainer1 = new Telerik.WinControls.UI.RadSplitContainer();
66
            this.splitPanel1 = new Telerik.WinControls.UI.SplitPanel();
67
            this.radSplitContainer2 = new Telerik.WinControls.UI.RadSplitContainer();
68
            this.splitPanel2 = new Telerik.WinControls.UI.SplitPanel();
69
            this.radSplitContainer3 = new Telerik.WinControls.UI.RadSplitContainer();
70
            this.splitPanelAutoCAD = new Telerik.WinControls.UI.SplitPanel();
71
            this.tableLayoutPanel4 = new System.Windows.Forms.TableLayoutPanel();
72
            this.designDrawing = new devDept.Eyeshot.Design();
73
            this.radSplitContainerMain = new Telerik.WinControls.UI.RadSplitContainer();
74
            this.splitPanelDocument = new Telerik.WinControls.UI.SplitPanel();
75
            this.radGridViewDocument = new Telerik.WinControls.UI.RadGridView();
76
            this.splitPanel4 = new Telerik.WinControls.UI.SplitPanel();
77
            this.tableLayoutPanelMain = new System.Windows.Forms.TableLayoutPanel();
78
            this.tableLayoutPanel3 = new System.Windows.Forms.TableLayoutPanel();
79
            this.radLabel3 = new Telerik.WinControls.UI.RadLabel();
80
            this.radSpinEditorTolerance = new Telerik.WinControls.UI.RadSpinEditor();
81
            this.radButtonExceptLayer = new Telerik.WinControls.UI.RadButton();
82
            this.radButtonClassify = new Telerik.WinControls.UI.RadButton();
83
            this.splitPanel5 = new Telerik.WinControls.UI.SplitPanel();
84
            this.splitPanel3 = new Telerik.WinControls.UI.SplitPanel();
85
            this.radLabel1 = new Telerik.WinControls.UI.RadLabel();
86
            this.radSpinEditorSimularity = new Telerik.WinControls.UI.RadSpinEditor();
87
            this.radLabel4 = new Telerik.WinControls.UI.RadLabel();
88
            ((System.ComponentModel.ISupportInitialize)(this.radSplitContainer1)).BeginInit();
89
            this.radSplitContainer1.SuspendLayout();
90
            ((System.ComponentModel.ISupportInitialize)(this.splitPanel1)).BeginInit();
91
            this.splitPanel1.SuspendLayout();
92
            ((System.ComponentModel.ISupportInitialize)(this.radSplitContainer2)).BeginInit();
93
            this.radSplitContainer2.SuspendLayout();
94
            ((System.ComponentModel.ISupportInitialize)(this.splitPanel2)).BeginInit();
95
            this.splitPanel2.SuspendLayout();
96
            ((System.ComponentModel.ISupportInitialize)(this.radSplitContainer3)).BeginInit();
97
            this.radSplitContainer3.SuspendLayout();
98
            ((System.ComponentModel.ISupportInitialize)(this.splitPanelAutoCAD)).BeginInit();
99
            this.splitPanelAutoCAD.SuspendLayout();
100
            this.tableLayoutPanel4.SuspendLayout();
101
            ((System.ComponentModel.ISupportInitialize)(this.designDrawing)).BeginInit();
102
            ((System.ComponentModel.ISupportInitialize)(this.radSplitContainerMain)).BeginInit();
103
            this.radSplitContainerMain.SuspendLayout();
104
            ((System.ComponentModel.ISupportInitialize)(this.splitPanelDocument)).BeginInit();
105
            this.splitPanelDocument.SuspendLayout();
106
            ((System.ComponentModel.ISupportInitialize)(this.radGridViewDocument)).BeginInit();
107
            ((System.ComponentModel.ISupportInitialize)(this.radGridViewDocument.MasterTemplate)).BeginInit();
108
            ((System.ComponentModel.ISupportInitialize)(this.splitPanel4)).BeginInit();
109
            this.splitPanel4.SuspendLayout();
110
            this.tableLayoutPanelMain.SuspendLayout();
111
            this.tableLayoutPanel3.SuspendLayout();
112
            ((System.ComponentModel.ISupportInitialize)(this.radLabel3)).BeginInit();
113
            ((System.ComponentModel.ISupportInitialize)(this.radSpinEditorTolerance)).BeginInit();
114
            ((System.ComponentModel.ISupportInitialize)(this.radButtonExceptLayer)).BeginInit();
115
            ((System.ComponentModel.ISupportInitialize)(this.radButtonClassify)).BeginInit();
116
            ((System.ComponentModel.ISupportInitialize)(this.splitPanel5)).BeginInit();
117
            ((System.ComponentModel.ISupportInitialize)(this.splitPanel3)).BeginInit();
118
            ((System.ComponentModel.ISupportInitialize)(this.radLabel1)).BeginInit();
119
            ((System.ComponentModel.ISupportInitialize)(this.radSpinEditorSimularity)).BeginInit();
120
            ((System.ComponentModel.ISupportInitialize)(this.radLabel4)).BeginInit();
121
            this.SuspendLayout();
122
            // 
123
            // radSplitContainer1
124
            // 
125
            this.radSplitContainer1.Controls.Add(this.splitPanel1);
126
            this.radSplitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
127
            this.radSplitContainer1.Location = new System.Drawing.Point(0, 0);
128
            this.radSplitContainer1.Name = "radSplitContainer1";
129
            this.radSplitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal;
130
            // 
131
            // 
132
            // 
133
            this.radSplitContainer1.RootElement.MinSize = new System.Drawing.Size(25, 25);
134
            this.radSplitContainer1.Size = new System.Drawing.Size(1070, 578);
135
            this.radSplitContainer1.SizeInfo.AbsoluteSize = new System.Drawing.Size(0, 0);
136
            this.radSplitContainer1.SplitterWidth = 8;
137
            this.radSplitContainer1.TabIndex = 0;
138
            this.radSplitContainer1.TabStop = false;
139
            // 
140
            // splitPanel1
141
            // 
142
            this.splitPanel1.Controls.Add(this.radSplitContainer2);
143
            this.splitPanel1.Location = new System.Drawing.Point(0, 0);
144
            this.splitPanel1.Name = "splitPanel1";
145
            // 
146
            // 
147
            // 
148
            this.splitPanel1.RootElement.MinSize = new System.Drawing.Size(25, 25);
149
            this.splitPanel1.Size = new System.Drawing.Size(1070, 578);
150
            this.splitPanel1.SizeInfo.AutoSizeScale = new System.Drawing.SizeF(0.2820976F, 0.009803922F);
151
            this.splitPanel1.SizeInfo.SplitterCorrection = new System.Drawing.Size(312, 22);
152
            this.splitPanel1.TabIndex = 0;
153
            this.splitPanel1.TabStop = false;
154
            // 
155
            // radSplitContainer2
156
            // 
157
            this.radSplitContainer2.Controls.Add(this.splitPanel2);
158
            this.radSplitContainer2.Dock = System.Windows.Forms.DockStyle.Fill;
159
            this.radSplitContainer2.Location = new System.Drawing.Point(0, 0);
160
            this.radSplitContainer2.Name = "radSplitContainer2";
161
            this.radSplitContainer2.Orientation = System.Windows.Forms.Orientation.Horizontal;
162
            // 
163
            // 
164
            // 
165
            this.radSplitContainer2.RootElement.MinSize = new System.Drawing.Size(25, 25);
166
            this.radSplitContainer2.Size = new System.Drawing.Size(1070, 578);
167
            this.radSplitContainer2.SizeInfo.AbsoluteSize = new System.Drawing.Size(0, 0);
168
            this.radSplitContainer2.SplitterWidth = 8;
169
            this.radSplitContainer2.TabIndex = 0;
170
            this.radSplitContainer2.TabStop = false;
171
            // 
172
            // splitPanel2
173
            // 
174
            this.splitPanel2.Controls.Add(this.radSplitContainer3);
175
            this.splitPanel2.Location = new System.Drawing.Point(0, 0);
176
            this.splitPanel2.Name = "splitPanel2";
177
            // 
178
            // 
179
            // 
180
            this.splitPanel2.RootElement.MinSize = new System.Drawing.Size(25, 25);
181
            this.splitPanel2.Size = new System.Drawing.Size(1070, 578);
182
            this.splitPanel2.TabIndex = 0;
183
            this.splitPanel2.TabStop = false;
184
            this.splitPanel2.Text = "splitPanel2";
185
            // 
186
            // radSplitContainer3
187
            // 
188
            this.radSplitContainer3.Controls.Add(this.splitPanelAutoCAD);
189
            this.radSplitContainer3.Dock = System.Windows.Forms.DockStyle.Fill;
190
            this.radSplitContainer3.Location = new System.Drawing.Point(0, 0);
191
            this.radSplitContainer3.Name = "radSplitContainer3";
192
            // 
193
            // 
194
            // 
195
            this.radSplitContainer3.RootElement.MinSize = new System.Drawing.Size(25, 25);
196
            this.radSplitContainer3.Size = new System.Drawing.Size(1070, 578);
197
            this.radSplitContainer3.SizeInfo.AbsoluteSize = new System.Drawing.Size(0, 0);
198
            this.radSplitContainer3.SplitterWidth = 8;
199
            this.radSplitContainer3.TabIndex = 0;
200
            this.radSplitContainer3.TabStop = false;
201
            // 
202
            // splitPanelAutoCAD
203
            // 
204
            this.splitPanelAutoCAD.Controls.Add(this.tableLayoutPanel4);
205
            this.splitPanelAutoCAD.Location = new System.Drawing.Point(0, 0);
206
            this.splitPanelAutoCAD.Name = "splitPanelAutoCAD";
207
            // 
208
            // 
209
            // 
210
            this.splitPanelAutoCAD.RootElement.MinSize = new System.Drawing.Size(25, 25);
211
            this.splitPanelAutoCAD.Size = new System.Drawing.Size(1070, 578);
212
            this.splitPanelAutoCAD.SizeInfo.AbsoluteSize = new System.Drawing.Size(0, 0);
213
            this.splitPanelAutoCAD.TabIndex = 0;
214
            this.splitPanelAutoCAD.TabStop = false;
215
            this.splitPanelAutoCAD.Text = "splitPanel4";
216
            // 
217
            // tableLayoutPanel4
218
            // 
219
            this.tableLayoutPanel4.ColumnCount = 1;
220
            this.tableLayoutPanel4.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
221
            this.tableLayoutPanel4.Controls.Add(this.designDrawing, 0, 0);
222
            this.tableLayoutPanel4.Dock = System.Windows.Forms.DockStyle.Fill;
223
            this.tableLayoutPanel4.Location = new System.Drawing.Point(0, 0);
224
            this.tableLayoutPanel4.Name = "tableLayoutPanel4";
225
            this.tableLayoutPanel4.RowCount = 1;
226
            this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
227
            this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 518F));
228
            this.tableLayoutPanel4.Size = new System.Drawing.Size(1070, 578);
229
            this.tableLayoutPanel4.TabIndex = 1;
230
            // 
231
            // designDrawing
232
            // 
233
            this.designDrawing.Cursor = System.Windows.Forms.Cursors.Default;
234
            this.designDrawing.Dock = System.Windows.Forms.DockStyle.Fill;
235
            this.designDrawing.Location = new System.Drawing.Point(3, 3);
236
            this.designDrawing.Name = "designDrawing";
237
            this.designDrawing.ProgressBar = progressBar2;
238
            this.designDrawing.Size = new System.Drawing.Size(1064, 572);
239
            this.designDrawing.TabIndex = 0;
240
            this.designDrawing.Text = "design1";
241
            this.designDrawing.Viewports.Add(viewport2);
242
            // 
243
            // radSplitContainerMain
244
            // 
245
            this.radSplitContainerMain.Controls.Add(this.splitPanelDocument);
246
            this.radSplitContainerMain.Controls.Add(this.splitPanel4);
247
            this.radSplitContainerMain.Dock = System.Windows.Forms.DockStyle.Fill;
248
            this.radSplitContainerMain.Location = new System.Drawing.Point(0, 30);
249
            this.radSplitContainerMain.Name = "radSplitContainerMain";
250
            // 
251
            // 
252
            // 
253
            this.radSplitContainerMain.RootElement.MinSize = new System.Drawing.Size(25, 25);
254
            this.radSplitContainerMain.Size = new System.Drawing.Size(1328, 578);
255
            this.radSplitContainerMain.SizeInfo.AbsoluteSize = new System.Drawing.Size(0, 0);
256
            this.radSplitContainerMain.SplitterWidth = 8;
257
            this.radSplitContainerMain.TabIndex = 1;
258
            this.radSplitContainerMain.TabStop = false;
259
            // 
260
            // splitPanelDocument
261
            // 
262
            this.splitPanelDocument.Controls.Add(this.radGridViewDocument);
263
            this.splitPanelDocument.Location = new System.Drawing.Point(0, 0);
264
            this.splitPanelDocument.Name = "splitPanelDocument";
265
            // 
266
            // 
267
            // 
268
            this.splitPanelDocument.RootElement.MinSize = new System.Drawing.Size(25, 25);
269
            this.splitPanelDocument.Size = new System.Drawing.Size(250, 578);
270
            this.splitPanelDocument.SizeInfo.AbsoluteSize = new System.Drawing.Size(250, 200);
271
            this.splitPanelDocument.SizeInfo.SizeMode = Telerik.WinControls.UI.Docking.SplitPanelSizeMode.Absolute;
272
            this.splitPanelDocument.TabIndex = 0;
273
            this.splitPanelDocument.TabStop = false;
274
            // 
275
            // radGridViewDocument
276
            // 
277
            this.radGridViewDocument.Dock = System.Windows.Forms.DockStyle.Fill;
278
            this.radGridViewDocument.Location = new System.Drawing.Point(0, 0);
279
            // 
280
            // 
281
            // 
282
            this.radGridViewDocument.MasterTemplate.AllowAddNewRow = false;
283
            this.radGridViewDocument.MasterTemplate.AllowDeleteRow = false;
284
            this.radGridViewDocument.MasterTemplate.AllowSearchRow = true;
285
            gridViewCheckBoxColumn2.EnableHeaderCheckBox = true;
286
            gridViewCheckBoxColumn2.HeaderText = "Checked";
287
            gridViewCheckBoxColumn2.MaxWidth = 30;
288
            gridViewCheckBoxColumn2.Name = "Checked";
289
            gridViewCheckBoxColumn2.Width = 20;
290
            gridViewTextBoxColumn3.FieldName = "DocumentNo";
291
            gridViewTextBoxColumn3.HeaderText = "DocumentNo";
292
            gridViewTextBoxColumn3.Name = "columnDocumentNo";
293
            gridViewTextBoxColumn3.ReadOnly = true;
294
            gridViewTextBoxColumn4.FieldName = "Simularity";
295
            gridViewTextBoxColumn4.HeaderText = "Simularity";
296
            gridViewTextBoxColumn4.Name = "Simularity";
297
            this.radGridViewDocument.MasterTemplate.Columns.AddRange(new Telerik.WinControls.UI.GridViewDataColumn[] {
298
            gridViewCheckBoxColumn2,
299
            gridViewTextBoxColumn3,
300
            gridViewTextBoxColumn4});
301
            this.radGridViewDocument.MasterTemplate.ViewDefinition = tableViewDefinition2;
302
            this.radGridViewDocument.Name = "radGridViewDocument";
303
            this.radGridViewDocument.Size = new System.Drawing.Size(250, 578);
304
            this.radGridViewDocument.TabIndex = 0;
305
            // 
306
            // splitPanel4
307
            // 
308
            this.splitPanel4.Controls.Add(this.radSplitContainer1);
309
            this.splitPanel4.Location = new System.Drawing.Point(258, 0);
310
            this.splitPanel4.Name = "splitPanel4";
311
            // 
312
            // 
313
            // 
314
            this.splitPanel4.RootElement.MinSize = new System.Drawing.Size(25, 25);
315
            this.splitPanel4.Size = new System.Drawing.Size(1070, 578);
316
            this.splitPanel4.TabIndex = 1;
317
            this.splitPanel4.TabStop = false;
318
            this.splitPanel4.Text = "splitPanel4";
319
            // 
320
            // tableLayoutPanelMain
321
            // 
322
            this.tableLayoutPanelMain.ColumnCount = 1;
323
            this.tableLayoutPanelMain.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
324
            this.tableLayoutPanelMain.Controls.Add(this.radSplitContainerMain, 0, 1);
325
            this.tableLayoutPanelMain.Controls.Add(this.tableLayoutPanel3, 0, 0);
326
            this.tableLayoutPanelMain.Dock = System.Windows.Forms.DockStyle.Fill;
327
            this.tableLayoutPanelMain.Location = new System.Drawing.Point(0, 0);
328
            this.tableLayoutPanelMain.Name = "tableLayoutPanelMain";
329
            this.tableLayoutPanelMain.RowCount = 2;
330
            this.tableLayoutPanelMain.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 30F));
331
            this.tableLayoutPanelMain.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
332
            this.tableLayoutPanelMain.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
333
            this.tableLayoutPanelMain.Size = new System.Drawing.Size(1328, 608);
334
            this.tableLayoutPanelMain.TabIndex = 2;
335
            // 
336
            // tableLayoutPanel3
337
            // 
338
            this.tableLayoutPanel3.ColumnCount = 13;
339
            this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 80F));
340
            this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 120F));
341
            this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 80F));
342
            this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 120F));
343
            this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 30F));
344
            this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 120F));
345
            this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 100F));
346
            this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 120F));
347
            this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 100F));
348
            this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 120F));
349
            this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
350
            this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 28F));
351
            this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 60F));
352
            this.tableLayoutPanel3.Controls.Add(this.radLabel3, 0, 0);
353
            this.tableLayoutPanel3.Controls.Add(this.radSpinEditorTolerance, 1, 0);
354
            this.tableLayoutPanel3.Controls.Add(this.radButtonExceptLayer, 11, 0);
355
            this.tableLayoutPanel3.Controls.Add(this.radButtonClassify, 12, 0);
356
            this.tableLayoutPanel3.Controls.Add(this.radLabel1, 2, 0);
357
            this.tableLayoutPanel3.Controls.Add(this.radSpinEditorSimularity, 3, 0);
358
            this.tableLayoutPanel3.Controls.Add(this.radLabel4, 4, 0);
359
            this.tableLayoutPanel3.Dock = System.Windows.Forms.DockStyle.Fill;
360
            this.tableLayoutPanel3.Location = new System.Drawing.Point(3, 3);
361
            this.tableLayoutPanel3.Name = "tableLayoutPanel3";
362
            this.tableLayoutPanel3.RowCount = 1;
363
            this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
364
            this.tableLayoutPanel3.Size = new System.Drawing.Size(1322, 24);
365
            this.tableLayoutPanel3.TabIndex = 4;
366
            // 
367
            // radLabel3
368
            // 
369
            this.radLabel3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
370
            this.radLabel3.Location = new System.Drawing.Point(3, 3);
371
            this.radLabel3.Name = "radLabel3";
372
            this.radLabel3.Size = new System.Drawing.Size(63, 18);
373
            this.radLabel3.TabIndex = 0;
374
            this.radLabel3.Text = "Tolerance : ";
375
            // 
376
            // radSpinEditorTolerance
377
            // 
378
            this.radSpinEditorTolerance.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
379
            this.radSpinEditorTolerance.DecimalPlaces = 2;
380
            this.radSpinEditorTolerance.Increment = new decimal(new int[] {
381
            1,
382
            0,
383
            0,
384
            131072});
385
            this.radSpinEditorTolerance.Location = new System.Drawing.Point(123, 3);
386
            this.radSpinEditorTolerance.Name = "radSpinEditorTolerance";
387
            this.radSpinEditorTolerance.Size = new System.Drawing.Size(114, 20);
388
            this.radSpinEditorTolerance.TabIndex = 1;
389
            // 
390
            // radButtonExceptLayer
391
            // 
392
            this.radButtonExceptLayer.Dock = System.Windows.Forms.DockStyle.Fill;
393
            this.radButtonExceptLayer.Location = new System.Drawing.Point(1237, 3);
394
            this.radButtonExceptLayer.Name = "radButtonExceptLayer";
395
            this.radButtonExceptLayer.Size = new System.Drawing.Size(22, 18);
396
            this.radButtonExceptLayer.TabIndex = 6;
397
            this.radButtonExceptLayer.Text = "...";
398
            // 
399
            // radButtonClassify
400
            // 
401
            this.radButtonClassify.Dock = System.Windows.Forms.DockStyle.Fill;
402
            this.radButtonClassify.Location = new System.Drawing.Point(1265, 3);
403
            this.radButtonClassify.Name = "radButtonClassify";
404
            this.radButtonClassify.Size = new System.Drawing.Size(54, 18);
405
            this.radButtonClassify.TabIndex = 9;
406
            this.radButtonClassify.Text = "Classify";
407
            // 
408
            // splitPanel5
409
            // 
410
            this.splitPanel5.Location = new System.Drawing.Point(102, 0);
411
            this.splitPanel5.Name = "splitPanel5";
412
            // 
413
            // 
414
            // 
415
            this.splitPanel5.RootElement.MinSize = new System.Drawing.Size(25, 25);
416
            this.splitPanel5.Size = new System.Drawing.Size(98, 200);
417
            this.splitPanel5.SizeInfo.AbsoluteSize = new System.Drawing.Size(0, 0);
418
            this.splitPanel5.TabIndex = 1;
419
            this.splitPanel5.TabStop = false;
420
            // 
421
            // splitPanel3
422
            // 
423
            this.splitPanel3.Location = new System.Drawing.Point(0, 0);
424
            this.splitPanel3.Name = "splitPanel3";
425
            // 
426
            // 
427
            // 
428
            this.splitPanel3.RootElement.MinSize = new System.Drawing.Size(25, 25);
429
            this.splitPanel3.Size = new System.Drawing.Size(98, 200);
430
            this.splitPanel3.TabIndex = 0;
431
            this.splitPanel3.TabStop = false;
432
            // 
433
            // radLabel1
434
            // 
435
            this.radLabel1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
436
            this.radLabel1.Location = new System.Drawing.Point(243, 3);
437
            this.radLabel1.Name = "radLabel1";
438
            this.radLabel1.Size = new System.Drawing.Size(64, 18);
439
            this.radLabel1.TabIndex = 10;
440
            this.radLabel1.Text = "Simularity : ";
441
            // 
442
            // radSpinEditorSimularity
443
            // 
444
            this.radSpinEditorSimularity.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
445
            this.radSpinEditorSimularity.Location = new System.Drawing.Point(323, 3);
446
            this.radSpinEditorSimularity.Name = "radSpinEditorSimularity";
447
            this.radSpinEditorSimularity.NullableValue = new decimal(new int[] {
448
            80,
449
            0,
450
            0,
451
            0});
452
            this.radSpinEditorSimularity.Size = new System.Drawing.Size(114, 20);
453
            this.radSpinEditorSimularity.TabIndex = 11;
454
            this.radSpinEditorSimularity.Value = new decimal(new int[] {
455
            80,
456
            0,
457
            0,
458
            0});
459
            // 
460
            // radLabel4
461
            // 
462
            this.radLabel4.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
463
            this.radLabel4.Location = new System.Drawing.Point(443, 3);
464
            this.radLabel4.Name = "radLabel4";
465
            this.radLabel4.Size = new System.Drawing.Size(22, 18);
466
            this.radLabel4.TabIndex = 12;
467
            this.radLabel4.Text = "(%)";
468
            // 
469
            // Classify
470
            // 
471
            this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
472
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
473
            this.Controls.Add(this.tableLayoutPanelMain);
474
            this.Name = "Classify";
475
            this.Size = new System.Drawing.Size(1328, 608);
476
            ((System.ComponentModel.ISupportInitialize)(this.radSplitContainer1)).EndInit();
477
            this.radSplitContainer1.ResumeLayout(false);
478
            ((System.ComponentModel.ISupportInitialize)(this.splitPanel1)).EndInit();
479
            this.splitPanel1.ResumeLayout(false);
480
            ((System.ComponentModel.ISupportInitialize)(this.radSplitContainer2)).EndInit();
481
            this.radSplitContainer2.ResumeLayout(false);
482
            ((System.ComponentModel.ISupportInitialize)(this.splitPanel2)).EndInit();
483
            this.splitPanel2.ResumeLayout(false);
484
            ((System.ComponentModel.ISupportInitialize)(this.radSplitContainer3)).EndInit();
485
            this.radSplitContainer3.ResumeLayout(false);
486
            ((System.ComponentModel.ISupportInitialize)(this.splitPanelAutoCAD)).EndInit();
487
            this.splitPanelAutoCAD.ResumeLayout(false);
488
            this.tableLayoutPanel4.ResumeLayout(false);
489
            ((System.ComponentModel.ISupportInitialize)(this.designDrawing)).EndInit();
490
            ((System.ComponentModel.ISupportInitialize)(this.radSplitContainerMain)).EndInit();
491
            this.radSplitContainerMain.ResumeLayout(false);
492
            ((System.ComponentModel.ISupportInitialize)(this.splitPanelDocument)).EndInit();
493
            this.splitPanelDocument.ResumeLayout(false);
494
            ((System.ComponentModel.ISupportInitialize)(this.radGridViewDocument.MasterTemplate)).EndInit();
495
            ((System.ComponentModel.ISupportInitialize)(this.radGridViewDocument)).EndInit();
496
            ((System.ComponentModel.ISupportInitialize)(this.splitPanel4)).EndInit();
497
            this.splitPanel4.ResumeLayout(false);
498
            this.tableLayoutPanelMain.ResumeLayout(false);
499
            this.tableLayoutPanel3.ResumeLayout(false);
500
            this.tableLayoutPanel3.PerformLayout();
501
            ((System.ComponentModel.ISupportInitialize)(this.radLabel3)).EndInit();
502
            ((System.ComponentModel.ISupportInitialize)(this.radSpinEditorTolerance)).EndInit();
503
            ((System.ComponentModel.ISupportInitialize)(this.radButtonExceptLayer)).EndInit();
504
            ((System.ComponentModel.ISupportInitialize)(this.radButtonClassify)).EndInit();
505
            ((System.ComponentModel.ISupportInitialize)(this.splitPanel5)).EndInit();
506
            ((System.ComponentModel.ISupportInitialize)(this.splitPanel3)).EndInit();
507
            ((System.ComponentModel.ISupportInitialize)(this.radLabel1)).EndInit();
508
            ((System.ComponentModel.ISupportInitialize)(this.radSpinEditorSimularity)).EndInit();
509
            ((System.ComponentModel.ISupportInitialize)(this.radLabel4)).EndInit();
510
            this.ResumeLayout(false);
511

  
512
        }
513

  
514
        #endregion
515

  
516
        private Telerik.WinControls.UI.RadSplitContainer radSplitContainer1;
517
        private Telerik.WinControls.UI.SplitPanel splitPanel1;
518
        private Telerik.WinControls.UI.RadSplitContainer radSplitContainer2;
519
        private Telerik.WinControls.UI.SplitPanel splitPanel2;
520
        private Telerik.WinControls.UI.RadSplitContainer radSplitContainer3;
521
        private Telerik.WinControls.UI.SplitPanel splitPanelAutoCAD;
522
        private devDept.Eyeshot.Design designDrawing;
523
        private Telerik.WinControls.UI.RadSplitContainer radSplitContainerMain;
524
        private Telerik.WinControls.UI.SplitPanel splitPanelDocument;
525
        private Telerik.WinControls.UI.SplitPanel splitPanel4;
526
        private Telerik.WinControls.UI.RadGridView radGridViewDocument;
527
        private System.Windows.Forms.TableLayoutPanel tableLayoutPanelMain;
528
        private System.Windows.Forms.TableLayoutPanel tableLayoutPanel3;
529
        private Telerik.WinControls.UI.RadLabel radLabel3;
530
        private Telerik.WinControls.UI.RadSpinEditor radSpinEditorTolerance;
531
        private Telerik.WinControls.UI.SplitPanel splitPanel5;
532
        private Telerik.WinControls.UI.SplitPanel splitPanel3;
533
        private Telerik.WinControls.UI.RadButton radButtonExceptLayer;
534
        private System.Windows.Forms.TableLayoutPanel tableLayoutPanel4;
535
        private Telerik.WinControls.UI.RadButton radButtonClassify;
536
        private Telerik.WinControls.UI.RadLabel radLabel1;
537
        private Telerik.WinControls.UI.RadSpinEditor radSpinEditorSimularity;
538
        private Telerik.WinControls.UI.RadLabel radLabel4;
539
    }
540
}
ID2.Manager/ID2.Manager/Controls/Classify.cs
1
using devDept.Eyeshot;
2
using devDept.Eyeshot.Entities;
3
using devDept.Eyeshot.Translators;
4
using devDept.Geometry.Entities;
5
using ID2.Manager.Common;
6
using ID2.Manager.Data.Models;
7
using System;
8
using System.Collections.Generic;
9
using System.ComponentModel;
10
using System.Data;
11
using System.Drawing;
12
using System.IO;
13
using System.Linq;
14
using System.Runtime.InteropServices;
15
using System.Text;
16
using System.Threading.Tasks;
17
using System.Windows.Forms;
18
using Telerik.WinControls;
19
using Telerik.WinControls.UI;
20
using Telerik.Windows.Documents.Fixed.FormatProviders.Pdf;
21
using Telerik.Windows.Documents.Fixed.Model;
22
using Telerik.Windows.Documents.Fixed.Model.Editing;
23

  
24
namespace ID2.Manager.Controls
25
{
26
    public partial class Classify : UserControl
27
    {
28
        public delegate void DocumentSelected(Documents doc);
29

  
30
        readonly Informations informations = Informations.Instance;
31
        readonly string IniFilePath = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), 
32
            Application.ProductName, $"{Application.ProductName}.ini");
33

  
34
        #region 기본값
35
        private static string AutoCADLayer { get; } = "AutoCAD";
36
        private static Color AutoCADColor = Color.FromArgb(44, 44, 44);
37
        private static string AVEVALayer { get; } = "AVEVA";
38
        private static Color AVEVAColor = Color.FromArgb(44, 44, 44);
39
        private static Color DiffColor = Color.Yellow;
40
        private static Color RevCloudColor = Color.Magenta;
41
        private static double Tolerance = 0;
42
        private static double Simularity { get; set; } = 80;
43
        private static double LengthToleranceRatio { get; set; } = 0.1;
44

  
45
        private string dwgExtension { get; } = ".dwg";
46
        #endregion
47

  
48
        class DrawingGroup
49
        {
50
            public string GroupNo { get; } = Guid.NewGuid().ToString();
51
            public List<string> Drawings {get;} = new List<string>();
52
        }
53

  
54
        private RadProgressBarElement _progressBar = null;
55

  
56
        public Classify(RadProgressBarElement progressBar)
57
        {
58
            InitializeComponent();
59
            this.radGridViewDocument.AutoSizeColumnsMode = Telerik.WinControls.UI.GridViewAutoSizeColumnsMode.Fill;
60

  
61
            this.Load += Verification_Load;
62
            this.radSpinEditorTolerance.ValueChanged += RadSpinEditorTolerance_ValueChanged;
63
            this.radButtonExceptLayer.Click += RadButtonExceptLayer_Click;
64
            this.radSpinEditorSimularity.ValueChanged += RadSpinEditorSimularity_ValueChanged;
65

  
66
            this.radButtonClassify.Click += RadButtonClassify_Click;
67

  
68
            this.designDrawing.ActionMode = actionType.SelectVisibleByPickDynamic;
69
            this.designDrawing.Selection.ColorDynamic = Color.FromArgb(80, Color.OrangeRed);
70
            this.designDrawing.Selection.HaloInnerColor = Color.FromArgb(255, Color.OrangeRed);
71
            this.designDrawing.Selection.HaloOuterColor = Color.FromArgb(64, Color.OrangeRed);
72
            this.designDrawing.Selection.HaloWidthPolygons = 4;
73
            this.designDrawing.Selection.HaloWidthWires = 2;
74

  
75
            _progressBar = progressBar;
76
        }
77

  
78
        private void RadSpinEditorSimularity_ValueChanged(object sender, EventArgs e)
79
        {
80
            double simularity = Convert.ToDouble(this.radSpinEditorSimularity.Value);
81
            Classes.ID2Helper.IniWriteValue(IniFilePath, "Verification", "Simularity", simularity.ToString());
82
            Classify.Simularity = simularity;
83
        }
84

  
85
        private void RadButtonClassify_Click(object sender, EventArgs e)
86
        {
87
            void OpenDrawing(string FilePath, string LayerName, Color color)
88
            {
89
                if (!File.Exists(FilePath)) return;
90
                #region 다른 프로세스에서 파일을 열고 있는 경우 처리
91
                using (var fs = File.Open(FilePath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
92
                #endregion
93

  
94
                {
95
                    devDept.Eyeshot.Translators.ReadAutodesk ra = new devDept.Eyeshot.Translators.ReadAutodesk(fs);
96
                    ra.DoWork();
97
                    var min = ra.Min;
98
                    if (!ra.Layers.Contains(LayerName)) ra.Layers.Add(LayerName, color);
99
                    foreach (var ent in ra.Entities)
100
                    {
101
                        /// 도면을 원점으로 맞춘다.
102
                        if (min.X != 0 && min.Y != 0) ent.Translate(-min.X, -min.Y);
103
                        ent.LayerName = LayerName;
104
                    }
105
                    ra.AddToScene(designDrawing);
106
                }
107
            }
108

  
109
            var DrawingGroupColl = new List<DrawingGroup>();
110

  
111
            var docs = this.radGridViewDocument.Rows.Where(x => Convert.ToBoolean(x.Cells["Checked"].Value))
112
                .Select(x => x.DataBoundItem as ID2.Manager.Data.Models.Documents).ToList();
113
            docs.ForEach(x => x.Simularity = string.Empty);
114

  
115
            #region 전체 비교 횟수 파악
116
            int sum = 0;
117
            for (int i = 0; i < docs.Count - 1; ++i)
118
            {
119
                for (int j = i + 1; j < docs.Count; ++j) sum++;
120
            }
121
            #endregion
122
            _progressBar.Maximum = sum;
123
            _progressBar.Value1 = 0;
124
            for (int i = 0;i < docs.Count - 1;++i)
125
            {
126
                string FirstDwgFolder = System.IO.Path.Combine(informations.FindID2LocalPath(docs.ElementAt(i).RefProjectCode), "drawings", "Native");
127
                string FirstDocNo = docs.ElementAt(i).DocumentNo;
128
                string FirstFilePath = System.IO.Path.Combine(FirstDwgFolder, $"{FirstDocNo}{dwgExtension}");
129
                for (int j = i + 1;j < docs.Count;++j)
130
                {
131
                    this.designDrawing.Entities.Clear();
132
                    this.designDrawing.Blocks.Clear();
133

  
134
                    OpenDrawing(FirstFilePath, "First", Color.FromArgb(44, 44, 44));
135

  
136
                    string SecondDwgFolder = System.IO.Path.Combine(informations.FindID2LocalPath(docs.ElementAt(j).RefProjectCode), "drawings", "Native");
137
                    string SecondDocNo = docs.ElementAt(j).DocumentNo;
138
                    string SecondFilePath = System.IO.Path.Combine(SecondDwgFolder, $"{SecondDocNo}{dwgExtension}");
139
                    OpenDrawing(SecondFilePath, "Second", Color.FromArgb(155, 155, 155));
140

  
141
                    var FirstEntities = this.designDrawing.Entities.Where(x => x.LayerName == "First").ToList();
142
                    var SecondEntities = this.designDrawing.Entities.Where(x => x.LayerName == "Second").ToList();
143
                    if (FirstEntities.Any() && SecondEntities.Any())
144
                    {
145
                        double simularity = 100 - CompareDrawing(designDrawing, FirstEntities, SecondEntities);
146
                        if (simularity >= Classify.Simularity)
147
                        {
148
                            var group = DrawingGroupColl.FirstOrDefault(x => x.Drawings.Exists(y => y.Equals(FirstDocNo) || y.Equals(SecondDocNo)));
149
                            if (group != null)
150
                            {
151
                                if (!group.Drawings.Exists(x => x.Equals(FirstDocNo))) group.Drawings.Add(FirstDocNo);
152
                                if (!group.Drawings.Exists(x => x.Equals(SecondDocNo))) group.Drawings.Add(SecondDocNo);
153
                            }
154
                            else
155
                            {
156
                                group = new DrawingGroup();
157
                                group.Drawings.Add(FirstDocNo);
158
                                group.Drawings.Add(SecondDocNo);
159
                                DrawingGroupColl.Add(group);
160
                            }
161
                        }
162
                    }
163

  
164
                    _progressBar.Value1 += 1;
165
                    Application.DoEvents();
166
                }
167
            }
168

  
169
            foreach(var group in DrawingGroupColl)
170
            {
171
                group.Drawings.ForEach(x =>
172
                {
173
                    var doc = docs.FirstOrDefault(y => y.DocumentNo.Equals(x));
174
                    if (doc != null) doc.Simularity = group.GroupNo;
175
                });
176
            }
177

  
178
            RadMessageBox.Show("Classifying drawing is complete.");
179
        }
180

  
181
        /// <summary>
182
        /// Except Layer 폼을 띄운다.
183
        /// </summary>
184
        /// <param name="sender"></param>
185
        /// <param name="e"></param>
186
        private void RadButtonExceptLayer_Click(object sender, EventArgs e)
187
        {
188
            using(var frm = new Forms.ExceptLayer())
189
            {
190
                if(DialogResult.OK == frm.ShowDialog(this))
191
                {
192
                    string ExceptLayers = string.Join(",", Forms.ExceptLayer.ExceptLayers.Select(x => x.Name));
193
                    Classes.ID2Helper.IniWriteValue(IniFilePath, "Verification", "Except Layers", ExceptLayers);
194

  
195
                    string ExceptLayersVisible = string.Join(",", Forms.ExceptLayer.ExceptLayers.Select(x => x.Visible));
196
                    Classes.ID2Helper.IniWriteValue(IniFilePath, "Verification", "Except Layers Visible", ExceptLayersVisible);
197
                }
198
            }
199
        }
200

  
201
        /// <summary>
202
        /// 수정한 Tolerance를 시스템에 반영한다.
203
        /// </summary>
204
        /// <param name="sender"></param>
205
        /// <param name="e"></param>
206
        private void RadSpinEditorTolerance_ValueChanged(object sender, EventArgs e)
207
        {
208
            double toler = Convert.ToDouble(this.radSpinEditorTolerance.Value);
209
            Classes.ID2Helper.IniWriteValue(IniFilePath, "Verification", "Tolerance", toler.ToString());
210
            Classify.Tolerance = toler;
211
        }
212

  
213
        private void Verification_Load(object sender, EventArgs e)
214
        {
215
            string Toler = Classes.ID2Helper.IniReadValue(IniFilePath, "Verification", "Tolerance");
216
            if (!string.IsNullOrEmpty(Toler))
217
            {
218
                this.radSpinEditorTolerance.Value = Convert.ToDecimal(Toler);
219
                Classify.Tolerance = Convert.ToDouble(this.radSpinEditorTolerance.Value);
220
            }
221

  
222
            string Simularity = Classes.ID2Helper.IniReadValue(IniFilePath, "Verification", "Simularity");
223
            if (!string.IsNullOrEmpty(Simularity))
224
            {
225
                this.radSpinEditorSimularity.Value = Convert.ToDecimal(Simularity);
226
                Classify.Simularity = Convert.ToDouble(this.radSpinEditorSimularity.Value);
227
            }
228

  
229
            string _LengthToleranceRatio = Classes.ID2Helper.IniReadValue(IniFilePath, "Verification", "Length Tolerance Ratio");
230
            if (!string.IsNullOrEmpty(_LengthToleranceRatio))
231
            {
232
                LengthToleranceRatio = Convert.ToDouble(_LengthToleranceRatio);
233
            }
234

  
235
            #region Except Layer를 로딩한다.
236
            string _ExceptLayers = Classes.ID2Helper.IniReadValue(IniFilePath, "Verification", "Except Layers");
237
            if (!string.IsNullOrEmpty(_ExceptLayers))
238
            {
239
                Forms.ExceptLayer.ExceptLayers.AddRange(_ExceptLayers.Split(',').ToList().ConvertAll(x => new Forms.ExceptLayer.Layer(x)));
240

  
241
                string _ExceptLayersVisible = Classes.ID2Helper.IniReadValue(IniFilePath, "Verification", "Except Layers Visible");
242
                if (!string.IsNullOrEmpty(_ExceptLayersVisible))
243
                {
244
                    var tokens = _ExceptLayersVisible.Split(',').ToList().ConvertAll(x => Convert.ToBoolean(x));
245
                    for (int i = 0; i < Forms.ExceptLayer.ExceptLayers.Count; ++i)
246
                    {
247
                        if (i < tokens.Count)
248
                        {
249
                            Forms.ExceptLayer.ExceptLayers[i].Visible = tokens[i];
250
                        }
251
                    }
252
                }
253
            }
254
            #endregion
255

  
256
            this.radGridViewDocument.CellDoubleClick += RadGridViewDocument_CellDoubleClick;
257
        }
258

  
259
        /// <summary>
260
        /// 더블 클릭한 도면을 연다.
261
        /// </summary>
262
        /// <param name="sender"></param>
263
        /// <param name="e"></param>
264
        private void RadGridViewDocument_CellDoubleClick(object sender, GridViewCellEventArgs e)
265
        {
266
            var doc = (sender as GridDataCellElement).RowInfo.DataBoundItem as Documents;
267
            string DwgFolder = System.IO.Path.Combine(informations.FindID2LocalPath(doc.RefProjectCode), "drawings", "Native");
268
            string DocNo = doc.DocumentNo;
269
            string FilePath = System.IO.Path.Combine(DwgFolder, $"{DocNo}{dwgExtension}");
270

  
271
            if (!File.Exists(FilePath))
272
            {
273
                RadMessageBox.Show("File doesn't exist");
274
                return;
275
            }
276
            #region 다른 프로세스에서 파일을 열고 있는 경우 처리
277
            using (var fs = File.Open(FilePath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
278
            #endregion
279

  
280
            {
281
                designDrawing.Blocks.Clear();
282
                designDrawing.Entities.Clear();
283

  
284
                devDept.Eyeshot.Translators.ReadAutodesk ra = new devDept.Eyeshot.Translators.ReadAutodesk(fs);
285
                ra.DoWork();
286
                ra.AddToScene(designDrawing);
287

  
288
                designDrawing.Invalidate();
289
            }
290
        }
291

  
292
        /// <summary>
293
        /// 두 도면의 엔터티들을 비교한다.
294
        /// <return>차이점을 %로 리턴한다.</return>
295
        /// </summary>
296
        private double CompareDrawing(Design design, IList<Entity> FirstEntities, IList<Entity> SecondEntities)
297
        {
298
            bool[] equalEntitiesInV2 = new bool[FirstEntities.Count];
299
            var EqualIndices = new List<int>();
300

  
301
            /// 서로 검사 가능한 타입인지 확인한다.
302
            bool CheckType(Entity ent1, Entity ent2)
303
            {
304
                return ent1.GetType() == ent2.GetType() ||
305
                    (ent1.GetType() == typeof(devDept.Eyeshot.Entities.Text) && ent2.GetType() == typeof(devDept.Eyeshot.Entities.MultilineText)) ||
306
                    (ent1.GetType() == typeof(devDept.Eyeshot.Entities.MultilineText) && ent2.GetType() == typeof(devDept.Eyeshot.Entities.Text)) ||
307
                    (ent1.GetType() == typeof(devDept.Eyeshot.Entities.Line) && ent2.GetType() == typeof(devDept.Eyeshot.Entities.TabulatedSurface)) ||
308
                    (ent1.GetType() == typeof(devDept.Eyeshot.Entities.Attribute) && ent2.GetType() == typeof(devDept.Eyeshot.Entities.Text)) ||
309
                    (ent1.GetType() == typeof(devDept.Eyeshot.Entities.Attribute) && ent2.GetType() == typeof(devDept.Eyeshot.Entities.MultilineText));
310
            }
311

  
312
            int[] differents = new int[2] { 0, 0 };
313
            try
314
            {
315
                for (int i = 0; i < FirstEntities.Count(); i++)
316
                {
317
                    Entity entVp1 = FirstEntities[i];
318
                    EqualIndices.Clear();
319

  
320
                    for (int j = 0; j < SecondEntities.Count(); j++)
321
                    {
322
                        Entity entVp2 = SecondEntities[j];
323

  
324
                        if (!equalEntitiesInV2[j] && CheckType(entVp1, entVp2) &&
325
                            CompareIfEqual(design, entVp1, design, entVp2))
326
                        {
327
                            EqualIndices.Add(j);
328
                        }
329
                    }
330

  
331
                    #region 임계값 안에 들어오는 항목이 여러개 있을 경우 가장 가까운 항목을 유사 항목으로 선택한다.
332
                    if (EqualIndices.Any())
333
                    {
334
                        var ordered = EqualIndices.ConvertAll(x => SecondEntities[x]).OrderBy(x =>
335
                        {
336
                            return x.BoxMin.DistanceTo(entVp1.BoxMin);
337
                        });
338

  
339
                        int idx = SecondEntities.ToList().FindIndex(x => x == ordered.First());
340
                        equalEntitiesInV2[idx] = true;
341
                    }
342
                    #endregion
343

  
344
                    if (!EqualIndices.Any()) differents[0]++;
345
                }
346

  
347
                for (int j = 0; j < SecondEntities.Count; j++)
348
                {
349
                    if (!equalEntitiesInV2[j]) differents[1]++;
350
                }
351
            }
352
            catch (Exception ex)
353
            {
354
                Console.Write($"Error : {ex.Message}");
355
            }
356

  
357
            double a = Math.Abs(FirstEntities.Count - SecondEntities.Count) / ((FirstEntities.Count + SecondEntities.Count) * 0.5) * 100;
358
            double b = FirstEntities.Count > 0 ? ((double)differents[0] / (double)FirstEntities.Count) * 100 : 100;
359
            double c = SecondEntities.Count > 0 ? ((double)differents[1] / (double)SecondEntities.Count) * 100 : 100;
360

  
361
            return (a + b + c) / 3;
362
        }
363

  
364
        public void DocumentListBinding(List<ID2.Manager.Data.Models.Documents> docs)
365
        {
366
            this.radGridViewDocument.FilterDescriptors.Clear();
367
            this.radGridViewDocument.DataSource = new BindingList<ID2.Manager.Data.Models.Documents>(docs);
368
        }
369

  
370
        /// <summary>
371
        /// 주어진 두 엔터티를 비교한다.
372
        /// </summary>
373
        /// <param name="entVp1"></param>
374
        /// <param name="entVp2"></param>
375
        /// <returns></returns>
376
        private bool CompareIfEqual(Design design1, Entity entVp1, Design design2, Entity entVp2)
377
        {
378
            return AreEqual(design1, entVp1, design2, entVp2);
379
        }
380

  
381
        private bool CompareGEntityIfEqual(GEntity entVp1, GEntity entVp2)
382
        {
383
            return AreGEntityEqual(entVp1, entVp2);
384
        }
385

  
386
        /// <summary>
387
        /// 그래픽적으로 두 엔터티가 유사한지 검사한다.
388
        /// </summary>
389
        /// <param name="design1"></param>
390
        /// <param name="ent1"></param>
391
        /// <param name="design2"></param>
392
        /// <param name="ent2"></param>
393
        /// <returns></returns>
394
        private bool AreEqual(Design design1, Entity ent1, Design design2, Entity ent2)
395
        {
396
            if (ent1 is CompositeCurve cc1 && ent2 is CompositeCurve cc2)
397
            {
398
                if (cc1.CurveList.Count == cc2.CurveList.Count)
399
                {
400
                    int equalCurvesInListCount = 0;
401
                    foreach (var entC in cc1.CurveList)
402
                    {
403
                        foreach (var entC2 in cc2.CurveList)
404
                        {
405
                            if (entC.GetType() == entC2.GetType())
406
                            {
407
                                if (entC is Entity && entC2 is Entity && CompareIfEqual(design1, entC as Entity, design2, entC2 as Entity))
408
                                {
409
                                    equalCurvesInListCount++;
410
                                    break;
411
                                }
412
                                else if (entC is GEntity && entC2 is GEntity && CompareGEntityIfEqual(entC as GEntity, entC2 as GEntity))
413
                                {
414
                                    equalCurvesInListCount++;
415
                                    break;
416
                                }
417
                            }
418
                        }
419
                    }
420

  
421
                    if (cc1.CurveList.Count == equalCurvesInListCount)
422
                    {
423
                        return true;
424
                    }
425
                }
426
            }
427
            else if (ent1 is LinearPath lp1 && ent2 is LinearPath lp2)
428
            {
429
                if (lp1.Vertices.Length == lp2.Vertices.Length)
430
                {
431
                    for (int i = 0; i < lp1.Vertices.Length; i++)
432
                    {
433
                        if (lp1.Vertices[i].DistanceTo(lp2.Vertices[i]) > Classify.Tolerance)
434
                            return false;
435
                    }
436

  
437
                    return true;
438
                }
439
            }
440
            else if (ent1 is PlanarEntity && ent2 is PlanarEntity)
441
            {
442
                if (ent1 is Arc arc1 && ent2 is Arc arc2)
443
                {
444
                    if (
445
                        arc1.Center.DistanceTo(arc2.Center) <= Classify.Tolerance &&
446
                        Math.Abs(arc1.Radius - arc2.Radius) <= Classify.Tolerance &&
447
                        Math.Abs(arc1.Domain.Min - arc2.Domain.Min) <= Classify.Tolerance &&
448
                        Math.Abs(arc1.Domain.Max - arc2.Domain.Max) <= Classify.Tolerance
449
                        )
450
                    {
451
                        return true;
452
                    }
453
                }
454
                else if (ent1 is Circle c1 && ent2 is Circle c2)
455
                {
456
                    if (
457
                        c1.Center.DistanceTo(c2.Center) <= Classify.Tolerance &&
458
                        Math.Abs(c1.Radius - c2.Radius) <= Classify.Tolerance
459
                        )
460
                    {
461
                        return true;
462
                    }
463
                }
464
                else if (ent1 is EllipticalArc e1 && ent2 is EllipticalArc e2)
465
                {
466
                    if (
467
                        e1.Center.DistanceTo(e2.Center) <= Classify.Tolerance &&
468
                        Math.Abs(e1.RadiusX - e2.RadiusX) <= Classify.Tolerance &&
469
                        Math.Abs(e1.RadiusY - e2.RadiusY) <= Classify.Tolerance &&
470
                        Math.Abs(e1.Domain.Low - e2.Domain.Low) <= Classify.Tolerance &&
471
                        Math.Abs(e1.Domain.High - e2.Domain.High) <= Classify.Tolerance
472
                    )
473
                    {
474
                        return true;
475
                    }
476
                }
477
                else if (ent1 is Ellipse el1 && ent2 is Ellipse el2)
478
                {
479
                    if (
480
                        el1.Center.DistanceTo(el2.Center) <= Classify.Tolerance &&
481
                        Math.Abs(el1.RadiusX - el2.RadiusX) <= Classify.Tolerance &&
482
                        Math.Abs(el1.RadiusY - el2.RadiusY) <= Classify.Tolerance
483
                    )
484
                    {
485
                        return true;
486
                    }
487
                }
488
                #region 해치는 중점만 비교
489
                else if (ent1 is Hatch hatch1 && ent2 is Hatch hatch2)
490
                {
491
                    if (hatch1.BoxMin == null || hatch1.BoxMax == null) return false;
492
                    var center1 = (hatch1.BoxMin + hatch1.BoxMax) * 0.5;
493
                    center1.Z = 0;
494
                    if (hatch2.BoxMin == null || hatch2.BoxMax == null) return false;
495
                    var center2 = (hatch2.BoxMin + hatch2.BoxMax) * 0.5;
496
                    center2.Z = 0;
497
                    return center1.DistanceTo(center2) < Classify.Tolerance;
498
                }
499
                #endregion
500
                else if (ent1 is Text)
501
                {
502
                    if (ent1 is Dimension dim1 && ent2 is Dimension dim2)
503
                    {
504
                        if (
505
                            dim1.InsertionPoint.DistanceTo(dim2.InsertionPoint) <= Classify.Tolerance &&
506
                            dim1.DimLinePosition.DistanceTo(dim2.DimLinePosition) <= Classify.Tolerance
507
                            )
508
                        {
509
                            if (ent1 is AngularDim ad1 && ent2 is AngularDim ad2)
510
                            {
511
                                if (
512
                                    ad1.ExtLine1.DistanceTo(ad2.ExtLine1) <= Classify.Tolerance &&
513
                                    ad1.ExtLine2.DistanceTo(ad2.ExtLine2) <= Classify.Tolerance &&
514
                                    Math.Abs(ad1.StartAngle - ad2.StartAngle) <= Classify.Tolerance &&
515
                                    Math.Abs(ad1.EndAngle - ad2.EndAngle) <= Classify.Tolerance &&
516
                                    Math.Abs(ad1.Radius - ad2.Radius) <= Classify.Tolerance
517
                                    )
518
                                {
519
                                    return true;
520
                                }
521
                            }
522
                            else if (ent1 is LinearDim ld1 && ent2 is LinearDim ld2)
523
                            {
524
                                if (
525
                                    ld1.ExtLine1.DistanceTo(ld2.ExtLine1) <= Classify.Tolerance &&
526
                                    ld1.ExtLine2.DistanceTo(ld2.ExtLine2) <= Classify.Tolerance
527
                                    )
528
                                {
529
                                    return true;
530
                                }
531
                            }
532
                            else if (ent1 is DiametricDim dd1 && ent2 is DiametricDim dd2)
533
                            {
534
                                if (
535
                                    Math.Abs(dd1.Distance - dd2.Distance) <= Classify.Tolerance &&
536
                                    Math.Abs(dd1.Radius - dd2.Radius) <= Classify.Tolerance &&
537
                                    Math.Abs(dd1.CenterMarkSize - dd2.CenterMarkSize) <= Classify.Tolerance
538
                                )
539
                                {
540
                                    return true;
541
                                }
542
                            }
543
                            else if (ent1 is RadialDim rd1 && ent2 is RadialDim rd2)
544
                            {
545
                                if (
546
                                    Math.Abs(rd1.Radius - rd2.Radius) <= Classify.Tolerance &&
547
                                    Math.Abs(rd1.CenterMarkSize - rd2.CenterMarkSize) <= Classify.Tolerance
548
                                )
549
                                {
550
                                    return true;
551
                                }
552
                            }
553
                            else if (ent1 is OrdinateDim od1 && ent2 is OrdinateDim od2)
554
                            {
555
                                if (
556
                                    od1.DefiningPoint.DistanceTo(od2.DefiningPoint) <= Classify.Tolerance &&
557
                                    od1.Origin.DistanceTo(od2.Origin) <= Classify.Tolerance &&
558
                                    od1.LeaderEndPoint.DistanceTo(od2.LeaderEndPoint) <= Classify.Tolerance
559
                                )
560
                                {
561
                                    return true;
562
                                }
563
                            }
564
                            else
565
                            {
566
                                Console.Write("Type " + ent1.GetType() + " not implemented.");
567
                                return true;
568
                            }
569
                        }
570
                    }
571

  
572
                    else if (ent1 is devDept.Eyeshot.Entities.Attribute att1 && ent2 is devDept.Eyeshot.Entities.Attribute att2)
573
                    {
574
                        if (
575
                            att1.Value == att2.Value &&
576
                            att1.InsertionPoint.DistanceTo(att2.InsertionPoint) <= Classify.Tolerance
577
                            )
578
                        {
579
                            return true;
580
                        }
581
                    }
582
                    else
583
                    {
584
                        Text tx1 = (Text)ent1;
585
                        Text tx2 = (Text)ent2;
586

  
587
                        #region 대소문자, 공백을 무시하여 비교
588
                        string string1 = tx1.TextString.Trim().ToUpper();
589
                        string string2 = tx2.TextString.Trim().ToUpper();
590
                        string1 = System.Text.RegularExpressions.Regex.Replace(string1, @"\s+", "");
591
                        string2 = System.Text.RegularExpressions.Regex.Replace(string2, @"\s+", "");
592
                        if (
593
                            tx1.BoxMin.DistanceTo(tx2.BoxMin) <= Classify.Tolerance &&
594
                            string1 == string2 &&
595
                            Math.Abs(tx1.WidthFactor - tx2.WidthFactor) <= Classify.Tolerance &&
596
                            Math.Abs(tx1.Height - tx2.Height) <= Classify.Tolerance
597
                            )
598
                        {
599
                            return true;
600
                        }
601
                        #endregion
602
                    }
603
                }
604
            }
605
            else if (ent1 is Line line1 && ent2 is Line line2)
606
            {
607
                var dir1 = line1.Direction;
608
                dir1.Normalize();
609
                var dir2 = line2.Direction;
610
                dir2.Normalize();
611
                if (devDept.Geometry.Vector3D.AreParallel(dir1, dir2, 0.1) &&
612
                    Math.Abs(line1.Length() - line2.Length()) <= line1.Length() * LengthToleranceRatio &&
613
                    line1.MidPoint.DistanceTo(line2.MidPoint) <= Classify.Tolerance
614
                )
615
                {
616
                    return true;
617
                }
618
            }
619
            else if (ent1 is Line && ent2 is devDept.Eyeshot.Entities.TabulatedSurface lwpolyline && lwpolyline.ControlPoints.Length == 4)
620
            {
621
                line1 = ent1 as Line;
622
                var start = new devDept.Geometry.Point3D(lwpolyline.ControlPoints[0, 0].X, lwpolyline.ControlPoints[0, 0].Y, 0);
623
                var end = new devDept.Geometry.Point3D(lwpolyline.ControlPoints[1, 0].X, lwpolyline.ControlPoints[1, 0].Y, 0);
624
                var vec = new devDept.Geometry.Vector3D(start, end);
625
                vec.Normalize();
626
                var dir = line1.Direction.Clone() as devDept.Geometry.Vector3D;
627
                dir.Normalize();
628

  
629
                if (
630
                    devDept.Geometry.Vector3D.AreParallel(dir, vec) &&
631
                    line1.StartPoint.DistanceTo(start) <= Classify.Tolerance &&
632
                    line1.EndPoint.DistanceTo(end) <= Classify.Tolerance
633
                )
634
                {
635
                    return true;
636
                }
637
            }
638
            else if (ent1 is devDept.Eyeshot.Entities.Point point1 && ent2 is devDept.Eyeshot.Entities.Point point2)
639
            {
640
                if (point1.Position.DistanceTo(point2.Position) <= Classify.Tolerance)
641
                {
642
                    return true;
643
                }
644
            }
645
            else if (ent1 is Curve cu1 && ent2 is Curve cu2)
646
            {
647
                if (
648
                    cu1.ControlPoints.Length == cu2.ControlPoints.Length &&
649
                    cu1.KnotVector.Length == cu2.KnotVector.Length &&
650
                    cu1.Degree == cu2.Degree
651
                    )
652
                {
653
                    for (int k = 0; k < cu1.ControlPoints.Length; k++)
654
                    {
655
                        if (cu1.ControlPoints[k].DistanceTo(cu2.ControlPoints[k]) > Classify.Tolerance)
656
                        {
657
                            return false;
658
                        }
659
                    }
660

  
661
                    for (int k = 0; k < cu1.KnotVector.Length; k++)
662
                    {
663
                        if (cu1.KnotVector[k] != cu2.KnotVector[k])
664
                        {
665
                            return false;
666
                        }
667
                    }
668

  
669
                    return true;
670
                }
671
            }
672
            else if (ent1 is Mesh m1 && ent2 is Mesh m2 && m1.Vertices.Count() == m2.Vertices.Count())
673
            {
674
                for (int i = 0; i < m1.Vertices.Count(); ++i)
675
                {
676
                    if (m1.Vertices[i].DistanceTo(m2.Vertices[i]) > Classify.Tolerance) return false;
677
                }
678

  
679
                return true;
680
            }
681
            else if (ent1 is BlockReference blkref1 && ent2 is BlockReference blkref2)
682
            {
683
                int equalCurvesInEntityList = 0;
684

  
685
                #region Point, Attribute, Text 제거 및 LinePath를 라인으로 분리
686
                var entities1 = blkref1.Explode(design1.Blocks).Where(x => x.LayerName != "AS_PORT" && !(x is devDept.Eyeshot.Entities.Point) &&
687
                !(x is devDept.Eyeshot.Entities.Attribute) && !(x is devDept.Eyeshot.Entities.Text)).ToList();
688
                var coll1 = new List<Entity>();
689
                entities1.ForEach(x =>
690
                {
691
                    if (x is LinearPath lp)
692
                    {
693
                        for (int i = 0; i < lp.Vertices.Length - 1; ++i)
694
                        {
695
                            if (lp.Vertices[i].DistanceTo(lp.Vertices[i + 1]) < 0.1) continue;
696
                            coll1.Add(new Line(lp.Vertices[i], lp.Vertices[i + 1]));
697
                        }
698
                    }
699
                    else
700
                    {
701
                        coll1.Add(x);
702
                    }
703
                });
704
                #endregion
705

  
706
                #region Point 및 Nesting Block 제거 및 LinePath를 라인으로 분리
707
                var entities2 = blkref2.Explode(design2.Blocks).Where(x =>
708
                !(x is devDept.Eyeshot.Entities.BlockReference blkref && blkref.BlockName == "PORT") && !(x is devDept.Eyeshot.Entities.Point)).ToList();
709
                var coll2 = new List<Entity>();
710
                entities2.ForEach(x =>
711
                {
712
                    if (x is LinearPath lp)
713
                    {
714
                        for (int i = 0; i < lp.Vertices.Length - 1; ++i)
715
                        {
716
                            if (lp.Vertices[i].DistanceTo(lp.Vertices[i + 1]) < 0.1) continue;
717
                            coll2.Add(new Line(lp.Vertices[i], lp.Vertices[i + 1]));
718
                        }
719
                    }
720
                    else if (x is devDept.Eyeshot.Entities.Attribute attr)
721
                    {
722
                        if (!attr.Invisible) coll2.Add(attr);
723
                    }
724
                    else if (x.GetType().Name == "AttributeReferenceData")
725
                    {
726
                    }
727
                    else
728
                    {
729
                        coll2.Add(x);
730
                    }
731
                });
732
                #endregion
733

  
734
                if (coll1.Count != coll2.Count) return false;
735

  
736
                foreach (var entC in coll1)
737
                {
738
                    foreach (var entC2 in coll2)
739
                    {
740
                        if (entC.GetType() == entC2.GetType())
741
                        {
742
                            if (entC is Entity && entC2 is Entity && CompareIfEqual(design1, entC as Entity, design2, entC2 as Entity))
743
                            {
744
                                equalCurvesInEntityList++;
745
                                break;
746
                            }
747
                        }
748
                    }
749
                }
750

  
751
                if (coll1.Count == equalCurvesInEntityList)
752
                {
753
                    return true;
754
                }
755
            }
756
            else
757
            {
758
                Console.Write("Type " + ent1.GetType() + " not implemented.");
759
                return false;
760
            }
761

  
762
            return false;
763
        }
764

  
765
        private bool AreGEntityEqual(GEntity ent1, GEntity ent2)
766
        {
767
            if (ent1 is GCompositeCurve cc1 && ent2 is GCompositeCurve cc2)
768
            {
769
                if (cc1.CurveList.Count == cc2.CurveList.Count)
770
                {
771
                    int equalCurvesInListCount = 0;
772
                    foreach (var entC in cc1.CurveList)
773
                    {
774
                        foreach (var entC2 in cc2.CurveList)
775
                        {
776
                            if (entC.GetType() == entC2.GetType())
777
                            {
778
                                if (entC is GEntity && entC2 is GEntity && CompareGEntityIfEqual(entC as GEntity, entC2 as GEntity))
779
                                {
780
                                    equalCurvesInListCount++;
781
                                    break;
782
                                }
783
                            }
784
                        }
785
                    }
786

  
787
                    if (cc1.CurveList.Count == equalCurvesInListCount)
788
                    {
789
                        return true;
790
                    }
791
                }
792
            }
793
            else if (ent1 is GLinearPath lp1 && ent2 is GLinearPath lp2)
794
            {
795
                if (lp1.Vertices.Length == lp2.Vertices.Length)
796
                {
797
                    for (int i = 0; i < lp1.Vertices.Length; i++)
798
                    {
799
                        if (lp1.Vertices[i].DistanceTo(lp2.Vertices[i]) > Classify.Tolerance)
800
                            return false;
801
                    }
802
                    return true;
803
                }
804
            }
805

  
806
            else if (ent1 is GPlanarEntity pe1 && ent2 is GPlanarEntity pe2)
807
            {
808
                if (
809
                    pe1.Plane.AxisZ == pe2.Plane.AxisZ &&
810
                    pe1.Plane.AxisX == pe2.Plane.AxisX
811
                    )
812
                {
813
                    if (ent1 is GArc arc1 && ent2 is GArc arc2)
814
                    {
815
                        if (
816
                            arc1.Center.DistanceTo(arc2.Center) <= Classify.Tolerance &&
817
                            Math.Abs(arc1.Radius - arc2.Radius) <= Classify.Tolerance &&
818
                            Math.Abs(arc1.Domain.Min - arc2.Domain.Min) <= Classify.Tolerance &&
819
                            Math.Abs(arc1.Domain.Max - arc2.Domain.Max) <= Classify.Tolerance
820
                            )
821
                        {
822
                            return true;
823
                        }
824
                    }
825
                    else if (ent1 is GCircle c1 && ent2 is GCircle c2)
826
                    {
827
                        if (c1.Center.DistanceTo(c2.Center) <= Classify.Tolerance && 
828
                            Math.Abs(c1.Radius - c2.Radius) <= Classify.Tolerance)
829
                        {
830
                            return true;
831
                        }
832
                    }
833
                    else if (ent1 is GEllipticalArc e1 && ent2 is GEllipticalArc e2)
834
                    {
835
                        if (
836
                            e1.Center.DistanceTo(e2.Center) <= Classify.Tolerance &&
837
                            Math.Abs(e1.RadiusX - e2.RadiusX) <= Classify.Tolerance &&
838
                            Math.Abs(e1.RadiusY - e2.RadiusY) <= Classify.Tolerance &&
839
                            Math.Abs(e1.Domain.Low - e2.Domain.Low) <= Classify.Tolerance &&
840
                            Math.Abs(e1.Domain.High - e2.Domain.High) <= Classify.Tolerance
841
                        )
842
                        {
843
                            return true;
844
                        }
845
                    }
846
                    else if (ent1 is GEllipse el1 && ent2 is GEllipse el2)
847
                    {
848
                        if (
849
                            el1.Center.DistanceTo(el2.Center) <= Classify.Tolerance &&
850
                            Math.Abs(el1.RadiusX - el2.RadiusX) <= Classify.Tolerance &&
851
                            Math.Abs(el1.RadiusY - el2.RadiusY) <= Classify.Tolerance
852
                        )
853
                        {
854
                            return true;
855
                        }
856
                    }
857
                    else
858
                    {
859
                        Console.Write("Type " + ent1.GetType() + " not implemented.");
860
                        return true;
861
                    }
862
                }
863
            }
864

  
865
            else if (ent1 is GLine line1 && ent2 is GLine line2)
866
            {
867
                if (line1.StartPoint.DistanceTo(line2.StartPoint) <= Classify.Tolerance && 
868
                    line1.EndPoint.DistanceTo(line2.EndPoint) <= Classify.Tolerance
869
                )
870
                {
871
                    return true;
872
                }
873
            }
874
#if NURBS
875
            else if (ent1 is Curve)
876
            {
877
                Curve cu1 = (Curve)ent1;
878
                Curve cu2 = (Curve)ent2;
879

  
880
                if (
881
                    cu1.ControlPoints.Length == cu2.ControlPoints.Length &&
882
                    cu1.KnotVector.Length == cu2.KnotVector.Length &&
883
                    cu1.Degree == cu2.Degree
884
                    )
885
                {
886
                    for (int k = 0; k < cu1.ControlPoints.Length; k++)
887
                    {
888
                        if (cu1.ControlPoints[k] != cu2.ControlPoints[k])
889
                        {
890
                            return false;
891
                        }
892
                    }
893

  
894
                    for (int k = 0; k < cu1.KnotVector.Length; k++)
895
                    {
896
                        if (cu1.KnotVector[k] != cu2.KnotVector[k])
897
                        {
898
                            return false;
899
                        }
900
                    }
901

  
902
                    return true;
903
                }
904
            }
905
#endif
906

  
907
            else
908
            {
909
                Console.Write("Type " + ent1.GetType() + " not implemented.");
910
                return true;
911
            }
912
            return false;
913
        }
914
    }
915
}
... 이 차이점은 표시할 수 있는 최대 줄수를 초과해서 이 차이점은 잘렸습니다.

내보내기 Unified diff

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