]>
git.saurik.com Git - bison.git/blob - src/vcg.c
1 /* VCG description handler for Bison.
2 Copyright 2001 Free Software Foundation, Inc.
4 This file is part of Bison, the GNU Compiler Compiler.
6 Bison is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
11 Bison is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with Bison; see the file COPYING. If not, write to
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. */
23 #include "vcg_defaults.h"
25 /* Initialize a graph with the default values. */
27 new_graph (graph_t
*g
)
32 g
->infos
[0] = G_INFOS1
;
33 g
->infos
[1] = G_INFOS2
;
34 g
->infos
[2] = G_INFOS3
;
37 g
->textcolor
= G_TEXTCOLOR
;
38 g
->bordercolor
= G_BORDERCOLOR
;
42 g
->borderwidth
= G_BORDERWIDTH
;
45 g
->folding
= G_FOLDING
;
47 g
->stretch
= G_STRETCH
;
49 g
->textmode
= G_TEXTMODE
;
52 g
->vertical_order
= G_VERTICAL_ORDER
;
53 g
->horizontal_order
= G_HORIZONTAL_ORDER
;
55 g
->xmax
= G_XMAX
; /* Not output. */
56 g
->ymax
= G_YMAX
; /* Not output. */
63 g
->xlspace
= G_XLSPACE
; /* Not output. */
65 g
->xraster
= G_XRASTER
;
66 g
->yraster
= G_YRASTER
;
67 g
->xlraster
= G_XLRASTER
;
69 g
->hidden
= G_HIDDEN
; /* No default value. */
71 g
->classname
= G_CLASSNAME
; /* No class name association. */
73 g
->layoutalgorithm
= G_LAYOUTALGORITHM
;
74 g
->layout_downfactor
= G_LAYOUT_DOWNFACTOR
;
75 g
->layout_upfactor
= G_LAYOUT_UPFACTOR
;
76 g
->layout_nearfactor
= G_LAYOUT_NEARFACTOR
;
77 g
->layout_splinefactor
= G_LAYOUT_SPLINEFACTOR
;
79 g
->late_edge_labels
= G_LATE_EDGE_LABELS
;
80 g
->display_edge_labels
= G_DISPLAY_EDGE_LABELS
;
81 g
->dirty_edge_labels
= G_DIRTY_EDGE_LABELS
;
82 g
->finetuning
= G_FINETUNING
;
83 g
->ignore_singles
= G_IGNORE_SINGLES
;
84 g
->straight_phase
= G_STRAIGHT_PHASE
;
85 g
->priority_phase
= G_PRIORITY_PHASE
;
86 g
->manhattan_edges
= G_MANHATTAN_EDGES
;
87 g
->smanhattan_edges
= G_SMANHATTAN_EDGES
;
88 g
->near_edges
= G_NEAR_EDGES
;
90 g
->orientation
= G_ORIENTATION
;
91 g
->node_alignement
= G_NODE_ALIGNEMENT
;
92 g
->port_sharing
= G_PORT_SHARING
;
93 g
->arrow_mode
= G_ARROW_MODE
;
94 g
->treefactor
= G_TREEFACTOR
;
95 g
->spreadlevel
= G_SPREADLEVEL
;
96 g
->crossing_weight
= G_CROSSING_WEIGHT
;
97 g
->crossing_phase2
= G_CROSSING_PHASE2
;
98 g
->crossing_optimization
= G_CROSSING_OPTIMIZATION
;
103 g
->splines
= G_SPLINES
;
114 g
->node_list
= G_NODE_LIST
;
115 g
->edge_list
= G_EDGE_LIST
;
121 /* Initialize a node with the defalut values. */
123 new_node (node_t
*node
)
125 node
->title
= N_TITLE
;
126 node
->label
= N_LABEL
;
128 node
->locx
= N_LOCX
; /* Default unspcified. */
129 node
->locy
= N_LOCY
; /* Default unspcified. */
131 node
->vertical_order
= N_VERTICAL_ORDER
; /* Default unspcified. */
132 node
->horizontal_order
= N_HORIZONTAL_ORDER
; /* Default unspcified. */
134 node
->width
= N_WIDTH
; /* We assume that we can't define it now. */
135 node
->height
= N_HEIGHT
; /* Also. */
137 node
->shrink
= N_SHRINK
;
138 node
->stretch
= N_STRETCH
;
140 node
->folding
= N_FOLDING
; /* No explicit default value. */
142 node
->shape
= N_SHAPE
;
143 node
->textmode
= N_TEXTMODE
;
144 node
->borderwidth
= N_BORDERWIDTH
;
146 node
->color
= N_COLOR
;
147 node
->textcolor
= N_TEXTCOLOR
;
148 node
->bordercolor
= N_BORDERCOLOR
;
150 node
->infos
[0] = N_INFOS1
;
151 node
->infos
[1] = N_INFOS2
;
152 node
->infos
[2] = N_INFOS3
;
157 /* Initialize a edge with the defalut values. */
159 new_edge (edge_t
*edge
)
161 edge
->type
= E_EDGE_TYPE
;
163 edge
->sourcename
= E_SOURCENAME
;
164 edge
->targetname
= E_TARGETNAME
;
165 edge
->label
= E_LABEL
;
167 edge
->linestyle
= E_LINESTYLE
;
168 edge
->thickness
= E_THICKNESS
;
170 edge
->class = E_CLASS
;
172 edge
->color
= E_COLOR
;
173 edge
->textcolor
= E_TEXTCOLOR
;
174 edge
->arrowcolor
= E_ARROWCOLOR
;
175 edge
->backarrowcolor
= E_BACKARROWCOLOR
;
177 edge
->arrowsize
= E_ARROWSIZE
;
178 edge
->backarrowsize
= E_BACKARROWSIZE
;
179 edge
->arrowstyle
= E_ARROWSTYLE
;
181 edge
->backarrowstyle
= E_BACKARROWSTYLE
;
183 edge
->priority
= E_PRIORITY
;
185 edge
->anchor
= E_ANCHOR
;
187 edge
->horizontal_order
= E_HORIZONTAL_ORDER
;
192 /*----------------------------------------------.
194 | Return string corresponding to an enum value. |
195 `----------------------------------------------*/
198 get_color_str (enum color_e c
)
202 case white
: return "white";
203 case blue
: return "blue";
204 case red
: return "red";
205 case green
: return "green";
206 case yellow
: return "yellow";
207 case magenta
: return "magenta";
208 case cyan
: return "cyan";
209 case darkgrey
: return "darkgrey";
210 case darkblue
: return "darkblue";
211 case darkred
: return "darkred";
212 case darkgreen
: return "darkgreen";
213 case darkyellow
: return "darkyellow";
214 case darkmagenta
: return "darkmagenta";
215 case darkcyan
: return "darkcyan";
216 case gold
: return "gold";
217 case lightgrey
: return "lightgrey";
218 case lightblue
: return "lightblue";
219 case lightred
: return "lightred";
220 case lightgreen
: return "lightgreen";
221 case lightyellow
: return "lightyellow";
222 case lightmagenta
: return "lightmagenta";
223 case lightcyan
: return "lightcyan";
224 case lilac
: return "lilac";
225 case turquoise
: return "turquoise";
226 case aquamarine
: return "aquamarine";
227 case khaki
: return "khaki";
228 case purple
: return "purple";
229 case yellowgreen
: return "yellowgreen";
230 case pink
: return "pink";
231 case orange
: return "orange";
232 case orchid
: return "orchid";
233 case black
: return "black";
235 assert (!"Not a default color.");
241 get_textmode_str (enum textmode_e t
)
245 case centered
: return "center";
246 case left_justify
: return "left_justify";
247 case right_justify
: return "right_justify";
249 assert (!"Not a text mode.");
255 get_shape_str (enum shape_e s
)
259 case box
: return "box";
260 case rhomb
: return "rhomb";
261 case ellipse
: return "ellipse";
262 case triangle
: return "triangle";
264 assert (!"Not a shape.");
270 get_layoutalgorithm_str (enum layoutalgorithm_e l
)
274 case normal
: return "normal";
275 case maxdepth
: return "maxdepth";
276 case mindepth
: return "mindepth";
277 case maxdepthslow
: return "maxdepthslow";
278 case mindepthslow
: return "mindepthslow";
279 case maxdegree
: return "maxdegree";
280 case mindegree
: return "mindegree";
281 case maxindegree
: return "maxindegree";
282 case minindegree
: return "minindegree";
283 case maxoutdegree
: return "maxoutdegree";
284 case minoutdegree
: return "minoutdegree";
285 case minbackward
: return "minbackward";
286 case dfs
: return "dfs";
287 case tree
: return "tree";
289 assert (!"Not a layout algorithm.");
295 get_decision_str (enum decision_e d
)
299 case no
: return "no";
300 case yes
: return "yes";
302 assert (!"Either yes nor no.");
308 get_orientation_str (enum orientation_e o
)
312 case top_to_bottom
: return "top_to_bottom";
313 case bottom_to_top
: return "bottom_to_top";
314 case left_to_right
: return "left_to_right";
315 case right_to_left
: return "right_to_left";
317 assert (!"Not an orientation.");
323 get_node_alignement_str (enum alignement_e a
)
327 case center
: return "center";
328 case top
: return "top";
329 case bottom
: return "bottom";
331 assert (!"Not an alignement.");
337 get_arrow_mode_str (enum arrow_mode_e a
)
341 case fixed
: return "fixed";
342 case free_a
: return "free";
344 assert (!"Not an arrow mode.");
350 get_crossing_type_str (enum crossing_type_e c
)
354 case bary
: return "bary";
355 case median
: return "median";
356 case barymedian
: return "barymedian";
357 case medianbary
: return "medianbary";
359 assert (!"Not a crossing type.");
365 get_view_str (enum view_e v
)
369 case normal_view
: return "normal_view";
370 case cfish
: return "cfish";
371 case pfish
: return "pfish";
372 case fcfish
: return "fcfish";
373 case fpfish
: return "fpfish";
375 assert (!"Not a view.");
381 get_linestyle_str (enum linestyle_e l
)
385 case continuous
: return "continuous";
386 case dashed
: return "dashed";
387 case dotted
: return "dotted";
388 case invisible
: return "invisible";
390 assert (!"Not a line style.");
396 get_arrowstyle_str (enum arrowstyle_e a
)
400 case solid
: return "solid";
401 case line
: return "line";
402 case none
: return "none";
404 assert (!"Not an arrow style.");
409 /*----------------------------.
411 | Edge and Nodes int a graph. |
412 `----------------------------*/
415 add_node (graph_t
*graph
, node_t
*node
)
417 node
->next
= graph
->node_list
;
418 graph
->node_list
= node
;
422 add_edge (graph_t
*graph
, edge_t
*edge
)
424 edge
->next
= graph
->edge_list
;
425 graph
->edge_list
= edge
;
429 add_classname (graph_t
*g
, int val
, const char *name
)
431 struct classname_s
*classname
;
433 classname
= XMALLOC (struct classname_s
, 1);
435 classname
->name
= name
;
436 classname
->next
= g
->classname
;
437 g
->classname
= classname
;
441 add_infoname (graph_t
*g
, int integer
, const char *string
)
443 struct infoname_s
*infoname
;
445 infoname
= XMALLOC (struct infoname_s
, 1);
446 infoname
->integer
= integer
;
447 infoname
->string
= string
;
448 infoname
->next
= g
->infoname
;
449 g
->infoname
= infoname
;
452 /* Build a colorentry struct and add it to the list. */
454 add_colorentry (graph_t
*g
, int color_idx
, int red_cp
,
455 int green_cp
, int blue_cp
)
457 struct colorentry_s
*ce
;
459 ce
= XMALLOC (struct colorentry_s
, 1);
460 ce
->color_index
= color_idx
;
462 ce
->green_cp
= green_cp
;
463 ce
->blue_cp
= blue_cp
;
464 ce
->next
= g
->colorentry
;
468 /*-------------------------------------.
469 | Open and close functions (formatted) |
470 `-------------------------------------*/
473 open_edge(edge_t
*edge
, FILE *fout
)
478 fputs ("\tedge: {\n", fout
);
481 fputs ("\tbackedge: {\n", fout
);
484 fputs ("\tnearedge: {\n", fout
);
487 fputs ("\tbentnearedge: {\n", fout
);
490 fputs ("\tedge: {\n", fout
);
495 close_edge(FILE *fout
)
497 fputs ("\t}\n", fout
);
501 open_node(FILE *fout
)
503 fputs ("\tnode: {\n", fout
);
507 close_node(FILE *fout
)
509 fputs ("\t}\n", fout
);
513 open_graph(FILE *fout
)
515 fputs ("graph: {\n", fout
);
519 close_graph(graph_t
*graph
, FILE *fout
)
523 /* FIXME: Unallocate nodes and edges if required. */
527 for (node
= graph
->node_list
; node
; node
= node
->next
)
530 output_node (node
, fout
);
540 for (edge
= graph
->edge_list
; edge
; edge
= edge
->next
)
542 open_edge (edge
, fout
);
543 output_edge (edge
, fout
);
551 /*-------------------------------------------.
552 | Output functions (formatted) in file FOUT |
553 `-------------------------------------------*/
556 output_node (node_t
*node
, FILE *fout
)
558 if (node
->title
!= N_TITLE
)
559 fprintf (fout
, "\t\ttitle:\t\"%s\"\n", node
->title
);
560 if (node
->label
!= N_LABEL
)
561 fprintf (fout
, "\t\tlabel:\t\"%s\"\n", node
->label
);
563 if ((node
->locx
!= N_LOCX
) && (node
->locy
!= N_LOCY
))
564 fprintf (fout
, "\t\tloc { x: %d y: %d }\t\n", node
->locx
, node
->locy
);
566 if (node
->vertical_order
!= N_VERTICAL_ORDER
)
567 fprintf (fout
, "\t\tvertical_order:\t%d\n", node
->vertical_order
);
568 if (node
->horizontal_order
!= N_HORIZONTAL_ORDER
)
569 fprintf (fout
, "\t\thorizontal_order:\t%d\n", node
->horizontal_order
);
571 if (node
->width
!= N_WIDTH
)
572 fprintf (fout
, "\t\twidth:\t%d\n", node
->width
);
573 if (node
->height
!= N_HEIGHT
)
574 fprintf (fout
, "\t\theight:\t%d\n", node
->height
);
576 if (node
->shrink
!= N_SHRINK
)
577 fprintf (fout
, "\t\tshrink:\t%d\n", node
->shrink
);
578 if (node
->stretch
!= N_STRETCH
)
579 fprintf (fout
, "\t\tstretch:\t%d\n", node
->stretch
);
581 if (node
->folding
!= N_FOLDING
)
582 fprintf (fout
, "\t\tfolding:\t%d\n", node
->folding
);
584 if (node
->textmode
!= N_TEXTMODE
)
585 fprintf (fout
, "\t\ttextmode:\t%s\n",
586 get_textmode_str (node
->textmode
));
588 if (node
->shape
!= N_SHAPE
)
589 fprintf (fout
, "\t\tshape:\t%s\n", get_shape_str (node
->shape
));
591 if (node
->borderwidth
!= N_BORDERWIDTH
)
592 fprintf (fout
, "\t\tborderwidth:\t%d\n", node
->borderwidth
);
594 if (node
->color
!= N_COLOR
)
595 fprintf (fout
, "\t\tcolor:\t%s\n", get_color_str (node
->color
));
596 if (node
->textcolor
!= N_TEXTCOLOR
)
597 fprintf (fout
, "\t\ttextcolor:\t%s\n",
598 get_color_str (node
->textcolor
));
599 if (node
->bordercolor
!= N_BORDERCOLOR
)
600 fprintf (fout
, "\t\tbordercolor:\t%s\n",
601 get_color_str (node
->bordercolor
));
604 fprintf (fout
, "\t\tinfo1:\t\"%s\"\n", node
->infos
[0]);
606 fprintf (fout
, "\t\tinfo2:\t\"%s\"\n", node
->infos
[1]);
608 fprintf (fout
, "\t\tinfo3:\t\"%s\"\n", node
->infos
[2]);
612 output_edge (edge_t
*edge
, FILE *fout
)
614 /* FIXME: SOURCENAME and TARGETNAME are mandatory
615 so it has to be fatal not to give these informations. */
616 if (edge
->sourcename
!= E_SOURCENAME
)
617 fprintf (fout
, "\t\tsourcename:\t\"%s\"\n", edge
->sourcename
);
618 if (edge
->targetname
!= E_TARGETNAME
)
619 fprintf (fout
, "\t\ttargetname:\t\"%s\"\n", edge
->targetname
);
621 if (edge
->label
!= E_LABEL
)
622 fprintf (fout
, "\t\tlabel:\t\"%s\"\n", edge
->label
);
624 if (edge
->linestyle
!= E_LINESTYLE
)
625 fprintf (fout
, "\t\tlinestyle:\t\"%s\"\n",
626 get_linestyle_str(edge
->linestyle
));
628 if (edge
->thickness
!= E_THICKNESS
)
629 fprintf (fout
, "\t\tthickness:\t%d\n", edge
->thickness
);
630 if (edge
->class != E_CLASS
)
631 fprintf (fout
, "\t\tclass:\t%d\n", edge
->class);
633 if (edge
->color
!= E_COLOR
)
634 fprintf (fout
, "\t\tcolor:\t%s\n", get_color_str (edge
->color
));
635 if (edge
->color
!= E_TEXTCOLOR
)
636 fprintf (fout
, "\t\ttextcolor:\t%s\n",
637 get_color_str (edge
->textcolor
));
638 if (edge
->arrowcolor
!= E_ARROWCOLOR
)
639 fprintf (fout
, "\t\tarrowcolor:\t%s\n",
640 get_color_str (edge
->arrowcolor
));
641 if (edge
->backarrowcolor
!= E_BACKARROWCOLOR
)
642 fprintf (fout
, "\t\tbackarrowcolor:\t%s\n",
643 get_color_str (edge
->backarrowcolor
));
645 if (edge
->arrowsize
!= E_ARROWSIZE
)
646 fprintf (fout
, "\t\tarrowsize:\t%d\n", edge
->arrowsize
);
647 if (edge
->backarrowsize
!= E_BACKARROWSIZE
)
648 fprintf (fout
, "\t\tbackarrowsize:\t%d\n", edge
->backarrowsize
);
650 if (edge
->arrowstyle
!= E_ARROWSTYLE
)
651 fprintf (fout
, "\t\tarrowstyle:\t%s\n",
652 get_arrowstyle_str(edge
->arrowstyle
));
653 if (edge
->backarrowstyle
!= E_BACKARROWSTYLE
)
654 fprintf (fout
, "\t\tbackarrowstyle:\t%s\n",
655 get_arrowstyle_str(edge
->backarrowstyle
));
657 if (edge
->priority
!= E_PRIORITY
)
658 fprintf (fout
, "\t\tpriority:\t%d\n", edge
->priority
);
659 if (edge
->anchor
!= E_ANCHOR
)
660 fprintf (fout
, "\t\tanchor:\t%d\n", edge
->anchor
);
661 if (edge
->horizontal_order
!= E_HORIZONTAL_ORDER
)
662 fprintf (fout
, "\t\thorizontal_order:\t%d\n", edge
->horizontal_order
);
666 output_graph (graph_t
*graph
, FILE *fout
)
669 fprintf (fout
, "\ttitle:\t\"%s\"\n", graph
->title
);
671 fprintf (fout
, "\tlabel:\t\"%s\"\n", graph
->label
);
674 fprintf (fout
, "\tinfo1:\t\"%s\"\n", graph
->infos
[0]);
676 fprintf (fout
, "\tinfo2:\t\"%s\"\n", graph
->infos
[1]);
678 fprintf (fout
, "\tinfo3:\t\"%s\"\n", graph
->infos
[2]);
680 if (graph
->color
!= G_COLOR
)
681 fprintf (fout
, "\tcolor:\t%s\n", get_color_str (graph
->color
));
682 if (graph
->textcolor
!= G_TEXTCOLOR
)
683 fprintf (fout
, "\ttextcolor:\t%s\n", get_color_str (graph
->textcolor
));
684 if (graph
->bordercolor
!= G_BORDERCOLOR
)
685 fprintf (fout
, "\tbordercolor:\t%s\n",
686 get_color_str (graph
->bordercolor
));
688 if (graph
->width
!= G_WIDTH
)
689 fprintf (fout
, "\twidth:\t%d\n", graph
->width
);
690 if (graph
->height
!= G_HEIGHT
)
691 fprintf (fout
, "\theight:\t%d\n", graph
->height
);
692 if (graph
->borderwidth
!= G_BORDERWIDTH
)
693 fprintf (fout
, "\tborderwidth:\t%d\n", graph
->borderwidth
);
696 fprintf (fout
, "\tx:\t%d\n", graph
->x
);
698 fprintf (fout
, "\ty:\t%d\n", graph
->y
);
700 if (graph
->folding
!= G_FOLDING
)
701 fprintf (fout
, "\tfolding:\t%d\n", graph
->folding
);
703 if (graph
->shrink
!= G_SHRINK
)
704 fprintf (fout
, "\tshrink:\t%d\n", graph
->shrink
);
705 if (graph
->stretch
!= G_STRETCH
)
706 fprintf (fout
, "\tstretch:\t%d\n", graph
->stretch
);
708 if (graph
->textmode
!= G_TEXTMODE
)
709 fprintf (fout
, "\ttextmode:\t%s\n",
710 get_textmode_str (graph
->textmode
));
712 if (graph
->shape
!= G_SHAPE
)
713 fprintf (fout
, "\tshape:\t%s\n", get_shape_str (graph
->shape
));
715 if (graph
->vertical_order
!= G_VERTICAL_ORDER
)
716 fprintf (fout
, "\tvertical_order:\t%d\n", graph
->vertical_order
);
717 if (graph
->horizontal_order
!= G_HORIZONTAL_ORDER
)
718 fprintf (fout
, "\thorizontal_order:\t%d\n", graph
->horizontal_order
);
720 if (graph
->xmax
!= G_XMAX
)
721 fprintf (fout
, "\txmax:\t%d\n", graph
->xmax
);
722 if (graph
->ymax
!= G_YMAX
)
723 fprintf (fout
, "\tymax:\t%d\n", graph
->ymax
);
725 if (graph
->xbase
!= G_XBASE
)
726 fprintf (fout
, "\txbase:\t%d\n", graph
->xbase
);
727 if (graph
->ybase
!= G_YBASE
)
728 fprintf (fout
, "\tybase:\t%d\n", graph
->ybase
);
730 if (graph
->xspace
!= G_XSPACE
)
731 fprintf (fout
, "\txspace:\t%d\n", graph
->xspace
);
732 if (graph
->yspace
!= G_YSPACE
)
733 fprintf (fout
, "\tyspace:\t%d\n", graph
->yspace
);
734 if (graph
->xlspace
!= G_XLSPACE
)
735 fprintf (fout
, "\txlspace:\t%d\n", graph
->xlspace
);
737 if (graph
->xraster
!= G_XRASTER
)
738 fprintf (fout
, "\txraster:\t%d\n", graph
->xraster
);
739 if (graph
->yraster
!= G_YRASTER
)
740 fprintf (fout
, "\tyraster:\t%d\n", graph
->yraster
);
741 if (graph
->xlraster
!= G_XLRASTER
)
742 fprintf (fout
, "\txlraster:\t%d\n", graph
->xlraster
);
744 if (graph
->hidden
!= G_HIDDEN
)
745 fprintf (fout
, "\thidden:\t%d\n", graph
->hidden
);
747 /* FIXME: Unallocate struct list if required.
748 Maybe with a little function. */
749 if (graph
->classname
!= G_CLASSNAME
)
751 struct classname_s
*ite
;
753 for (ite
= graph
->classname
; ite
; ite
= ite
->next
)
754 fprintf (fout
, "\tclassname %d :\t%s\n", ite
->no
, ite
->name
);
757 if (graph
->infoname
!= G_INFONAME
)
759 struct infoname_s
*ite
;
761 for (ite
= graph
->infoname
; ite
; ite
= ite
->next
)
762 fprintf (fout
, "\tinfoname %d :\t%s\n", ite
->integer
, ite
->string
);
765 if (graph
->colorentry
!= G_COLORENTRY
)
767 struct colorentry_s
*ite
;
769 for (ite
= graph
->colorentry
; ite
; ite
= ite
->next
)
771 fprintf (fout
, "\tcolorentry %d :\t%d %d %d\n",
779 if (graph
->layoutalgorithm
!= G_LAYOUTALGORITHM
)
780 fprintf (fout
, "\tlayoutalgorithm:\t%s\n",
781 get_layoutalgorithm_str(graph
->layoutalgorithm
));
783 if (graph
->layout_downfactor
!= G_LAYOUT_DOWNFACTOR
)
784 fprintf (fout
, "\tlayout_downfactor:\t%d\n", graph
->layout_downfactor
);
785 if (graph
->layout_upfactor
!= G_LAYOUT_UPFACTOR
)
786 fprintf (fout
, "\tlayout_upfactor:\t%d\n", graph
->layout_upfactor
);
787 if (graph
->layout_nearfactor
!= G_LAYOUT_NEARFACTOR
)
788 fprintf (fout
, "\tlayout_nearfactor:\t%d\n", graph
->layout_nearfactor
);
789 if (graph
->layout_splinefactor
!= G_LAYOUT_SPLINEFACTOR
)
790 fprintf (fout
, "\tlayout_splinefactor:\t%d\n",
791 graph
->layout_splinefactor
);
793 if (graph
->late_edge_labels
!= G_LATE_EDGE_LABELS
)
794 fprintf (fout
, "\tlate_edge_labels:\t%s\n",
795 get_decision_str(graph
->late_edge_labels
));
796 if (graph
->display_edge_labels
!= G_DISPLAY_EDGE_LABELS
)
797 fprintf (fout
, "\tdisplay_edge_labels:\t%s\n",
798 get_decision_str(graph
->display_edge_labels
));
799 if (graph
->dirty_edge_labels
!= G_DIRTY_EDGE_LABELS
)
800 fprintf (fout
, "\tdirty_edge_labels:\t%s\n",
801 get_decision_str(graph
->dirty_edge_labels
));
802 if (graph
->finetuning
!= G_FINETUNING
)
803 fprintf (fout
, "\tfinetuning:\t%s\n",
804 get_decision_str(graph
->finetuning
));
805 if (graph
->ignore_singles
!= G_IGNORE_SINGLES
)
806 fprintf (fout
, "\tignore_singles:\t%s\n",
807 get_decision_str(graph
->ignore_singles
));
808 if (graph
->straight_phase
!= G_STRAIGHT_PHASE
)
809 fprintf (fout
, "\tstraight_phase:\t%s\n",
810 get_decision_str(graph
->straight_phase
));
811 if (graph
->priority_phase
!= G_PRIORITY_PHASE
)
812 fprintf (fout
, "\tpriority_phase:\t%s\n",
813 get_decision_str(graph
->priority_phase
));
814 if (graph
->manhattan_edges
!= G_MANHATTAN_EDGES
)
816 "\tmanhattan_edges:\t%s\n",
817 get_decision_str(graph
->manhattan_edges
));
818 if (graph
->smanhattan_edges
!= G_SMANHATTAN_EDGES
)
820 "\tsmanhattan_edges:\t%s\n",
821 get_decision_str(graph
->smanhattan_edges
));
822 if (graph
->near_edges
!= G_NEAR_EDGES
)
823 fprintf (fout
, "\tnear_edges:\t%s\n",
824 get_decision_str(graph
->near_edges
));
826 if (graph
->orientation
!= G_ORIENTATION
)
827 fprintf (fout
, "\torientation:\t%s\n",
828 get_orientation_str(graph
->orientation
));
830 if (graph
->node_alignement
!= G_NODE_ALIGNEMENT
)
831 fprintf (fout
, "\tnode_alignement:\t%s\n",
832 get_node_alignement_str(graph
->node_alignement
));
834 if (graph
->port_sharing
!= G_PORT_SHARING
)
835 fprintf (fout
, "\tport_sharing:\t%s\n",
836 get_decision_str(graph
->port_sharing
));
838 if (graph
->arrow_mode
!= G_ARROW_MODE
)
839 fprintf (fout
, "\tarrow_mode:\t%s\n",
840 get_arrow_mode_str(graph
->arrow_mode
));
842 if (graph
->treefactor
!= G_TREEFACTOR
)
843 fprintf (fout
, "\ttreefactor:\t%f\n", graph
->treefactor
);
844 if (graph
->spreadlevel
!= G_SPREADLEVEL
)
845 fprintf (fout
, "\tspreadlevel:\t%d\n", graph
->spreadlevel
);
847 if (graph
->crossing_weight
!= G_CROSSING_WEIGHT
)
848 fprintf (fout
, "\tcrossing_weight:\t%s\n",
849 get_crossing_type_str(graph
->crossing_weight
));
850 if (graph
->crossing_phase2
!= G_CROSSING_PHASE2
)
851 fprintf (fout
, "\tcrossing_phase2:\t%s\n",
852 get_decision_str(graph
->crossing_phase2
));
853 if (graph
->crossing_optimization
!= G_CROSSING_OPTIMIZATION
)
854 fprintf (fout
, "\tcrossing_optimization:\t%s\n",
855 get_decision_str(graph
->crossing_optimization
));
857 if (graph
->view
!= G_VIEW
)
858 fprintf (fout
, "\tview:\t%s\n", get_view_str(graph
->view
));
860 if (graph
->edges
!= G_EDGES
)
861 fprintf (fout
, "\tedges:\t%s\n", get_decision_str(graph
->edges
));
863 if (graph
->nodes
!= G_NODES
)
864 fprintf (fout
,"\tnodes:\t%s\n", get_decision_str(graph
->nodes
));
866 if (graph
->splines
!= G_SPLINES
)
867 fprintf (fout
, "\tsplines:\t%s\n", get_decision_str(graph
->splines
));
869 if (graph
->bmax
!= G_BMAX
)
870 fprintf (fout
, "\tbmax:\t%d\n", graph
->bmax
);
871 if (graph
->cmin
!= G_CMIN
)
872 fprintf (fout
, "\tcmin:\t%d\n", graph
->cmin
);
873 if (graph
->cmax
!= G_CMAX
)
874 fprintf (fout
, "\tcmax:\t%d\n", graph
->cmax
);
875 if (graph
->pmin
!= G_PMIN
)
876 fprintf (fout
, "\tpmin:\t%d\n", graph
->pmin
);
877 if (graph
->pmax
!= G_PMAX
)
878 fprintf (fout
, "\tpmax:\t%d\n", graph
->pmax
);
879 if (graph
->rmin
!= G_RMIN
)
880 fprintf (fout
, "\trmin:\t%d\n", graph
->rmin
);
881 if (graph
->rmax
!= G_RMAX
)
882 fprintf (fout
, "\trmax:\t%d\n", graph
->rmax
);
883 if (graph
->smax
!= G_SMAX
)
884 fprintf (fout
, "\tsmax:\t%d\n", graph
->smax
);