프로젝트

일반

사용자정보

개정판 1ba9c671

ID1ba9c671e25b6ad1cb042056bfe5e6a5abcda91d
상위 f7df92c0
하위 8a5ac6a1, 1f1b3a40

gaqhf 이(가) 5년 이상 전에 추가함

dev issue #000 : 도면 사이즈 적용 및 Attribute Label LeaderLine 적용

Change-Id: I991272aa8a7acbbf49edf23db5ac7737cee3828b

차이점 보기:

DTI_PID/SPPIDConverter/SPPIDModel/SPPID_Document.cs
16 16
            
17 17
        }
18 18

  
19
        private double testX = 0.855;
20
        private double testY = 0.55;
21

  
22 19
        public List<SymbolMapping> SymbolMappings;
23 20
        public List<ChildSymbolMapping> ChildSymbolMappings;
24 21
        public List<LineMapping> LineMappings;
......
33 30
        public string Unit { get; set; }
34 31
        public string Template { get; set; }
35 32

  
36
        
37 33
        public void SetSPPIDInfo()
38 34
        {
39 35
            foreach (var item in SYMBOLS)
40 36
            {
41 37
                if (item.SPPID == null)
42 38
                    item.SPPID = new SPPIDSymbolInfo();
43
                double x = double.NaN;
44
                double y = double.NaN;
45
                SPPIDUtil.ConvertPointBystring(item.ORIGINALPOINT, ref x, ref y);
46
                SPPIDUtil.ConvertSPPIDPoint(ref x, ref y, SIZE_WIDTH, SIZE_HEIGHT, testX, testY);
47
                item.SPPID.ORIGINAL_X = x;
48
                item.SPPID.ORIGINAL_Y = y;
49 39

  
50 40
                foreach (var childSymbol in item.ChildSymbols)
51 41
                {
......
59 49
            {
60 50
                if (item.SPPID == null)
61 51
                    item.SPPID = new SPPIDLineInfo();
52
            }
53

  
54
            foreach (var item in Equipments)
55
            {
56
                if (item.SPPID == null)
57
                    item.SPPID = new SPPIDSymbolInfo();
58
            }
59

  
60
            foreach (var item in EndBreaks)
61
            {
62
                if (item.SPPID == null)
63
                    item.SPPID = new SPPIDSymbolInfo();
64
            }
65

  
66
            foreach (var item in LINENUMBERS)
67
            {
68
                if (item.SPPID == null)
69
                    item.SPPID = new SPPIDSymbolInfo();
70
            }
71

  
72
            foreach (var item in TEXTINFOS)
73
            {
74
                if (item.SPPID == null)
75
                    item.SPPID = new SPPIDSymbolInfo();
76
            }
77

  
78
            foreach (var item in NOTES)
79
            {
80
                if (item.SPPID == null)
81
                    item.SPPID = new SPPIDSymbolInfo();
82
            }
83
        }
84

  
85
        public void SetSPPIDLocation(double SPPIDDocumentX, double SPPIDDocumentY)
86
        {
87
            foreach (var item in SYMBOLS)
88
            {
89
                double x = double.NaN;
90
                double y = double.NaN;
91
                SPPIDUtil.ConvertPointBystring(item.ORIGINALPOINT, ref x, ref y);
92
                SPPIDUtil.ConvertSPPIDPoint(ref x, ref y, SIZE_WIDTH, SIZE_HEIGHT, SPPIDDocumentX, SPPIDDocumentY);
93
                item.SPPID.ORIGINAL_X = x;
94
                item.SPPID.ORIGINAL_Y = y;
95
            }
96

  
97
            foreach (var item in LINES)
98
            {
62 99
                double x = double.NaN;
63 100
                double y = double.NaN;
64 101

  
65 102
                SPPIDUtil.ConvertPointBystring(item.STARTPOINT, ref x, ref y);
66
                SPPIDUtil.ConvertSPPIDPoint(ref x, ref y, SIZE_WIDTH, SIZE_HEIGHT, testX, testY);
103
                SPPIDUtil.ConvertSPPIDPoint(ref x, ref y, SIZE_WIDTH, SIZE_HEIGHT, SPPIDDocumentX, SPPIDDocumentY);
67 104
                item.SPPID.START_X = x;
68 105
                item.SPPID.START_Y = y;
69 106

  
70 107
                SPPIDUtil.ConvertPointBystring(item.ENDPOINT, ref x, ref y);
71
                SPPIDUtil.ConvertSPPIDPoint(ref x, ref y, SIZE_WIDTH, SIZE_HEIGHT, testX, testY);
108
                SPPIDUtil.ConvertSPPIDPoint(ref x, ref y, SIZE_WIDTH, SIZE_HEIGHT, SPPIDDocumentX, SPPIDDocumentY);
72 109
                item.SPPID.END_X = x;
73 110
                item.SPPID.END_Y = y;
74 111
            }
75 112

  
76 113
            foreach (var item in Equipments)
77 114
            {
78
                if (item.SPPID == null)
79
                    item.SPPID = new SPPIDSymbolInfo();
80 115
                double x = double.NaN;
81 116
                double y = double.NaN;
82 117
                SPPIDUtil.ConvertPointBystring(item.ORIGINALPOINT, ref x, ref y);
83
                SPPIDUtil.ConvertSPPIDPoint(ref x, ref y, SIZE_WIDTH, SIZE_HEIGHT, testX, testY);
118
                SPPIDUtil.ConvertSPPIDPoint(ref x, ref y, SIZE_WIDTH, SIZE_HEIGHT, SPPIDDocumentX, SPPIDDocumentY);
84 119
                item.SPPID.ORIGINAL_X = x;
85 120
                item.SPPID.ORIGINAL_Y = y;
86 121
            }
87 122

  
88 123
            foreach (var item in EndBreaks)
89 124
            {
90
                if (item.SPPID == null)
91
                    item.SPPID = new SPPIDSymbolInfo();
92 125
                double x = double.NaN;
93 126
                double y = double.NaN;
94 127
                SPPIDUtil.ConvertPointBystring(item.ORIGINALPOINT, ref x, ref y);
95
                SPPIDUtil.ConvertSPPIDPoint(ref x, ref y, SIZE_WIDTH, SIZE_HEIGHT, testX, testY);
128
                SPPIDUtil.ConvertSPPIDPoint(ref x, ref y, SIZE_WIDTH, SIZE_HEIGHT, SPPIDDocumentX, SPPIDDocumentY);
96 129
                item.SPPID.ORIGINAL_X = x;
97 130
                item.SPPID.ORIGINAL_Y = y;
98 131
            }
99 132

  
100 133
            foreach (var item in LINENUMBERS)
101 134
            {
102
                if (item.SPPID == null)
103
                    item.SPPID = new SPPIDSymbolInfo();
104 135
                double x = double.NaN;
105 136
                double y = double.NaN;
106 137
                SPPIDUtil.ConvertPointBystring(item.LOCATION, ref x, ref y);
107
                SPPIDUtil.ConvertSPPIDPoint(ref x, ref y, SIZE_WIDTH, SIZE_HEIGHT, testX, testY);
138
                SPPIDUtil.ConvertSPPIDPoint(ref x, ref y, SIZE_WIDTH, SIZE_HEIGHT, SPPIDDocumentX, SPPIDDocumentY);
108 139
                item.SPPID.ORIGINAL_X = x;
109 140
                item.SPPID.ORIGINAL_Y = y;
110 141

  
......
113 144
                double y1 = item.Y1;
114 145
                double x2 = item.X2;
115 146
                double y2 = item.Y2;
116
                SPPIDUtil.ConvertSPPIDPoint(ref x1, ref y1, SIZE_WIDTH, SIZE_HEIGHT, testX, testY);
117
                SPPIDUtil.ConvertSPPIDPoint(ref x2, ref y2, SIZE_WIDTH, SIZE_HEIGHT, testX, testY);
147
                SPPIDUtil.ConvertSPPIDPoint(ref x1, ref y1, SIZE_WIDTH, SIZE_HEIGHT, SPPIDDocumentX, SPPIDDocumentY);
148
                SPPIDUtil.ConvertSPPIDPoint(ref x2, ref y2, SIZE_WIDTH, SIZE_HEIGHT, SPPIDDocumentX, SPPIDDocumentY);
118 149
                item.SPPIDLabelLocation.X1 = Math.Min(x1, x2);
119 150
                item.SPPIDLabelLocation.Y1 = Math.Min(y1, y2);
120 151
                item.SPPIDLabelLocation.X2 = Math.Max(x1, x2);
......
123 154

  
124 155
            foreach (var item in TEXTINFOS)
125 156
            {
126
                if (item.SPPID == null)
127
                    item.SPPID = new SPPIDSymbolInfo();
128 157
                double x = double.NaN;
129 158
                double y = double.NaN;
130 159
                SPPIDUtil.ConvertPointBystring(item.LOCATION, ref x, ref y);
131
                SPPIDUtil.ConvertSPPIDPoint(ref x, ref y, SIZE_WIDTH, SIZE_HEIGHT, testX, testY);
160
                SPPIDUtil.ConvertSPPIDPoint(ref x, ref y, SIZE_WIDTH, SIZE_HEIGHT, SPPIDDocumentX, SPPIDDocumentY);
132 161
                item.SPPID.ORIGINAL_X = x;
133 162
                item.SPPID.ORIGINAL_Y = y;
134 163

  
......
137 166
                double y1 = item.Y1;
138 167
                double x2 = item.X2;
139 168
                double y2 = item.Y2;
140
                SPPIDUtil.ConvertSPPIDPoint(ref x1, ref y1, SIZE_WIDTH, SIZE_HEIGHT, testX, testY);
141
                SPPIDUtil.ConvertSPPIDPoint(ref x2, ref y2, SIZE_WIDTH, SIZE_HEIGHT, testX, testY);
169
                SPPIDUtil.ConvertSPPIDPoint(ref x1, ref y1, SIZE_WIDTH, SIZE_HEIGHT, SPPIDDocumentX, SPPIDDocumentY);
170
                SPPIDUtil.ConvertSPPIDPoint(ref x2, ref y2, SIZE_WIDTH, SIZE_HEIGHT, SPPIDDocumentX, SPPIDDocumentY);
142 171
                item.SPPIDLabelLocation.X1 = Math.Min(x1, x2);
143 172
                item.SPPIDLabelLocation.Y1 = Math.Min(y1, y2);
144 173
                item.SPPIDLabelLocation.X2 = Math.Max(x1, x2);
......
147 176

  
148 177
            foreach (var item in NOTES)
149 178
            {
150
                if (item.SPPID == null)
151
                    item.SPPID = new SPPIDSymbolInfo();
152 179
                double x = double.NaN;
153 180
                double y = double.NaN;
154 181
                SPPIDUtil.ConvertPointBystring(item.LOCATION, ref x, ref y);
155
                SPPIDUtil.ConvertSPPIDPoint(ref x, ref y, SIZE_WIDTH, SIZE_HEIGHT, testX, testY);
182
                SPPIDUtil.ConvertSPPIDPoint(ref x, ref y, SIZE_WIDTH, SIZE_HEIGHT, SPPIDDocumentX, SPPIDDocumentY);
156 183
                item.SPPID.ORIGINAL_X = x;
157 184
                item.SPPID.ORIGINAL_Y = y;
158 185

  
......
161 188
                double y1 = item.Y1;
162 189
                double x2 = item.X2;
163 190
                double y2 = item.Y2;
164
                SPPIDUtil.ConvertSPPIDPoint(ref x1, ref y1, SIZE_WIDTH, SIZE_HEIGHT, testX, testY);
165
                SPPIDUtil.ConvertSPPIDPoint(ref x2, ref y2, SIZE_WIDTH, SIZE_HEIGHT, testX, testY);
191
                SPPIDUtil.ConvertSPPIDPoint(ref x1, ref y1, SIZE_WIDTH, SIZE_HEIGHT, SPPIDDocumentX, SPPIDDocumentY);
192
                SPPIDUtil.ConvertSPPIDPoint(ref x2, ref y2, SIZE_WIDTH, SIZE_HEIGHT, SPPIDDocumentX, SPPIDDocumentY);
166 193
                item.SPPIDLabelLocation.X1 = Math.Min(x1, x2);
167 194
                item.SPPIDLabelLocation.Y1 = Math.Min(y1, y2);
168 195
                item.SPPIDLabelLocation.X2 = Math.Max(x1, x2);
......
248 275
            return true;
249 276
        }
250 277

  
278
        public void ConvertSPPIDPoint(ref double dX, ref double dY, double dDwgX, double dDwgY, double SPPID_Width, double SPPID_Height)
279
        {
280
            decimal calcX = 0;
281
            decimal calcY = 0;
282
            decimal tempX = Convert.ToDecimal(dX);
283
            decimal tempY = Convert.ToDecimal(dY);
284
            decimal tempWidth = Convert.ToDecimal(SPPID_Width);
285
            decimal tempHeight = Convert.ToDecimal(SPPID_Height);
286
            decimal tempDwgX = Convert.ToDecimal(dDwgX);
287
            decimal tempDwgY = Convert.ToDecimal(dDwgY);
288

  
289
            //calcX = (tempX * tempWidth) / tempDwgX;
290
            //calcX = Math.Truncate(calcX * 1000) / 1000;
291
            //calcY = tempHeight - ((tempY * tempHeight) / tempDwgY);
292
            //calcY = Math.Truncate(calcY * 1000) / 1000;
293
            //dX = Math.Round(Convert.ToDouble(calcX), 10);
294
            //dY = Math.Round(Convert.ToDouble(calcY), 10);
295

  
296
            calcX = (tempX * tempWidth) / tempDwgX;
297
            calcY = tempHeight - ((tempY * tempHeight) / tempDwgY);
298
            dX = Convert.ToDouble(calcX);
299
            dY = Convert.ToDouble(calcY);
300
        }
301

  
251 302
        private bool SetChildSymbolMapping(ChildSymbol item)
252 303
        {
253 304
            foreach (var childSymbol in item.ChildSymbols)

내보내기 Unified diff

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