00001 STATIC void finish_upper(GNODE v, int xpos) 00002 { 00003 ADJEDGE a = (ADJEDGE)0; 00004 GEDGE ee = (GEDGE)0; 00005 DLLIST n = (DLLIST)0; 00006 DLLIST m = (DLLIST)0; 00007 int k = 0; 00008 00009 k = maxr_upper_list + maxr_lower_list; 00010 00011 if (k > maxr_sum) { maxr_sum = k; } 00012 00013 if (xpos <= upperxpos) { return; } 00014 00015 upperxpos = xpos; 00016 00017 /* for all NSUCC's of v in order of their gradient... 00018 * the edges, that are not yet threated are now inserted. 00019 */ 00020 a = NSUCC(v); 00021 while (a) { 00022 00023 ee = AKANTE(a); 00024 00025 if ((ESTARTX(ee) == xpos) && (EENDX(ee) > ESTARTX(ee))) { 00026 /* nonfinished: touch it */ 00027 append_to_lower(ee, TARGET(a)); 00028 } 00029 00030 a = ANEXT(a); 00031 } 00032 00033 k = maxr_upper_list + maxr_lower_list; 00034 00035 if (k > maxr_sum) { maxr_sum = k; } 00036 00037 n = upper_list; 00038 while (n) { 00039 m = DSUCC(n); 00040 00041 if (DNX(n) <= xpos) { delete_upper(n); } 00042 00043 n = m; 00044 } 00045 00046 maxr_upper_list = 0; 00047 00048 n = upper_list; 00049 while (n) { 00050 00051 if (DINFO(n) > maxr_upper_list) { maxr_upper_list = DINFO(n); } 00052 00053 n = DSUCC(n); 00054 } 00055 00056 return; 00057 } 00058 00059 00070 STATIC void finish_lower(GNODE v, int xpos) 00071 { 00072 ADJEDGE a = (ADJEDGE)0; 00073 GEDGE ee = (GEDGE)0; 00074 DLLIST n = (DLLIST)0; 00075 DLLIST m = (DLLIST)0; 00076 int k = 0; 00077 00078 k = maxr_upper_list + maxr_lower_list; 00079 00080 if (k > maxr_sum) { maxr_sum = k; } 00081 00082 if (xpos <= lowerxpos) { return; } 00083 00084 lowerxpos = xpos; 00085 00086 /* for all NPRED's of v in order of their gradient... 00087 * the edges, that are not yet threated are now inserted. 00088 */ 00089 a = NPRED(v); 00090 while (a) { 00091 00092 ee = AKANTE(a); 00093 00094 if ((EENDX(ee) == xpos) && (EENDX(ee) <= ESTARTX(ee))) { 00095 /* nonfinished: touch it XXX (todo) */ 00096 append_to_upper(ee, SOURCE(a)); 00097 } 00098 00099 a = ANEXT(a); 00100 } 00101 00102 k = maxr_upper_list + maxr_lower_list; 00103 00104 if (k>maxr_sum) { maxr_sum = k; } 00105 00106 n = lower_list; 00107 while (n) { 00108 00109 m = DSUCC(n); 00110 00111 if (DNX(n) <= xpos) { delete_lower(n); } 00112 00113 n = m; 00114 } 00115 00116 maxr_lower_list = 0; 00117 00118 n = lower_list; 00119 while (n) { 00120 00121 if (DINFO(n)> maxr_lower_list) { maxr_lower_list = DINFO(n); } 00122 00123 n = DSUCC(n); 00124 } 00125 00126 return; 00127 } 00128 00129 00130 00131