개정판 ca7d0ada
dev issue #497 : Line Snap Grid 보정 개발 준비 소스 수정
Change-Id: I32fe7d4d52d9cd9e2c6a57c6ddb615bd84176d4c
DTI_PID/SPPIDConverter/AutoModeling.cs | ||
---|---|---|
861 | 861 |
Line startBranchLine = null; |
862 | 862 |
Line endBranchLine = null; |
863 | 863 |
|
864 |
// Type, TargetObjet, x, y |
|
865 |
List<Tuple<string, object, double, double>> linePointInfo = new List<Tuple<string, object, double, double>>(); |
|
866 |
|
|
864 | 867 |
for (int i = 0; i < lines.Count; i++) |
865 | 868 |
{ |
866 | 869 |
Line line = lines[i]; |
... | ... | |
884 | 887 |
line.SPPID.START_Y = y; |
885 | 888 |
} |
886 | 889 |
|
887 |
placeRunInputs.AddSymbolTarget(_LMSymbol1, x, y);
|
|
890 |
linePointInfo.Add(new Tuple<string, object, double, double>("SYMBOL", _LMSymbol1, x, y));
|
|
888 | 891 |
} |
889 | 892 |
else |
890 |
placeRunInputs.AddPoint(line.SPPID.START_X, line.SPPID.START_Y);
|
|
893 |
linePointInfo.Add(new Tuple<string, object, double, double>(null, null, line.SPPID.START_X, line.SPPID.START_Y));
|
|
891 | 894 |
} |
892 | 895 |
else if (connItem != null && connItem.GetType() == typeof(Line) && !lines.Contains(connItem)) |
893 | 896 |
{ |
... | ... | |
895 | 898 |
targetConnector1 = FindTargetLMConnector(connectorVertices1, line.SPPID.START_X, line.SPPID.START_Y, line.SPPID.END_X, line.SPPID.END_Y); |
896 | 899 |
|
897 | 900 |
if (targetConnector1 != null) |
898 |
placeRunInputs.AddConnectorTarget(targetConnector1, line.SPPID.START_X, line.SPPID.START_Y);
|
|
901 |
linePointInfo.Add(new Tuple<string, object, double, double>("LINE", targetConnector1, line.SPPID.START_X, line.SPPID.START_Y));
|
|
899 | 902 |
else |
900 | 903 |
{ |
901 | 904 |
startBranchLine = connItem as Line; |
902 |
placeRunInputs.AddPoint(line.SPPID.START_X, line.SPPID.START_Y);
|
|
905 |
linePointInfo.Add(new Tuple<string, object, double, double>(null, null, line.SPPID.START_X, line.SPPID.START_Y));
|
|
903 | 906 |
} |
904 | 907 |
} |
905 | 908 |
else |
906 |
placeRunInputs.AddPoint(line.SPPID.START_X, line.SPPID.START_Y); |
|
909 |
linePointInfo.Add(new Tuple<string, object, double, double>(null, null, line.SPPID.START_X, line.SPPID.START_Y)); |
|
910 |
|
|
907 | 911 |
} |
908 | 912 |
if (i + 1 == lines.Count) |
909 | 913 |
{ |
... | ... | |
911 | 915 |
object connItem = SPPIDUtil.FindObjectByUID(document, line.CONNECTORS[1].CONNECTEDITEM); |
912 | 916 |
|
913 | 917 |
if (i != 0) |
914 |
placeRunInputs.AddPoint(line.SPPID.START_X, line.SPPID.START_Y);
|
|
918 |
linePointInfo.Add(new Tuple<string, object, double, double>(null, null, line.SPPID.START_X, line.SPPID.START_Y));
|
|
915 | 919 |
|
916 | 920 |
if (connItem != null && connItem.GetType() == typeof(Symbol)) |
917 | 921 |
{ |
... | ... | |
928 | 932 |
line.SPPID.END_X = x; |
929 | 933 |
line.SPPID.END_Y = y; |
930 | 934 |
} |
931 |
|
|
932 | 935 |
|
933 |
placeRunInputs.AddSymbolTarget(_LMSymbol2, x, y);
|
|
936 |
linePointInfo.Add(new Tuple<string, object, double, double>("SYMBOL", _LMSymbol2, x, y));
|
|
934 | 937 |
} |
935 | 938 |
else |
936 |
placeRunInputs.AddPoint(line.SPPID.END_X, line.SPPID.END_Y); |
|
937 |
|
|
939 |
linePointInfo.Add(new Tuple<string, object, double, double>(null, null, line.SPPID.END_X, line.SPPID.END_Y)); |
|
938 | 940 |
} |
939 | 941 |
else if (connItem != null && connItem.GetType() == typeof(Line) && !lines.Contains(connItem)) |
940 | 942 |
{ |
... | ... | |
942 | 944 |
targetConnector2 = FindTargetLMConnector(connectorVertices2, line.SPPID.END_X, line.SPPID.END_Y, line.SPPID.START_X, line.SPPID.START_Y); |
943 | 945 |
|
944 | 946 |
if (targetConnector2 != null) |
945 |
placeRunInputs.AddConnectorTarget(targetConnector2, line.SPPID.END_X, line.SPPID.END_Y);
|
|
947 |
linePointInfo.Add(new Tuple<string, object, double, double>("LINE", targetConnector2, line.SPPID.END_X, line.SPPID.END_Y));
|
|
946 | 948 |
else |
947 | 949 |
{ |
948 | 950 |
endBranchLine = connItem as Line; |
949 |
placeRunInputs.AddPoint(line.SPPID.END_X, line.SPPID.END_Y);
|
|
951 |
linePointInfo.Add(new Tuple<string, object, double, double>(null, null, line.SPPID.END_X, line.SPPID.END_Y));
|
|
950 | 952 |
} |
951 | 953 |
} |
952 | 954 |
else |
953 |
{ |
|
954 |
placeRunInputs.AddPoint(line.SPPID.END_X, line.SPPID.END_Y); |
|
955 |
} |
|
955 |
linePointInfo.Add(new Tuple<string, object, double, double>(null, null, line.SPPID.END_X, line.SPPID.END_Y)); |
|
956 | 956 |
} |
957 | 957 |
} |
958 | 958 |
|
959 |
for (int i = 0; i < linePointInfo.Count; i++) |
|
960 |
{ |
|
961 |
Tuple<string, object, double, double> item = linePointInfo[i]; |
|
962 |
if (item.Item1 == "SYMBOL") |
|
963 |
placeRunInputs.AddSymbolTarget(item.Item2 as LMSymbol, item.Item3, item.Item4); |
|
964 |
else if (item.Item1 == "LINE") |
|
965 |
placeRunInputs.AddConnectorTarget(item.Item2 as LMConnector, item.Item3, item.Item4); |
|
966 |
else |
|
967 |
placeRunInputs.AddPoint(item.Item3, item.Item4); |
|
968 |
} |
|
969 |
|
|
959 | 970 |
LMConnector _lMConnector = _placement.PIDPlaceRun(_LMAItem, placeRunInputs); |
960 | 971 |
|
961 | 972 |
if (_lMConnector != null) |
내보내기 Unified diff