1 |
/* VCG description handler for Bison. |
/* VCG description handler for Bison. |
2 |
Copyright 2001 Free Software Foundation, Inc. |
|
3 |
|
Copyright (C) 2001, 2002 Free Software Foundation, Inc. |
4 |
|
|
5 |
This file is part of Bison, the GNU Compiler Compiler. |
This file is part of Bison, the GNU Compiler Compiler. |
6 |
|
|
23 |
# define VCG_H_ |
# define VCG_H_ |
24 |
|
|
25 |
/* VCG color map. The 32 prime predefined colors. */ |
/* VCG color map. The 32 prime predefined colors. */ |
26 |
enum color_e |
enum color |
27 |
{ |
{ |
28 |
white = 0, |
white = 0, |
29 |
blue, |
blue, |
60 |
}; |
}; |
61 |
|
|
62 |
/* VCG textmode. Specify the adjustement of the text within the border of a summary node. */ |
/* VCG textmode. Specify the adjustement of the text within the border of a summary node. */ |
63 |
enum textmode_e |
enum textmode |
64 |
{ |
{ |
65 |
centered, |
centered, |
66 |
left_justify, |
left_justify, |
68 |
}; |
}; |
69 |
|
|
70 |
/* VCG shapes. Used for nodes shapes. */ |
/* VCG shapes. Used for nodes shapes. */ |
71 |
enum shape_e |
enum shape |
72 |
{ |
{ |
73 |
box, |
box, |
74 |
rhomb, |
rhomb, |
77 |
}; |
}; |
78 |
|
|
79 |
/* Structure for colorentries. */ |
/* Structure for colorentries. */ |
80 |
struct colorentry_s |
struct colorentry |
81 |
{ |
{ |
82 |
int color_index; |
int color_index; |
83 |
int red_cp; |
int red_cp; |
84 |
int green_cp; |
int green_cp; |
85 |
int blue_cp; |
int blue_cp; |
86 |
struct colorentry_s *next; |
struct colorentry *next; |
87 |
}; |
}; |
88 |
|
|
89 |
/* Structure to construct lists of classnames. */ |
/* Structure to construct lists of classnames. */ |
90 |
struct classname_s |
struct classname |
91 |
{ |
{ |
92 |
int no; /* Class number */ |
int no; /* Class number */ |
93 |
const char *name; /* Name associated to the class no. */ |
const char *name; /* Name associated to the class no. */ |
94 |
struct classname_s *next; /* next name class association. */ |
struct classname *next; /* next name class association. */ |
95 |
}; |
}; |
96 |
|
|
97 |
/* Structure is in infoname. */ |
/* Structure is in infoname. */ |
98 |
struct infoname_s |
struct infoname |
99 |
{ |
{ |
100 |
int integer; |
int integer; |
101 |
const char *string; |
char const *chars; |
102 |
struct infoname_s *next; |
struct infoname *next; |
103 |
}; |
}; |
104 |
|
|
105 |
/* Layout Algorithms which can be found in VCG. |
/* Layout Algorithms which can be found in VCG. |
106 |
Details about each algoithm can be found below. */ |
Details about each algoithm can be found below. */ |
107 |
enum layoutalgorithm_e |
enum layoutalgorithm |
108 |
{ |
{ |
109 |
normal, |
normal, |
110 |
maxdepth, |
maxdepth, |
123 |
}; |
}; |
124 |
|
|
125 |
/* VCG decision yes/no. */ |
/* VCG decision yes/no. */ |
126 |
enum decision_e |
enum decision |
127 |
{ |
{ |
128 |
yes, |
yes, |
129 |
no |
no |
130 |
}; |
}; |
131 |
|
|
132 |
/* VCG graph orientation. */ |
/* VCG graph orientation. */ |
133 |
enum orientation_e |
enum orientation |
134 |
{ |
{ |
135 |
top_to_bottom, |
top_to_bottom, |
136 |
bottom_to_top, |
bottom_to_top, |
138 |
right_to_left |
right_to_left |
139 |
}; |
}; |
140 |
|
|
141 |
/* VCG alignement for node alignement. */ |
/* VCG alignment for node alignement. */ |
142 |
enum alignement_e |
enum alignment |
143 |
{ |
{ |
144 |
center, |
center, |
145 |
top, |
top, |
147 |
}; |
}; |
148 |
|
|
149 |
/* VCG arrow mode. */ |
/* VCG arrow mode. */ |
150 |
enum arrow_mode_e |
enum arrow_mode |
151 |
{ |
{ |
152 |
fixed, |
fixed, |
153 |
free_a |
free_a |
154 |
}; |
}; |
155 |
|
|
156 |
/* VCG crossing weight type. */ |
/* VCG crossing weight type. */ |
157 |
enum crossing_type_e |
enum crossing_type |
158 |
{ |
{ |
159 |
bary, |
bary, |
160 |
median, |
median, |
163 |
}; |
}; |
164 |
|
|
165 |
/* VCG views. */ |
/* VCG views. */ |
166 |
enum view_e |
enum view |
167 |
{ |
{ |
168 |
normal_view, |
normal_view, |
169 |
cfish, |
cfish, |
176 |
| Node attributs list. structure that describes a node. | |
| Node attributs list. structure that describes a node. | |
177 |
`------------------------------------------------------*/ |
`------------------------------------------------------*/ |
178 |
|
|
179 |
struct node_s |
struct node |
180 |
{ |
{ |
181 |
/* Title the unique string identifying the node. This attribute is |
/* Title the unique string identifying the node. This attribute is |
182 |
mandatory. */ |
mandatory. */ |
232 |
int width; |
int width; |
233 |
int height; |
int height; |
234 |
|
|
235 |
/* shrink, stretch gives the shrinking and stretching factor of the |
/* shrink, expand gives the shrinking and expanding factor of the |
236 |
node. The values of the attributes width, height, borderwidth and |
node. The values of the attributes width, height, borderwidth and |
237 |
the size of the label text is scaled by ((stretch=shrink) \Lambda |
the size of the label text is scaled by ((expand=shrink) \Lambda |
238 |
100) percent. Note that the actual scale value is determined by the |
100) percent. Note that the actual scale value is determined by the |
239 |
scale value of a node relatively to a scale value of the graph, |
scale value of a node relatively to a scale value of the graph, |
240 |
i.e. if (stretch,shrink) = (2,1) for the graph and (stretch,shrink) |
i.e. if (expand,shrink) = (2,1) for the graph and (expand,shrink) |
241 |
= (2,1) for the node of the graph, then the node is scaled by the |
= (2,1) for the node of the graph, then the node is scaled by the |
242 |
factor 4 compared to the normal size. The scale value can also be |
factor 4 compared to the normal size. The scale value can also be |
243 |
specified by scaling: float. |
specified by scaling: float. |
244 |
Default are 1,1. */ |
Default are 1,1. */ |
245 |
int shrink; |
int shrink; |
246 |
int stretch; |
int expand; |
247 |
|
|
248 |
/* folding specifies the default folding of the nodes. The folding k |
/* folding specifies the default folding of the nodes. The folding k |
249 |
(with k ? 0) means that the graph part that is reachable via edges |
(with k ? 0) means that the graph part that is reachable via edges |
269 |
and triangle. The drawing of ellipses is much slower than the drawing |
and triangle. The drawing of ellipses is much slower than the drawing |
270 |
of the other shapes. |
of the other shapes. |
271 |
Default is box. */ |
Default is box. */ |
272 |
enum shape_e shape; |
enum shape shape; |
273 |
|
|
274 |
/* textmode specifies the adjustment of the text within the border of a |
/* textmode specifies the adjustment of the text within the border of a |
275 |
node. The possibilities are center, left.justify and right.justify. |
node. The possibilities are center, left.justify and right.justify. |
276 |
Default is center. */ |
Default is center. */ |
277 |
enum textmode_e textmode; |
enum textmode textmode; |
278 |
|
|
279 |
/* borderwidth specifies the thickness of the node's border in pixels. |
/* borderwidth specifies the thickness of the node's border in pixels. |
280 |
color is the background color of the node. If none is given, the |
color is the background color of the node. If none is given, the |
285 |
|
|
286 |
/* node color. |
/* node color. |
287 |
Default is white or transparent, */ |
Default is white or transparent, */ |
288 |
enum color_e color; |
enum color color; |
289 |
|
|
290 |
/* textcolor is the color for the label text. bordercolor is the color |
/* textcolor is the color for the label text. bordercolor is the color |
291 |
of the border. Default color is the textcolor. info1, info2, info3 |
of the border. Default color is the textcolor. info1, info2, info3 |
292 |
combines additional text labels with a node or a folded graph. info1, |
combines additional text labels with a node or a folded graph. info1, |
293 |
Default is black. */ |
Default is black. */ |
294 |
enum color_e textcolor; |
enum color textcolor; |
295 |
|
|
296 |
/* info2, info3 can be selected from the menu. The corresponding text |
/* info2, info3 can be selected from the menu. The corresponding text |
297 |
labels can be shown by mouse clicks on nodes. |
labels can be shown by mouse clicks on nodes. |
300 |
|
|
301 |
/* Node border color. |
/* Node border color. |
302 |
Default is textcolor. */ |
Default is textcolor. */ |
303 |
enum color_e bordercolor; |
enum color bordercolor; |
304 |
|
|
305 |
/* Next node node... */ |
/* Next node node... */ |
306 |
struct node_s *next; |
struct node *next; |
307 |
}; |
}; |
308 |
|
|
309 |
/* typedef alias. */ |
/* typedef alias. */ |
310 |
typedef struct node_s node_t; |
typedef struct node node; |
311 |
|
|
312 |
/*-------------------------------------------------------. |
/*-------------------------------------------------------. |
313 |
| Edge attributs list. Structure that describes an edge. | |
| Edge attributs list. Structure that describes an edge. | |
323 |
}; |
}; |
324 |
|
|
325 |
/* Structs enum definitions for edges. */ |
/* Structs enum definitions for edges. */ |
326 |
enum linestyle_e |
enum linestyle |
327 |
{ |
{ |
328 |
continuous, |
continuous, |
329 |
dashed, |
dashed, |
331 |
invisible |
invisible |
332 |
}; |
}; |
333 |
|
|
334 |
enum arrowstyle_e |
enum arrowstyle |
335 |
{ |
{ |
336 |
solid, |
solid, |
337 |
line, |
line, |
338 |
none |
none |
339 |
}; |
}; |
340 |
|
|
341 |
/* The struct edge_s itself. */ |
/* The struct edge itself. */ |
342 |
struct edge_s |
struct edge |
343 |
{ |
{ |
344 |
|
|
345 |
/* Edge type. |
/* Edge type. |
366 |
drawn. The attributes of its shape (color, thickness) are ignored. |
drawn. The attributes of its shape (color, thickness) are ignored. |
367 |
To draw a dashed or dotted line needs more time than solid lines. |
To draw a dashed or dotted line needs more time than solid lines. |
368 |
Default is continuous. */ |
Default is continuous. */ |
369 |
enum linestyle_e linestyle; |
enum linestyle linestyle; |
370 |
|
|
371 |
/* Thickness is the thickness of an edge. |
/* Thickness is the thickness of an edge. |
372 |
Default is 2. */ |
Default is 2. */ |
380 |
|
|
381 |
/* color is the color of the edge. |
/* color is the color of the edge. |
382 |
Default is black. */ |
Default is black. */ |
383 |
enum color_e color; |
enum color color; |
384 |
|
|
385 |
/* textcolor is the color of the label of the edge. arrowcolor, |
/* textcolor is the color of the label of the edge. arrowcolor, |
386 |
backarrowcolor is the color of the arrow head and of the backarrow |
backarrowcolor is the color of the arrow head and of the backarrow |
389 |
of edges that pull a node into its position. The priority of an edges |
of edges that pull a node into its position. The priority of an edges |
390 |
corresponds to the strength of the rubberband. |
corresponds to the strength of the rubberband. |
391 |
Default is color. */ |
Default is color. */ |
392 |
enum color_e textcolor; |
enum color textcolor; |
393 |
|
|
394 |
/* Arrow color. |
/* Arrow color. |
395 |
Default is color. */ |
Default is color. */ |
396 |
enum color_e arrowcolor; |
enum color arrowcolor; |
397 |
|
|
398 |
/* BackArrow color. |
/* BackArrow color. |
399 |
Default is color. */ |
Default is color. */ |
400 |
enum color_e backarrowcolor; |
enum color backarrowcolor; |
401 |
|
|
402 |
/* arrowsize, backarrowsize The arrow head is a right-angled, isosceles |
/* arrowsize, backarrowsize The arrow head is a right-angled, isosceles |
403 |
triangle and the cathetuses have length arrowsize. |
triangle and the cathetuses have length arrowsize. |
416 |
backarrowstyle is the style of the backarrow head. Styles are none, |
backarrowstyle is the style of the backarrow head. Styles are none, |
417 |
i.e. no arrow head, solid, and line. |
i.e. no arrow head, solid, and line. |
418 |
Default is solid. */ |
Default is solid. */ |
419 |
enum arrowstyle_e arrowstyle; |
enum arrowstyle arrowstyle; |
420 |
|
|
421 |
/* Default is none. */ |
/* Default is none. */ |
422 |
enum arrowstyle_e backarrowstyle; |
enum arrowstyle backarrowstyle; |
423 |
|
|
424 |
/* Default is 1. */ |
/* Default is 1. */ |
425 |
int priority; |
int priority; |
449 |
/* |
/* |
450 |
** Next edge node... |
** Next edge node... |
451 |
*/ |
*/ |
452 |
struct edge_s *next; |
struct edge *next; |
453 |
|
|
454 |
}; |
}; |
455 |
|
|
456 |
/* |
/* |
457 |
** typedef alias. |
** typedef alias. |
458 |
*/ |
*/ |
459 |
typedef struct edge_s edge_t; |
typedef struct edge edge; |
460 |
|
|
461 |
/*--------------------------------------------------------. |
/*--------------------------------------------------------. |
462 |
| Graph attributs list. Structure that describes a graph. | |
| Graph attributs list. Structure that describes a graph. | |
463 |
`--------------------------------------------------------*/ |
`--------------------------------------------------------*/ |
464 |
|
|
465 |
struct graph_s |
struct graph |
466 |
{ |
{ |
467 |
/* Graph title or name. |
/* Graph title or name. |
468 |
Title specifies the name (a string) associated with the graph. The |
Title specifies the name (a string) associated with the graph. The |
502 |
index 2, green has index 3, etc. |
index 2, green has index 3, etc. |
503 |
Default is white for background and white or transparent for summary |
Default is white for background and white or transparent for summary |
504 |
nodes. */ |
nodes. */ |
505 |
enum color_e color; |
enum color color; |
506 |
|
|
507 |
/* Textcolor. |
/* Textcolor. |
508 |
need explainations ??? |
need explainations ??? |
509 |
defalut is black for summary nodes. */ |
defalut is black for summary nodes. */ |
510 |
enum color_e textcolor; |
enum color textcolor; |
511 |
|
|
512 |
/* Bordercolor is the color of the summary node's border. Default color |
/* Bordercolor is the color of the summary node's border. Default color |
513 |
is the textcolor. width, height are width and height of the |
is the textcolor. width, height are width and height of the |
514 |
displayed part of the window of the outermost graph in pixels, or |
displayed part of the window of the outermost graph in pixels, or |
515 |
width and height of the summary node of inner subgraphs. |
width and height of the summary node of inner subgraphs. |
516 |
Default is the defalut of the textcolor. */ |
Default is the defalut of the textcolor. */ |
517 |
enum color_e bordercolor; |
enum color bordercolor; |
518 |
|
|
519 |
/* Width, height are width and height of the displayed part of the |
/* Width, height are width and height of the displayed part of the |
520 |
window of the outermost graph in pixels, or width and height of the |
window of the outermost graph in pixels, or width and height of the |
542 |
Defalut value is 0 */ |
Defalut value is 0 */ |
543 |
int folding; |
int folding; |
544 |
|
|
545 |
/* Shrink, stretch gives the shrinking and stretching factor for the |
/* Shrink, expand gives the shrinking and expanding factor for the |
546 |
graph's representation (default is 1, 1). ((stretch=shrink) \Lambda |
graph's representation (default is 1, 1). ((expand=shrink) \Lambda |
547 |
100) is the scaling of the graph in percentage, e.g., |
100) is the scaling of the graph in percentage, e.g., |
548 |
(stretch,shrink) = (1,1) or (2,2) or (3,3) : : : is normal size, |
(expand,shrink) = (1,1) or (2,2) or (3,3) : : : is normal size, |
549 |
(stretch,shrink) = (1,2) is half size, (stretch,shrink) = (2,1) is |
(expand,shrink) = (1,2) is half size, (expand,shrink) = (2,1) is |
550 |
double size. For subgraphs, it is also the scaling factor of the |
double size. For subgraphs, it is also the scaling factor of the |
551 |
summary node. The scaling factor can also be specified by scaling: |
summary node. The scaling factor can also be specified by scaling: |
552 |
float (here, scaling 1.0 means normal size). */ |
float (here, scaling 1.0 means normal size). */ |
553 |
int shrink; |
int shrink; |
554 |
int stretch; |
int expand; |
555 |
|
|
556 |
/* textmode specifies the adjustment of the text within the border of a |
/* textmode specifies the adjustment of the text within the border of a |
557 |
summary node. The possibilities are center, left.justify and |
summary node. The possibilities are center, left.justify and |
558 |
right.justify. |
right.justify. |
559 |
Default value is center.*/ |
Default value is center.*/ |
560 |
enum textmode_e textmode; |
enum textmode textmode; |
561 |
|
|
562 |
/* Shape can be specified for subgraphs only. It is the shape of the |
/* Shape can be specified for subgraphs only. It is the shape of the |
563 |
subgraph summary node that appears if the subgraph is folded: box, |
subgraph summary node that appears if the subgraph is folded: box, |
576 |
influences only the order of the child nodes at a node, but not the |
influences only the order of the child nodes at a node, but not the |
577 |
order of the whole level. |
order of the whole level. |
578 |
Defalut is box, other: rhomb, ellipse, triangle. */ |
Defalut is box, other: rhomb, ellipse, triangle. */ |
579 |
enum shape_e shape; |
enum shape shape; |
580 |
|
|
581 |
/* Vertical order is the level position (rank) of the summary node of an |
/* Vertical order is the level position (rank) of the summary node of an |
582 |
inner subgraph, if this subgraph is folded. We can also specify |
inner subgraph, if this subgraph is folded. We can also specify |
606 |
int xmax; |
int xmax; |
607 |
int ymax; |
int ymax; |
608 |
|
|
609 |
/* xy-base: specify the upper left corner coordonates of the graph |
/* xy-base: specify the upper left corner coordinates of the graph |
610 |
relatively to the root window. |
relatively to the root window. |
611 |
Defaults are 5, 5. */ |
Defaults are 5, 5. */ |
612 |
int xbase; |
int xbase; |
662 |
additional text labels. The names are used in the menus. |
additional text labels. The names are used in the menus. |
663 |
defaults are 1,2,3... |
defaults are 1,2,3... |
664 |
By default, no class names. */ |
By default, no class names. */ |
665 |
struct classname_s *classname; |
struct classname *classname; |
666 |
|
|
667 |
/* Infoname allows to introduce names for the additional text labels. |
/* Infoname allows to introduce names for the additional text labels. |
668 |
The names are used in the menus. |
The names are used in the menus. |
669 |
Infoname is given by an integer and a string. |
Infoname is given by an integer and a string. |
670 |
The default value is NULL. */ |
The default value is NULL. */ |
671 |
struct infoname_s *infoname; |
struct infoname *infoname; |
672 |
|
|
673 |
/* Colorentry allows to fill the color map. A color is a triplet of integer |
/* Colorentry allows to fill the color map. A color is a triplet of integer |
674 |
values for the red/green/blue-part. Each integer is between 0 (off) and |
values for the red/green/blue-part. Each integer is between 0 (off) and |
676 |
colorentry 75 : 70 130 180 sets the map entry 75 to steel blue. This |
colorentry 75 : 70 130 180 sets the map entry 75 to steel blue. This |
677 |
color can be used by specifying just the number 75. |
color can be used by specifying just the number 75. |
678 |
Default id NULL. */ |
Default id NULL. */ |
679 |
struct colorentry_s *colorentry; |
struct colorentry *colorentry; |
680 |
|
|
681 |
/* layoutalgorithm chooses different graph layout algorithms |
/* layoutalgorithm chooses different graph layout algorithms |
682 |
Possibilities are maxdepth, mindepth, maxdepthslow, mindepthslow, |
Possibilities are maxdepth, mindepth, maxdepthslow, mindepthslow, |
704 |
trees. It is much faster on such tree-like graphs and results in a |
trees. It is much faster on such tree-like graphs and results in a |
705 |
balanced layout. |
balanced layout. |
706 |
Default is normal. */ |
Default is normal. */ |
707 |
enum layoutalgorithm_e layoutalgorithm; |
enum layoutalgorithm layoutalgorithm; |
708 |
|
|
709 |
/* Layout downfactor, layout upfactor, layout nearfactor The layout |
/* Layout downfactor, layout upfactor, layout nearfactor The layout |
710 |
algorithm partitions the set of edges into edges pointing upward, |
algorithm partitions the set of edges into edges pointing upward, |
732 |
labels and then partitions the graph, which yield a more compact |
labels and then partitions the graph, which yield a more compact |
733 |
layout, but may have more crossings. |
layout, but may have more crossings. |
734 |
Default is no. */ |
Default is no. */ |
735 |
enum decision_e late_edge_labels; |
enum decision late_edge_labels; |
736 |
|
|
737 |
/* Display edge labels yes means display labels and no means don't |
/* Display edge labels yes means display labels and no means don't |
738 |
display edge labels. |
display edge labels. |
739 |
Default vaule is no. */ |
Default vaule is no. */ |
740 |
enum decision_e display_edge_labels; |
enum decision display_edge_labels; |
741 |
|
|
742 |
/* Dirty edge labels yes enforces a fast layout of edge labels, which |
/* Dirty edge labels yes enforces a fast layout of edge labels, which |
743 |
may very ugly because several labels may be drawn at the same place. |
may very ugly because several labels may be drawn at the same place. |
744 |
Dirty edge labels cannot be used if splines are used. |
Dirty edge labels cannot be used if splines are used. |
745 |
Default is no. |
Default is no. |
746 |
*/ |
*/ |
747 |
enum decision_e dirty_edge_labels; |
enum decision dirty_edge_labels; |
748 |
|
|
749 |
/* Finetuning no switches the fine tuning phase of the graph layout |
/* Finetuning no switches the fine tuning phase of the graph layout |
750 |
algorithm off, while it is on as default. The fine tuning phase |
algorithm off, while it is on as default. The fine tuning phase |
751 |
tries to give all edges the same length. |
tries to give all edges the same length. |
752 |
Default is yes. */ |
Default is yes. */ |
753 |
enum decision_e finetuning; |
enum decision finetuning; |
754 |
|
|
755 |
/* Ignore singles yes hides all nodes which would appear single and |
/* Ignore singles yes hides all nodes which would appear single and |
756 |
unconnected from the remaining graph. Such nodes have no edge at all |
unconnected from the remaining graph. Such nodes have no edge at all |
757 |
and are sometimes very ugly. Default is to show all nodes. |
and are sometimes very ugly. Default is to show all nodes. |
758 |
Default is no. */ |
Default is no. */ |
759 |
enum decision_e ignore_singles; |
enum decision ignore_singles; |
760 |
|
|
761 |
/* Straight phase yes initiates an additional phase that tries to avoid |
/* Long straight phase yes initiates an additional phase that tries to avoid |
762 |
bendings in long edges. |
bendings in long edges. |
763 |
Long edges are laid out by long straight vertical lines with |
Long edges are laid out by long straight vertical lines with |
764 |
gradient 90 degree. Thus, this phase is not very appropriate for |
gradient 90 degree. Thus, this phase is not very appropriate for |
765 |
normal layout, but it is recommended, if an orthogonal layout is |
normal layout, but it is recommended, if an orthogonal layout is |
766 |
selected (see manhattan.edges). |
selected (see manhattan.edges). |
767 |
Default is no. */ |
Default is no. */ |
768 |
enum decision_e straight_phase; |
enum decision long_straight_phase; |
769 |
|
|
770 |
/* priority phase yes replaces the normal pendulum method by a |
/* priority phase yes replaces the normal pendulum method by a |
771 |
specialized method: It forces straight long edges with 90 degree, |
specialized method: It forces straight long edges with 90 degree, |
773 |
tune phase of the priority method. This phase is also recommended, |
tune phase of the priority method. This phase is also recommended, |
774 |
if an orthogonal layout is selected (see manhattan.edges). |
if an orthogonal layout is selected (see manhattan.edges). |
775 |
Default is no. */ |
Default is no. */ |
776 |
enum decision_e priority_phase; |
enum decision priority_phase; |
777 |
|
|
778 |
/* manhattan edges yes switches the orthogonal layout on. Orthogonal |
/* manhattan edges yes switches the orthogonal layout on. Orthogonal |
779 |
layout (or manhattan layout) means that all edges consist of line |
layout (or manhattan layout) means that all edges consist of line |
785 |
on, too, unless priority layout and straight line tuning are |
on, too, unless priority layout and straight line tuning are |
786 |
switched off explicitly. |
switched off explicitly. |
787 |
Default is no. */ |
Default is no. */ |
788 |
enum decision_e manhattan_edges; |
enum decision manhattan_edges; |
789 |
|
|
790 |
/* Smanhattan edges yes switches a specialized orthogonal layout on: |
/* Smanhattan edges yes switches a specialized orthogonal layout on: |
791 |
Here, all horizontal edge segments between two levels share the same |
Here, all horizontal edge segments between two levels share the same |
794 |
looks nice for trees but might be too confusing in general, because |
looks nice for trees but might be too confusing in general, because |
795 |
the location of an edge might be ambiguously. |
the location of an edge might be ambiguously. |
796 |
Default is no. */ |
Default is no. */ |
797 |
enum decision_e smanhattan_edges; |
enum decision smanhattan_edges; |
798 |
|
|
799 |
/* Near edges no suppresses near edges and bent near edges in the |
/* Near edges no suppresses near edges and bent near edges in the |
800 |
graph layout. |
graph layout. |
801 |
Default is yes. */ |
Default is yes. */ |
802 |
enum decision_e near_edges; |
enum decision near_edges; |
803 |
|
|
804 |
/* Orientation specifies the orientation of the graph: top.to.bottom, |
/* Orientation specifies the orientation of the graph: top.to.bottom, |
805 |
bottom.to.top, left.to.right or right.to.left. Note: the normal |
bottom.to.top, left.to.right or right.to.left. Note: the normal |
808 |
is left to right, the attribute xlspace is not the horizontal but |
is left to right, the attribute xlspace is not the horizontal but |
809 |
the vertical distance between lines, etc. |
the vertical distance between lines, etc. |
810 |
Default is to_to_bottom. */ |
Default is to_to_bottom. */ |
811 |
enum orientation_e orientation; |
enum orientation orientation; |
812 |
|
|
813 |
/* Node alignment specified the vertical alignment of nodes at the |
/* Node alignment specified the vertical alignment of nodes at the |
814 |
horizontal reference line of the levels. If top is specified, the |
horizontal reference line of the levels. If top is specified, the |
816 |
the bottoms have the same y-coordinate, on center the nodes are |
the bottoms have the same y-coordinate, on center the nodes are |
817 |
centered at the levels. |
centered at the levels. |
818 |
Default is center. */ |
Default is center. */ |
819 |
enum alignement_e node_alignement; |
enum alignment node_alignment; |
820 |
|
|
821 |
/* Port sharing no suppresses the sharing of ports of edges at the |
/* Port sharing no suppresses the sharing of ports of edges at the |
822 |
nodes. Normally, if multiple edges are adjacent to the same node, |
nodes. Normally, if multiple edges are adjacent to the same node, |
828 |
is used, each edge has its own port, i.e. its own place where it is |
is used, each edge has its own port, i.e. its own place where it is |
829 |
adjacent to the node. |
adjacent to the node. |
830 |
Default is yes. */ |
Default is yes. */ |
831 |
enum decision_e port_sharing; |
enum decision port_sharing; |
832 |
|
|
833 |
/* Arrow mode fixed (default) should be used, if port sharing is used, |
/* Arrow mode fixed (default) should be used, if port sharing is used, |
834 |
because then, only a fixed set of rotations for the arrow heads are |
because then, only a fixed set of rotations for the arrow heads are |
839 |
arrow mode is fixed, then the arrow head is rotated only in steps of |
arrow mode is fixed, then the arrow head is rotated only in steps of |
840 |
45 degree, and only one arrow head occurs at each port. |
45 degree, and only one arrow head occurs at each port. |
841 |
Default is fixed. */ |
Default is fixed. */ |
842 |
enum arrow_mode_e arrow_mode; |
enum arrow_mode arrow_mode; |
843 |
|
|
844 |
/* Treefactor The algorithm tree for downward laid out trees tries to |
/* Treefactor The algorithm tree for downward laid out trees tries to |
845 |
produce a medium dense, balanced tree-like layout. If the tree |
produce a medium dense, balanced tree-like layout. If the tree |
869 |
different nodes are not very probable, thus the crossing reduction |
different nodes are not very probable, thus the crossing reduction |
870 |
phase 2 might be very fast. |
phase 2 might be very fast. |
871 |
Default is bary. */ |
Default is bary. */ |
872 |
enum crossing_type_e crossing_weight; |
enum crossing_type crossing_weight; |
873 |
|
|
874 |
/* Crossing phase2 is the most time consuming phase of the crossing |
/* Crossing phase2 is the most time consuming phase of the crossing |
875 |
reduction. In this phase, the nodes that happen to have equal |
reduction. In this phase, the nodes that happen to have equal |
876 |
crossing weights are permuted. By specifying no, this phase is |
crossing weights are permuted. By specifying no, this phase is |
877 |
suppressed. |
suppressed. |
878 |
Default is yes. */ |
Default is yes. */ |
879 |
enum decision_e crossing_phase2; |
enum decision crossing_phase2; |
880 |
|
|
881 |
/* Crossing optimization is a postprocessing phase after the normal |
/* Crossing optimization is a postprocessing phase after the normal |
882 |
crossing reduction: we try to optimize locally, by exchanging pairs |
crossing reduction: we try to optimize locally, by exchanging pairs |
883 |
of nodes to reduce the crossings. Although this phase is not very |
of nodes to reduce the crossings. Although this phase is not very |
884 |
time consuming, it can be suppressed by specifying no. |
time consuming, it can be suppressed by specifying no. |
885 |
Default is yes. */ |
Default is yes. */ |
886 |
enum decision_e crossing_optimization; |
enum decision crossing_optimization; |
887 |
|
|
888 |
/* View allows to select the fisheye views. Because |
/* View allows to select the fisheye views. Because |
889 |
of the fixed size of the window that shows the graph, we normally |
of the fixed size of the window that shows the graph, we normally |
908 |
selected that shows the whole graph, and with fpfish the fixed |
selected that shows the whole graph, and with fpfish the fixed |
909 |
radius polar fisheye is selected. |
radius polar fisheye is selected. |
910 |
Defalut is normal view. */ |
Defalut is normal view. */ |
911 |
enum view_e view; |
enum view view; |
912 |
|
|
913 |
/* Edges no suppresses the drawing of edges. |
/* Edges no suppresses the drawing of edges. |
914 |
Default is yes. */ |
Default is yes. */ |
915 |
enum decision_e edges; |
enum decision edges; |
916 |
|
|
917 |
/* Nodes no suppresses the drawing of nodes. |
/* Nodes no suppresses the drawing of nodes. |
918 |
Default is yes. */ |
Default is yes. */ |
919 |
enum decision_e nodes; |
enum decision nodes; |
920 |
|
|
921 |
/* Splines specifies whether splines are used to draw edges (yes or no). |
/* Splines specifies whether splines are used to draw edges (yes or no). |
922 |
As default, polygon segments are used to draw edges, because this is |
As default, polygon segments are used to draw edges, because this is |
924 |
validated, and is very slow. Its use is mainly to prepare high |
validated, and is very slow. Its use is mainly to prepare high |
925 |
quality PostScript output for very small graphs. |
quality PostScript output for very small graphs. |
926 |
Default is no. */ |
Default is no. */ |
927 |
enum decision_e splines; |
enum decision splines; |
928 |
|
|
929 |
/* Bmax set the maximal number of iterations that are done for the |
/* Bmax set the maximal number of iterations that are done for the |
930 |
reduction of edge bendings. |
reduction of edge bendings. |
977 |
|
|
978 |
/* Generic values. |
/* Generic values. |
979 |
*/ |
*/ |
980 |
node_t node; |
node node; |
981 |
edge_t edge; |
edge edge; |
982 |
|
|
983 |
/* List of nodes declared. |
/* List of nodes declared. |
984 |
Pointer. */ |
Pointer. */ |
985 |
node_t *node_list; |
node *node_list; |
986 |
|
|
987 |
/* List of edges declared. |
/* List of edges declared. |
988 |
Pointer. */ |
Pointer. */ |
989 |
edge_t *edge_list; |
edge *edge_list; |
990 |
|
|
991 |
}; |
}; |
992 |
|
|
993 |
/* Graph typedefs. */ |
/* Graph typedefs. */ |
994 |
typedef struct graph_s graph_t; |
typedef struct graph graph; |
995 |
|
|
996 |
void new_graph (graph_t *g); |
void new_graph (graph *g); |
997 |
void new_node (node_t *node); |
void new_node (node *n); |
998 |
void new_edge (edge_t *edge); |
void new_edge (edge *e); |
999 |
|
|
1000 |
void add_node (graph_t *graph, node_t *node); |
void add_node (graph *g, node *n); |
1001 |
void add_edge (graph_t *graph, edge_t *edge); |
void add_edge (graph *g, edge *e); |
1002 |
|
|
1003 |
void add_colorentry (graph_t *g, int color_idx, int red_cp, |
void add_colorentry (graph *g, int color_idx, int red_cp, |
1004 |
int green_cp, int blue_cp); |
int green_cp, int blue_cp); |
1005 |
void add_classname (graph_t *g, int val, const char *name); |
void add_classname (graph *g, int val, const char *name); |
1006 |
void add_infoname (graph_t *g, int val, const char *name); |
void add_infoname (graph *g, int val, const char *name); |
1007 |
|
|
1008 |
void open_node (FILE *fout); |
void open_node (FILE *fout); |
1009 |
void output_node (node_t *node, FILE *fout); |
void output_node (node *n, FILE *fout); |
1010 |
void close_node (FILE *fout); |
void close_node (FILE *fout); |
1011 |
|
|
1012 |
void open_edge (edge_t *edge, FILE *fout); |
void open_edge (edge *e, FILE *fout); |
1013 |
void output_edge (edge_t *edge, FILE *fout); |
void output_edge (edge *e, FILE *fout); |
1014 |
void close_edge (FILE *fout); |
void close_edge (FILE *fout); |
1015 |
|
|
1016 |
void open_graph (FILE *fout); |
void open_graph (FILE *fout); |
1017 |
void output_graph (graph_t *graph, FILE *fout); |
void output_graph (graph *g, FILE *fout); |
1018 |
void close_graph (graph_t *graph, FILE *fout); |
void close_graph (graph *g, FILE *fout); |
1019 |
|
|
1020 |
#endif /* VCG_H_ */ |
#endif /* VCG_H_ */ |