개정판 c3d2e266
dev issue #000 : edit converter
Change-Id: Ib6f22a0d9b994efae4c840aab8d0d574d22a10b2
DTI_PID/SPPIDConverter/AutoModeling.cs | ||
---|---|---|
122 | 122 |
{ |
123 | 123 |
SPPIDSymbolInfo info = item.SPPID; |
124 | 124 |
Array points = new double[] { 0, item.SPPID.ORIGINAL_X, item.SPPID.ORIGINAL_Y }; |
125 |
BaseModel.Attribute itemAttribute = item.ATTRIBUTES.Find(x => x.ATTRIBUTE == "OWNERSYMBOL"); |
|
126 |
if (itemAttribute == null) |
|
127 |
continue; |
|
125 | 128 |
string symbolUID = item.ATTRIBUTES.Find(x => x.ATTRIBUTE == "OWNERSYMBOL").VALUE; |
126 | 129 |
object objectItem = SPPIDUtil.FindObjectByUID(document, symbolUID); |
127 | 130 |
if (objectItem != null) |
... | ... | |
317 | 320 |
|
318 | 321 |
private void SymbolModeling(Symbol symbol, Symbol targetSymbol, Symbol prevSymbol) |
319 | 322 |
{ |
323 |
if (symbol.SPPID.MAPPINGNAME.Contains("Labels - ")) |
|
324 |
return; |
|
320 | 325 |
if (!string.IsNullOrEmpty(symbol.SPPID.RepresentationId)) |
321 | 326 |
return; |
322 | 327 |
|
... | ... | |
962 | 967 |
|
963 | 968 |
if (targetLMConnector != null) |
964 | 969 |
{ |
970 |
//double[] point = connectorVertices[targetLMConnector][connectorVertices[targetLMConnector].Count - 1]; |
|
971 |
//Array array = new double[] { 0, point[0], point[1] }; |
|
965 | 972 |
Array array = new double[] { 0, endBreak.SPPID.ORIGINAL_X, endBreak.SPPID.ORIGINAL_Y }; |
966 | 973 |
_LmLabelPersist = _placement.PIDPlaceLabel(endBreak.SPPID.MAPPINGNAME, ref array, Rotation: 0, LabeledItem: targetLMConnector.AsLMRepresentation(), IsLeaderVisible: true); |
967 | 974 |
} |
... | ... | |
1301 | 1308 |
} |
1302 | 1309 |
} |
1303 | 1310 |
} |
1311 |
|
|
1312 |
|
|
1313 |
} |
|
1314 |
|
|
1315 |
if (targetConnector == null) |
|
1316 |
{ |
|
1317 |
foreach (var item in connectorVertices) |
|
1318 |
{ |
|
1319 |
List<double[]> points = item.Value; |
|
1320 |
foreach (var point in points) |
|
1321 |
{ |
|
1322 |
double distance = SPPIDUtil.CalcPointToPointdDistance(connX, connY, point[0], point[1]); |
|
1323 |
if (length >= distance) |
|
1324 |
{ |
|
1325 |
targetConnector = item.Key; |
|
1326 |
length = distance; |
|
1327 |
} |
|
1328 |
} |
|
1329 |
} |
|
1330 |
|
|
1304 | 1331 |
} |
1305 | 1332 |
|
1306 | 1333 |
return targetConnector; |
... | ... | |
1341 | 1368 |
|
1342 | 1369 |
Array points = new double[] { 0, x, y }; |
1343 | 1370 |
LMLabelPersist _LmLabelPresist = _placement.PIDPlaceLabel(lineNumber.SPPID.MAPPINGNAME, ref points, Rotation: lineNumber.ANGLE, LabeledItem: connectedLMConnector.AsLMRepresentation(), IsLeaderVisible: false); |
1344 |
_LmLabelPresist.Commit(); |
|
1371 |
|
|
1345 | 1372 |
|
1346 | 1373 |
foreach (var item in connectorVertices) |
1347 | 1374 |
ReleaseCOMObjects(item.Key); |
1348 | 1375 |
if (_LmLabelPresist != null) |
1349 | 1376 |
{ |
1377 |
_LmLabelPresist.Commit(); |
|
1350 | 1378 |
lineNumber.SPPID.RepresentationId = _LmLabelPresist.AsLMRepresentation().Id; |
1351 | 1379 |
ReleaseCOMObjects(_LmLabelPresist); |
1352 | 1380 |
} |
1381 |
else |
|
1382 |
{ |
|
1383 |
|
|
1384 |
} |
|
1353 | 1385 |
} |
1354 | 1386 |
} |
1355 | 1387 |
|
내보내기 Unified diff