개정판 30a9ffce
dev issue #000 : edit Branch Line
Change-Id: I0be410caa0946918d4deec087517d3bbf437ab27
DTI_PID/SPPIDConverter/AutoModeling.cs | ||
---|---|---|
514 | 514 |
double[] point1 = points[i]; |
515 | 515 |
double[] point2 = points[i + 1]; |
516 | 516 |
|
517 |
double maxLineX = Math.Max(point1[0], point2[0]); |
|
518 |
double minLineX = Math.Min(point1[0], point2[0]); |
|
519 |
double maxLineY = Math.Max(point1[1], point2[1]); |
|
520 |
double minLineY = Math.Min(point1[1], point2[1]); |
|
521 |
|
|
522 | 517 |
// 두직선의 교차점 |
523 | 518 |
double[] crossingPoint = SPPIDUtil.CalcLineCrossingPoint(connX, connY, x2, y2, point1[0], point1[1], point2[0], point2[1]); |
524 | 519 |
if (crossingPoint != null) |
525 | 520 |
{ |
526 |
|
|
527 |
|
|
521 |
double distance = SPPIDUtil.CalcPointToPointdDistance(connX, connY, crossingPoint[0], crossingPoint[1]); |
|
522 |
if (length > distance) |
|
523 |
{ |
|
524 |
targetConnector = item.Key; |
|
525 |
length = distance; |
|
526 |
} |
|
528 | 527 |
} |
529 |
|
|
530 |
|
|
531 |
// 두직선의 교차점으로 구하면 될듯 그리고 교차점이 x y랑 제일 가까운것 |
|
532 |
|
|
533 |
//if ((minLineX <= x && maxLineX >= x) || |
|
534 |
// (minLineY <= y && maxLineY >= y)) |
|
535 |
//{ |
|
536 |
// double result = SPPIDUtil.CalcLineToPointDistance(point1[0], point1[1], point2[0], point2[1], connX, connY); |
|
537 |
// if (length > result) |
|
538 |
// { |
|
539 |
// targetConnector = item.Key; |
|
540 |
// length = result; |
|
541 |
// } |
|
542 |
//} |
|
543 | 528 |
} |
544 | 529 |
} |
545 | 530 |
|
내보내기 Unified diff