개정판 6d12a734
dev issue #1163 : 위치 보정
Change-Id: I2eddae88f9bafae0955463144be5bc2e9ef92604
DTI_PID/SPPIDConverter/AutoModeling.cs | ||
---|---|---|
480 | 480 |
/// </summary> |
481 | 481 |
private void CreateDocument(ref string drawingNumber, ref string drawingName) |
482 | 482 |
{ |
483 |
GetDrawingNameAndNumber(ref drawingName, ref drawingNumber); |
|
484 | 483 |
Log.Write("------------------ Start create document ------------------"); |
484 |
GetDrawingNameAndNumber(ref drawingName, ref drawingNumber); |
|
485 | 485 |
Log.Write("Drawing name : " + drawingName); |
486 | 486 |
Log.Write("Drawing number : " + drawingNumber); |
487 | 487 |
newDrawing = application.Drawings.Add(document.Unit, document.Template, drawingNumber, drawingName); |
... | ... | |
1355 | 1355 |
|
1356 | 1356 |
double distanceX = 0; |
1357 | 1357 |
double distanceY = 0; |
1358 |
if (SPPIDUtil.IsOverlap(prevRange, groupRange, ref distanceX, ref distanceY)) |
|
1358 |
bool overlapX = false; |
|
1359 |
bool overlapY = false; |
|
1360 |
SlopeType slopeType = SPPIDUtil.CalcSlope(prevSymbol.SPPID.ORIGINAL_X, prevSymbol.SPPID.ORIGINAL_Y, connSymbol.SPPID.ORIGINAL_X, connSymbol.SPPID.ORIGINAL_Y); |
|
1361 |
SPPIDUtil.CalcOverlap(prevRange, groupRange, ref distanceX, ref distanceY, ref overlapX, ref overlapY); |
|
1362 |
if ((slopeType == SlopeType.HORIZONTAL && overlapX) || |
|
1363 |
(slopeType == SlopeType.VERTICAL && overlapY)) |
|
1359 | 1364 |
{ |
1360 | 1365 |
RemoveSymbol(group); |
1361 | 1366 |
foreach (var _temp in group) |
... | ... | |
1378 | 1383 |
|
1379 | 1384 |
double distanceX = 0; |
1380 | 1385 |
double distanceY = 0; |
1381 |
|
|
1382 |
if (SPPIDUtil.IsOverlap(prevRange, connRange, ref distanceX, ref distanceY)) |
|
1386 |
bool overlapX = false; |
|
1387 |
bool overlapY = false; |
|
1388 |
SlopeType slopeType = SPPIDUtil.CalcSlope(prevSymbol.SPPID.ORIGINAL_X, prevSymbol.SPPID.ORIGINAL_Y, connSymbol.SPPID.ORIGINAL_X, connSymbol.SPPID.ORIGINAL_Y); |
|
1389 |
SPPIDUtil.CalcOverlap(prevRange, connRange, ref distanceX, ref distanceY, ref overlapX, ref overlapY); |
|
1390 |
if ((slopeType == SlopeType.HORIZONTAL && overlapX) || |
|
1391 |
(slopeType == SlopeType.VERTICAL && overlapY)) |
|
1383 | 1392 |
{ |
1384 | 1393 |
RemoveSymbol(connSymbol); |
1385 | 1394 |
SPPIDUtil.CalcNewCoordinateForSymbol(connSymbol, prevSymbol, distanceX, distanceY); |
DTI_PID/SPPIDConverter/Util/SPPIDUtil.cs | ||
---|---|---|
468 | 468 |
return result; |
469 | 469 |
} |
470 | 470 |
|
471 |
public static bool IsOverlap(double[] range1, double[] range2, ref double x, ref double y)
|
|
471 |
public static void CalcOverlap(double[] range1, double[] range2, ref double x, ref double y, ref bool overlapX, ref bool overlapY)
|
|
472 | 472 |
{ |
473 |
bool result = false; |
|
474 |
|
|
475 | 473 |
if (range1[0] <= range2[2] && range1[2] >= range2[0]) |
476 | 474 |
{ |
477 |
result = true;
|
|
475 |
overlapX = true;
|
|
478 | 476 |
x = Math.Min(Math.Abs(range1[0] - range2[2]), Math.Abs(range1[2] - range2[0])); |
479 | 477 |
} |
480 | 478 |
|
481 | 479 |
if (range1[1] <= range2[3] && range1[3] >= range2[1]) |
482 | 480 |
{ |
483 |
result = true;
|
|
481 |
overlapY = true;
|
|
484 | 482 |
y = Math.Min(Math.Abs(range1[1] - range2[3]), Math.Abs(range1[3] - range2[1])); |
485 | 483 |
} |
486 |
|
|
487 |
return result; |
|
488 | 484 |
} |
489 | 485 |
|
490 | 486 |
public static void CalcNewCoordinateForSymbol(Symbol symbol, Symbol prevSymbol, double distanceX, double distanceY) |
DTI_PID/SPPIDConverter/Wrapper/SPPIDConverterWrapper.cs | ||
---|---|---|
148 | 148 |
{ |
149 | 149 |
foreach (ToolbarControl item in toolBars["Main"].Controls) |
150 | 150 |
{ |
151 |
if (item.DLLName.Contains("SPPIDConverter.dll")) |
|
151 |
if (item.DLLName.Contains("SPPIDConverter.dll") || item.DLLName.Contains("SPPIDConverter_Wrapper.dll"))
|
|
152 | 152 |
{ |
153 | 153 |
item.Delete(); |
154 | 154 |
find = true; |
내보내기 Unified diff