00001 #include <assert.h> 00002 struct adjedge; 00003 struct gedge; 00004 struct gnlist; // list of gnodes 00005 struct dllist; 00006 00007 typedef struct adjedge { 00008 struct gedge *kante; 00009 struct adjedge *next; 00010 struct adjedge *internal_next; 00011 } *ADJEDGE; 00012 00013 typedef struct gedge 00014 { 00015 struct gnode *start; 00016 long sxloc; 00017 long syloc; 00018 long btxloc; 00019 long btyloc; 00020 long bbxloc; 00021 long bbyloc; 00022 struct gnode *end; 00023 long exloc; 00024 long eyloc; 00025 struct { 00026 unsigned char eori:4; 00027 unsigned char eori2: 4; 00028 } orientation; 00029 char linestyle; 00030 char thickness; 00031 char *label; 00032 int priority; 00033 int horder; 00034 short eclass; 00035 unsigned char color; 00036 char arrowstyle1; 00037 char arrowstyle2; 00038 char arrowsize1; 00039 unsigned char arrowcolor1; 00040 char arrowsize2; 00041 unsigned char arrowcolor2; 00042 unsigned char labelcolor; 00043 int anchor; 00044 char *url; 00045 char kantenart; 00046 char invisible; 00047 int weights; 00048 int weightp; 00049 struct gnode *labelnode; 00050 struct gedge *next; 00051 struct gedge *before; 00052 struct gedge *internal_next; 00053 } *GEDGE; 00054 00055 typedef struct gnode 00056 { 00057 int refnum; 00058 char *title; 00059 char *label; 00060 char *info1; 00061 char *info2; 00062 char *info3; 00063 char *font; 00064 unsigned char color; 00065 unsigned char textcolor; 00066 unsigned char bordercolor; 00067 signed int width; 00068 signed int height; 00069 unsigned char borderwidth; 00070 int sxloc; 00071 int syloc; 00072 char folding; 00073 int shrink; 00074 int stretch; 00075 char textmode; 00076 char *url; 00077 char status; 00078 char shape; 00079 int level; 00080 int nhorder; 00081 struct gnlist *subgraph; 00082 struct gnode *root; 00083 struct gnode *regionrepl; 00084 struct gnlist *region; 00085 struct gnode *regroot; 00086 long xloc; 00087 long yloc; 00088 struct gnode *next; 00089 struct gnode *before; 00090 char in_nodelist; 00091 char invisible; 00092 char markiert; 00093 char revert; 00094 char anchordummy; 00095 int tiefe; 00096 int position; 00097 float bary; 00098 long weights; 00099 long weightp; 00100 long dfsnum; 00101 int indegree; 00102 int outdegree; 00103 struct dllist *Vpointer; 00104 struct adjedge *tmpadj; 00105 struct adjedge *pred; 00106 struct adjedge *succ; 00107 struct adjedge *savepred; 00108 struct adjedge *savesucc; 00109 struct gedge *predleft; 00110 struct gedge *predright; 00111 struct gedge *succleft; 00112 struct gedge *succright; 00113 struct connect *connection; 00114 struct gnode *internal_next; 00115 } *GNODE; 00116 00117 typedef struct gnlist { 00118 struct gnode *node; 00119 struct gnlist *next; 00120 struct gnlist *internal_next; 00121 } *GNLIST; 00122 00123 static int compare_pos (const GNODE *a, const GNODE *b); 00124 00125 enum values_crossing_heuristics 00126 { 00127 CROSSING_BARY=0, 00128 CROSSING_MEDIAN, 00129 CROSSING_BARYMEDIAN, 00130 CROSSING_MEDIANBARY 00131 }; 00132 00133 typedef struct depth_entry { 00134 int anz; 00135 int actx; 00136 int cross; 00137 GNODE refnode; 00138 struct gnlist *predlist; 00139 struct gnlist *succlist; 00140 char resort_necessary; 00141 } DEPTH; 00142 00143 typedef struct dllist { 00144 struct gnode *node; 00145 int dlinfo; 00146 int dlx; 00147 struct dllist *pred; 00148 struct dllist *succ; 00149 } *DLLIST; 00150 00151 // compare functions 00152 int compare_bary (const GNODE *a, const GNODE *b); 00153 int compare_pos (const GNODE *a, const GNODE *b); 00154 00155 void save_level (int i); 00156 00157 00159 extern int max_nodes_per_layer; 00160 extern DEPTH *layer; 00161 extern int nr_crossings; 00162 extern GNODE *save_array ; 00163 extern int crossing_heuristics; 00164 extern GNODE *sort_array ; 00165 extern int size_of_sortarray ; 00166 extern DEPTH *tmp_layer ; 00167 extern int size_of_tlayer; 00168 00169 extern int maxdepth; 00170 00171 00172 //layer_crossing 00173 extern int size_upper_list; 00174 extern int size_lower_list; 00175 extern DLLIST lower_list; 00176 extern DLLIST lower_list_end; 00177 extern DLLIST upper_list; 00178 extern DLLIST upper_list_end; 00179 extern int nr_tcrossings; 00180 00181 // guesses 00182 extern int max_baryiterations; 00183 extern int min_baryiterations; 00184 extern int nr_bary_iterations; 00185 00186 extern int maxdepth; 00187 extern int max_eprio; 00188 00189 extern int max_horder_num; 00190 00191 extern int phase2_startlevel;// level 00192 extern int skip_baryphase2; 00193 00194 extern int G_timelimit; 00195 00196 extern int maxr_lower_list ; 00197 extern int maxr_upper_list ; 00198 extern int maxr_sum ; 00199 extern int upperxpos ; 00200 extern int lowerxpos ; 00201 00202 #define DINFO(x) ((x)->dlinfo) 00203 #define DNODE(x) ((x)->node) 00204 #define DNX(x) ((x)->dlx) 00205 #define DPRED(x) ((x)->pred) 00206 #define DSUCC(x) ((x)->succ) 00207 #define EENDX(x) ((x)->exloc) 00208 #define EENDY(x) ((x)->eyloc) 00209 #define ESTART(x) ((x)->start) 00210 #define ESTARTX(x) ((x)->sxloc) 00211 #define ESTARTY(x) ((x)->syloc) 00212 #define ETBENDX(x) ((x)->btxloc) 00213 #define ETBENDY(x) ((x)->btyloc) 00214 #define NPRED(x) ((x)->pred) 00215 00216 00217 #define EEND(x) ((x)->end) 00218 #define EENDX(x) ((x)->exloc) 00219 #define EENDY(x) ((x)->eyloc) 00220 00221 #define AKANTE(x) ((x)->kante) 00222 #define AKANTE_SET(x,y) ((x)->kante=y) 00223 #define SOURCE(x) (ESTART(AKANTE(x))) 00224 #define TARGET(x) (EEND(AKANTE(x))) 00225 #define ESOURCEX(x) (ESTARTX(AKANTE(x))) 00226 #define ESOURCEY(x) (ESTARTY(AKANTE(x))) 00227 #define ETARGETX(x) (EENDX(AKANTE(x))) 00228 #define ETARGETY(x) (EENDY(AKANTE(x))) 00229 #define EKIND(x) (EART(AKANTE(x))) 00230 #define NSOURTIEFE(x) (NTIEFE(ESTART(AKANTE(x)))) 00231 #define NTARTIEFE(x) (NTIEFE(EEND(AKANTE(x)))) 00232 00233 #define NSUCC(x) ((x)->succ) 00234 #define NSUCCL(x) ((x)->succleft) 00235 #define NSUCCR(x) ((x)->succright) 00236 00237 #define ANEXT(x) ((x)->next) 00238 #define ANEXT_SET(x,y) ((x)->next=y) 00239 #define GNINTERN(x) ((x)->internal_next) 00240 #define GNNODE(x) ((x)->node) 00241 #define GNNEXT(x) ((x)->next) 00242 00243 00244 00245 00246 00247 extern int nr_bary_iterations; 00248 extern int max_baryiterations; 00249 extern int max_horder_num; 00250 extern int nr_bary_iterations; 00251