1 /* VCG description handler for Bison.
3 Copyright (C) 2001, 2002 Free Software Foundation, Inc.
5 This file is part of Bison, the GNU Compiler Compiler.
7 Bison is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2, or (at your option)
12 Bison is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with Bison; see the file COPYING. If not, write to
19 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20 Boston, MA 02111-1307, USA. */
25 /* VCG color map. The 32 prime predefined colors. */
62 /* VCG textmode. Specify the adjustement of the text within the border of a summary node. */
70 /* VCG shapes. Used for nodes shapes. */
79 /* Structure for colorentries. */
86 struct colorentry
*next
;
89 /* Structure to construct lists of classnames. */
92 int no
; /* Class number */
93 const char *name
; /* Name associated to the class no. */
94 struct classname
*next
; /* next name class association. */
97 /* Structure is in infoname. */
102 struct infoname
*next
;
105 /* Layout Algorithms which can be found in VCG.
106 Details about each algoithm can be found below. */
125 /* VCG decision yes/no. */
132 /* VCG graph orientation. */
141 /* VCG alignment for node alignement. */
149 /* VCG arrow mode. */
156 /* VCG crossing weight type. */
175 /*------------------------------------------------------.
176 | Node attributs list. structure that describes a node. |
177 `------------------------------------------------------*/
181 /* Title the unique string identifying the node. This attribute is
185 /* Label the text displayed inside the node. If no label is specified
186 then the title of the node will be used. Note that this text may
187 contain control characters like NEWLINE that influences the size of
191 /* loc is the location as x, y position relatively to the system of
192 coordinates of the graph. Locations are specified in the form
193 loc: - x: xpos y: ypos "". The locations of nodes are only valid,
194 if the whole graph is fully specified with locations and no part is
195 folded. The layout algorithm of the tool calculates appropriate x, y
196 positions, if at least one node that must be drawn (i.e., is not
197 hidden by folding or edge classes) does not have fixed specified
203 /* vertical order is the level position (rank) of the node. We can also
204 specify level: int. Level specifications are only valid, if the
205 layout is calculated, i.e. if at least one node does not have a
206 fixed location specification. The layout algorithm partitioned all
207 nodes into levels 0...maxlevel. Nodes at the level 0 are on the
208 upper corner. The algorithm is able to calculate appropriate levels
209 for the nodes automatically, if no fixed levels are given.
210 Specifications of levels are additional constraints, that may be
211 ignored, if they are in conflict with near edge specifications.
212 Default values are unspecified. */
215 /* horizontal order is the horizontal position of the node within a
216 level. The nodes which are specified with horizontal positions are
217 ordered according to these positions within the levels. The nodes
218 which do not have this attribute are inserted into this ordering by
219 the crossing reduction mechanism. Note that connected components are
220 handled separately, thus it is not possible to intermix such
221 components by specifying a horizontal order. If the algorithm for
222 downward laid out trees is used, the horizontal order influences
223 only the order of the child nodes at a node, but not the order of
225 Default is unspecified. */
226 int horizontal_order
;
228 /* width, height is the width and height of a node including the border.
229 If no value (in pixels) is given then width and height are
230 calculated from the size of the label.
231 Default are width and height of the label. */
235 /* shrink, expand gives the shrinking and expanding factor of the
236 node. The values of the attributes width, height, borderwidth and
237 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
239 scale value of a node relatively to a scale value of the graph,
240 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
242 factor 4 compared to the normal size. The scale value can also be
243 specified by scaling: float.
248 /* 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
250 of a class less or equal to k is folded and displayed as one node.
251 There are commands to unfold such summary nodes, see section 5. If
252 no folding is specified for a node, then the node may be folded if
253 it is in the region of another node that starts the folding. If
254 folding 0 is specified, then the node is never folded. In this case
255 the folding stops at the predecessors of this node, if it is
256 reachable from another folding node. The summary node inherits some
257 attributes from the original node which starts the folding (all
258 color attributes, textmode and label, but not the location). A
259 folded region may contain folded regions with smaller folding class
260 values (nested foldings). If there is more than one node that start
261 the folding of the same region (this implies that the folding class
262 values are equal) then the attributes are inherited by one of these
263 nodes nondeterministically. If foldnode attributes are specified,
264 then the summary node attributes are inherited from these attributes.
268 /* shape specifies the visual appearance of a node: box, rhomb, ellipse,
269 and triangle. The drawing of ellipses is much slower than the drawing
274 /* textmode specifies the adjustment of the text within the border of a
275 node. The possibilities are center, left.justify and right.justify.
276 Default is center. */
277 enum textmode textmode
;
279 /* 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
281 node is white. For the possibilities, see the attribute color for
287 Default is white or transparent, */
290 /* textcolor is the color for the label text. bordercolor is the color
291 of the border. Default color is the textcolor. info1, info2, info3
292 combines additional text labels with a node or a folded graph. info1,
294 enum color textcolor
;
296 /* info2, info3 can be selected from the menu. The corresponding text
297 labels can be shown by mouse clicks on nodes.\f
298 Default are null strings. */
299 const char *infos
[3];
301 /* Node border color.
302 Default is textcolor. */
303 enum color bordercolor
;
305 /* Next node node... */
310 typedef struct node node
;
312 /*-------------------------------------------------------.
313 | Edge attributs list. Structure that describes an edge. |
314 `-------------------------------------------------------*/
325 /* Structs enum definitions for edges. */
341 /* The struct edge itself. */
346 Default is normal edge. */
349 /* Sourcename is the title of the source node of the edge.
351 const char *sourcename
; /* Mandatory. */
353 /* Targetname is the title of the target node of the edge.
355 const char *targetname
; /* Mandatory. */
357 /* Label specifies the label of the edge. It is drawn if
358 display.edge.labels is set to yes.
359 Default: no label. */
362 /* Linestyle specifies the style the edge is drawn. Possibilities are:
363 ffl continuous a solid line is drawn ( -- ) ffl dashed the edge
364 consists of single dashes ( - - - ) ffl dotted the edge is made of
365 single dots ( \Delta \Delta \Delta ) ffl invisible the edge is not
366 drawn. The attributes of its shape (color, thickness) are ignored.
367 To draw a dashed or dotted line needs more time than solid lines.
368 Default is continuous. */
369 enum linestyle linestyle
;
371 /* Thickness is the thickness of an edge.
375 /* Class specifies the folding class of the edge. Nodes reachable by
376 edges of a class less or equal to a constant k specify folding
377 regions of k. See the node attribute folding and the folding commands.
381 /* color is the color of the edge.
385 /* textcolor is the color of the label of the edge. arrowcolor,
386 backarrowcolor is the color of the arrow head and of the backarrow
387 head. priority The positions of the nodes are mainly determined by
388 the incoming and outgoing edges. One can think of rubberbands instead
389 of edges that pull a node into its position. The priority of an edges
390 corresponds to the strength of the rubberband.
392 enum color textcolor
;
396 enum color arrowcolor
;
400 enum color backarrowcolor
;
402 /* arrowsize, backarrowsize The arrow head is a right-angled, isosceles
403 triangle and the cathetuses have length arrowsize.
411 /* arrowstyle, backarrowstyle Each edge has two arrow heads: the one
412 appears at the target node (the normal arrow head), the other appears
413 at the source node (the backarrow head). Normal edges only have the
414 normal solid arrow head, while the backarrow head is not drawn, i.e.
415 it is none. Arrowstyle is the style of the normal arrow head, and
416 backarrowstyle is the style of the backarrow head. Styles are none,
417 i.e. no arrow head, solid, and line.
419 enum arrowstyle arrowstyle
;
421 /* Default is none. */
422 enum arrowstyle backarrowstyle
;
427 /* Anchor. An anchor point describes the vertical position in a node
428 where an edge goes out. This is useful, if node labels are several
429 lines long, and outgoing edges are related to label lines. (E.g.,
430 this allows a nice visualization of structs containing pointers as
435 /* Horizontal order is the horizontal position the edge. This is of
436 interest only if the edge crosses several levels because it specifies
437 the point where the edge crosses the level. within a level. The nodes
438 which are specified with horizontal positions are ordered according
439 to these positions within a level. The horizontal position of a long
440 edge that crosses the level specifies between which two node of that
441 level the edge has to be drawn. Other edges which do not have this
442 attribute are inserted into this ordering by the crossing reduction
443 mechanism. Note that connected components are handled separately,
444 thus it is not possible to intermix such components by specifying a
446 Default is unspcified. */
447 int horizontal_order
;
459 typedef struct edge edge
;
461 /*--------------------------------------------------------.
462 | Graph attributs list. Structure that describes a graph. |
463 `--------------------------------------------------------*/
467 /* Graph title or name.
468 Title specifies the name (a string) associated with the graph. The
469 default name of a subgraph is the name of the outer graph, and the
470 name of the outmost graph is the name of the specification input
471 file. The name of a graph is used to identify this graph, e.g., if
472 we want to express that an edge points to a subgraph. Such edges
473 point to the root of the graph, i.e. the first node of the graph or
474 the root of the first subgraph in the graph, if the subgraph is
475 visualized explicitly.
476 By default, it's the name of the vcg graph file description. */
480 Label the text displayed inside the node, when the graph is folded
481 to a node. If no label is specified then the title of the graph will
482 be used. Note that this text may contain control characters like
483 NEWLINE that influences the size of the node.
484 By default, it takes the title value */
488 Info1, info2, info3 combines additional text labels with a node or a
489 folded graph. info1, info2, info3 can be selected from the menu
490 interactively. The corresponding text labels can be shown by mouse
492 Default values are empty strings (here NULL pointers) */
493 const char *infos
[3];
495 /* Background color and summary node colors
496 Color specifies the background color for the outermost graph, or the
497 color of the summary node for subgraphs. Colors are given in the enum
498 declared above. If more than these default colors are needed, a
499 color map with maximal 256 entries can be used. The first 32 entries
500 correspond to the colors just listed. A color of the color map can
501 selected by the color map index, an integer, for instance red has
502 index 2, green has index 3, etc.
503 Default is white for background and white or transparent for summary
508 need explanations ???
509 default is black for summary nodes. */
510 enum color textcolor
;
512 /* Bordercolor is the color of the summary node's border. Default color
513 is the textcolor. width, height are width and height of the
514 displayed part of the window of the outermost graph in pixels, or
515 width and height of the summary node of inner subgraphs.
516 Default is the default of the textcolor. */
517 enum color bordercolor
;
519 /* 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
521 summary node of inner subgraphs.
522 Default value is 100. */
526 /* Specify the thickness if summary node's border in pixels.
527 default value is 2. */
530 /* x, y are the x-position and y-position of the graph's window in
531 pixels, relatively to the root screen, if it is the outermost graph.
532 The origin of the window is upper, left hand. For inner subgraphs,
533 it is the position of the folded summary node. The position can also
534 be specified in the form loc: fx:int y:intg.
535 The default value is 0. */
539 /* folding of a subgraph is 1, if the subgraph is fused, and 0, if the
540 subgraph is visualized explicitly. There are commands to unfold such
542 Default value is 0 */
545 /* Shrink, expand gives the shrinking and expanding factor for the
546 graph's representation (default is 1, 1). ((expand=shrink) \Lambda
547 100) is the scaling of the graph in percentage, e.g.,
548 (expand,shrink) = (1,1) or (2,2) or (3,3) : : : is normal size,
549 (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
551 summary node. The scaling factor can also be specified by scaling:
552 float (here, scaling 1.0 means normal size). */
556 /* textmode specifies the adjustment of the text within the border of a
557 summary node. The possibilities are center, left.justify and
559 Default value is center.*/
560 enum textmode textmode
;
562 /* 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,
564 rhomb, ellipse, and triangle. vertical order is the level position
565 (rank) of the summary node of an inner subgraph, if this subgraph is
566 folded. We can also specify level: int. The level is only
567 recognized, if an automatical layout is calculated. horizontal order
568 is the horizontal position of the summary node within a level. The
569 nodes which are specified with horizontal positions are ordered
570 according to these positions within the levels. The nodes which do
571 not have this attribute are inserted into this ordering by the
572 crossing reduction mechanism. Note that connected
573 components are handled separately, thus it is not possible to
574 intermix such components by specifying a horizontal order. If the
575 algorithm for downward laid out trees is used, the horizontal order
576 influences only the order of the child nodes at a node, but not the
577 order of the whole level.
578 Default is box, other: rhomb, ellipse, triangle. */
581 /* 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
583 level: int. The level is only recognized, if an automatical layout is
587 /* Horizontal order is the horizontal position of the summary node within
588 a level. The nodes which are specified with horizontal positions are
589 ordered according to these positions within the levels. The nodes which
590 do not have this attribute are inserted into this ordering by the
591 crossing reduction mechanism. Note that connected components are
592 handled separately, thus it is not possible to intermix such components
593 by specifying a horizontal order. If the algorithm for downward laid
594 out trees is used, the horizontal order influences only the order of
595 the child nodes at a node, but not the order of the whole level. */
596 int horizontal_order
;
598 /* xmax, ymax specify the maximal size of the virtual window that is
599 used to display the graph. This is usually larger than the displayed
600 part, thus the width and height of the displayed part cannot be
601 greater than xmax and ymax. Only those parts of the graph are drawn
602 that are inside the virtual window. The virtual window can be moved
603 over the potential infinite system of coordinates by special
604 positioning commands.
605 Defaults are 90 and 90. */
609 /* xy-base: specify the upper left corner coordinates of the graph
610 relatively to the root window.
611 Defaults are 5, 5. */
615 /* xspace, yspace the minimum horizontal and vertical distance between
616 nodes. xlspace is the horizontal distance between lines at the
617 points where they cross the levels. (At these points, dummy nodes
618 are used. In fact, this is the horizontal distance between dummy
619 nodes.) It is recommended to set xlspace to a larger value, if
620 splines are used to draw edges, to prevent sharp bendings.
621 Default are 20 and 70. */
625 /* The horizontal space between lines at the point where they cross
627 defaults value is 1/2 xspace (polygone) and 4/5 xspace (splines)*/
630 /* xraster, yraster specifies the raster distance for the position of
631 the nodes. The center of a node is aligned to this raster. xlraster
632 is the horizontal raster for the positions of the line control
633 points (the dummy nodes). It should be a divisor of xraster.
638 /* xlraster is the horizontal raster for the positions of the line
639 control points (the dummy nodes). It should be a divisor of xraster.
643 /* hidden specifies the classes of edges that are hidden.
644 Edges that are within such a class are not laid out nor drawn.
645 Nodes that are only reachable (forward or backward) by edges of an
646 hidden class are not drawn. However, nodes that are not reachable
647 at all are drawn. (But see attribute ignore.singles.) Specification
648 of classes of hidden edges allows to hide parts of a graph, e.g.,
649 annotations of a syntax tree. This attribute is only allowed at the
650 outermost level. More than one settings are possible to specify
651 exactly the set of classes that are hidden. Note the important
652 difference between hiding of edges and the edge line style invisible.
653 Hidden edges are not existent in the layout. Edges with line style
654 invisible are existent in the layout; they need space and may
655 produce crossings and influence the layout, but you cannot see
660 /* Classname allows to introduce names for the edge classes. The names
661 are used in the menus. infoname allows to introduce names for the
662 additional text labels. The names are used in the menus.
663 defaults are 1,2,3...
664 By default, no class names. */
665 struct classname
*classname
;
667 /* Infoname allows to introduce names for the additional text labels.
668 The names are used in the menus.
669 Infoname is given by an integer and a string.
670 The default value is NULL. */
671 struct infoname
*infoname
;
673 /* 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
675 255 (on), e.g., 0 0 0 is black and 255 255 255 is white. For instance
676 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.
679 struct colorentry
*colorentry
;
681 /* layoutalgorithm chooses different graph layout algorithms
682 Possibilities are maxdepth, mindepth, maxdepthslow, mindepthslow,
683 maxdegree, mindegree, maxindegree, minindegree, maxoutdegree,
684 minoutdegree, minbackward, dfs and tree. The default algorithm tries
685 to give all edges the same orientation and is based on the
686 calculation of strongly connected components. The algorithms that
687 are based on depth first search are faster. While the simple dfs
688 does not enforce additionally constraints, the algorithm maxdepth
689 tries to increase the depth of the layout and the algorithm mindepth
690 tries to increase the wide of the layout. These algorithms are fast
691 heuristics. If they are not appropriate, the algorithms maxdepthslow
692 or mindepthslow also increase the depth or wide, but they are very
693 slow. The algorithm maxindegree lays out the nodes by scheduling the
694 nodes with the maximum of incoming edges first, and minindegree lays
695 out the nodes by scheduling the nodes with the minimum of incoming
696 edges first. In the same manner work the algorithms maxoutdegree and
697 minoutdegree for outgoing edges, and maxdegree and mindegree for the
698 sum of incoming and outgoing edges. These algorithms may have various
699 effects, and can sometimes be used as replacements of maxdepthslow
702 The algorithm minbackward can be used if the graph is acyclic.
703 The algorithm tree is a specialized method for downward laid out
704 trees. It is much faster on such tree-like graphs and results in a
706 Default is normal. */
707 enum layoutalgorithm layoutalgorithm
;
709 /* Layout downfactor, layout upfactor, layout nearfactor The layout
710 algorithm partitions the set of edges into edges pointing upward,
711 edges pointing downward, and edges pointing sidewards. The last type
712 of edges is also called near edges. If the layout.downfactor is
713 large compared to the layout.upfactor and the layout.nearfactor,
714 then the positions of the nodes is mainly determined by the edges
715 pointing downwards. If the layout.upfactor is large compared to the
716 layout.downfactor and the layout.nearfactor, then the positions of
717 the nodes is mainly determined by the edges pointing upwards. If the
718 layout.nearfactor is large, then the positions of the nodes is
719 mainly determined by the edges pointing sidewards. These attributes
720 have no effect, if the method for downward laid out trees is used.
721 Default is normal. */
722 int layout_downfactor
;
724 int layout_nearfactor
;
725 /* Layout splinefactor determines the bending at splines. The factor
726 100 indicates a very sharp bending, a factor 1 indicates a very flat
727 bending. Useful values are 30 : : : 80. */
728 int layout_splinefactor
;
730 /* Late edge labels yes means that the graph is first partitioned and
731 then, labels are introduced. The default algorithm first creates
732 labels and then partitions the graph, which yield a more compact
733 layout, but may have more crossings.
735 enum decision late_edge_labels
;
737 /* Display edge labels yes means display labels and no means don't
739 Default vaule is no. */
740 enum decision display_edge_labels
;
742 /* 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.
744 Dirty edge labels cannot be used if splines are used.
747 enum decision dirty_edge_labels
;
749 /* Finetuning no switches the fine tuning phase of the graph layout
750 algorithm off, while it is on as default. The fine tuning phase
751 tries to give all edges the same length.
753 enum decision finetuning
;
755 /* Ignore singles yes hides all nodes which would appear single and
756 unconnected from the remaining graph. Such nodes have no edge at all
757 and are sometimes very ugly. Default is to show all nodes.
759 enum decision ignore_singles
;
761 /* priority phase yes replaces the normal pendulum method by a
762 specialized method: It forces straight long edges with 90 degree,
763 just as the straight phase. In fact, the straight phase is a fine
764 tune phase of the priority method. This phase is also recommended,
765 if an orthogonal layout is selected (see manhattan.edges).
767 enum decision priority_phase
;
769 /* manhattan edges yes switches the orthogonal layout on. Orthogonal
770 layout (or manhattan layout) means that all edges consist of line
771 segments with gradient 0 or 90 degree. Vertical edge segments might
772 by shared by several edges, while horizontal edge segments are never
773 shared. This results in very aesthetical layouts just for flowcharts.
774 If the orthogonal layout is used, then the priority phase and
775 straight phase should be used. Thus, these both phases are switched
776 on, too, unless priority layout and straight line tuning are
777 switched off explicitly.
779 enum decision manhattan_edges
;
781 /* Smanhattan edges yes switches a specialized orthogonal layout on:
782 Here, all horizontal edge segments between two levels share the same
783 horizontal line, i.e. not only vertical edge segments are shared,
784 but horizontal edge segments are shared by several edges, too. This
785 looks nice for trees but might be too confusing in general, because
786 the location of an edge might be ambiguously.
788 enum decision smanhattan_edges
;
790 /* Near edges no suppresses near edges and bent near edges in the
793 enum decision near_edges
;
795 /* Orientation specifies the orientation of the graph: top.to.bottom,
796 bottom.to.top, left.to.right or right.to.left. Note: the normal
797 orientation is top.to.bottom. All explanations here are given
798 relatively to the normal orientation, i.e., e.g., if the orientation
799 is left to right, the attribute xlspace is not the horizontal but
800 the vertical distance between lines, etc.
801 Default is to_to_bottom. */
802 enum orientation orientation
;
804 /* Node alignment specified the vertical alignment of nodes at the
805 horizontal reference line of the levels. If top is specified, the
806 tops of all nodes of a level have the same y-coordinate; on bottom,
807 the bottoms have the same y-coordinate, on center the nodes are
808 centered at the levels.
809 Default is center. */
810 enum alignment node_alignment
;
812 /* Port sharing no suppresses the sharing of ports of edges at the
813 nodes. Normally, if multiple edges are adjacent to the same node,
814 and the arrow head of all these edges has the same visual appearance
815 (color, size, etc.), then these edges may share a port at a node,
816 i.e. only one arrow head is draw, and all edges are incoming into
817 this arrow head. This allows to have many edges adjacent to one node
818 without getting confused by too many arrow heads. If no port sharing
819 is used, each edge has its own port, i.e. its own place where it is
820 adjacent to the node.
822 enum decision port_sharing
;
824 /* Arrow mode fixed (default) should be used, if port sharing is used,
825 because then, only a fixed set of rotations for the arrow heads are
826 used. If the arrow mode is free, then each arrow head is rotated
827 individually to each edge. But this can yield to a black spot, where
828 nothing is recognizable, if port sharing is used, since all these
829 qdifferently rotated arrow heads are drawn at the same place. If the
830 arrow mode is fixed, then the arrow head is rotated only in steps of
831 45 degree, and only one arrow head occurs at each port.
833 enum arrow_mode arrow_mode
;
835 /* Treefactor The algorithm tree for downward laid out trees tries to
836 produce a medium dense, balanced tree-like layout. If the tree
837 factor is greater than 0.5, the tree edges are spread, i.e. they
838 get a larger gradient. This may improve the readability of the tree.
839 Note: it is not obvious whether spreading results in a more dense or
840 wide layout. For a tree, there is a tree factor such that the whole
841 tree is minimal wide.
845 /* Spreadlevel This parameter only influences the algorithm tree, too.
846 For large, balanced trees, spreading of the uppermost nodes would
847 enlarge the width of the tree too much, such that the tree does not
848 fit anymore in a window. Thus, the spreadlevel specifies the minimal
849 level (rank) where nodes are spread. Nodes of levels upper than
850 spreadlevel are not spread.
854 /* Crossing weight specifies the weight that is used for the crossing
855 reduction: bary (default), median, barymedian or medianbary. We
856 cannot give a general recommendation, which is the best method. For
857 graphs with very large average degree of edges (number of incoming
858 and outgoing edges at a node), the weight bary is the fastest
859 method. With the weights barymedian and medianbary, equal weights of
860 different nodes are not very probable, thus the crossing reduction
861 phase 2 might be very fast.
863 enum crossing_type crossing_weight
;
865 /* Crossing phase2 is the most time consuming phase of the crossing
866 reduction. In this phase, the nodes that happen to have equal
867 crossing weights are permuted. By specifying no, this phase is
870 enum decision crossing_phase2
;
872 /* Crossing optimization is a postprocessing phase after the normal
873 crossing reduction: we try to optimize locally, by exchanging pairs
874 of nodes to reduce the crossings. Although this phase is not very
875 time consuming, it can be suppressed by specifying no.
877 enum decision crossing_optimization
;
879 /* View allows to select the fisheye views. Because
880 of the fixed size of the window that shows the graph, we normally
881 can only see a small amount of a large graph. If we shrink the graph
882 such that it fits into the window, we cannot recognize any detail
883 anymore. Fisheye views are coordinate transformations: the view onto
884 the graph is distort, to overcome this usage deficiency. The polar
885 fisheye is easy to explain: assume a projection of the plane that
886 contains the graph picture onto a spheric ball. If we now look onto
887 this ball in 3 D, we have a polar fisheye view. There is a focus
888 point which is magnified such that we see all details. Parts of the
889 plane that are far away from the focus point are demagnified very
890 much. Cartesian fisheye have a similar effect; only the formula for
891 the coordinate transformation is different. Selecting cfish means
892 the cartesian fisheye is used which demagnifies such that the whole
893 graph is visible (self adaptable cartesian fisheye). With fcfish,
894 the cartesian fisheye shows the region of a fixed radius around the
895 focus point (fixed radius cartesian fisheye). This region might be
896 smaller than the whole graph, but the demagnification needed to show
897 this region in the window is also not so large, thus more details
898 are recognizable. With pfish the self adaptable polar fisheye is
899 selected that shows the whole graph, and with fpfish the fixed
900 radius polar fisheye is selected.
901 Default is normal view. */
904 /* Edges no suppresses the drawing of edges.
908 /* Nodes no suppresses the drawing of nodes.
912 /* Splines specifies whether splines are used to draw edges (yes or no).
913 As default, polygon segments are used to draw edges, because this is
914 much faster. Note that the spline drawing routine is not fully
915 validated, and is very slow. Its use is mainly to prepare high
916 quality PostScript output for very small graphs.
918 enum decision splines
;
920 /* Bmax set the maximal number of iterations that are done for the
921 reduction of edge bendings.
925 /* Cmin set the minimal number of iterations that are done for the
926 crossing reduction with the crossing weights. The normal method
927 stops if two consecutive checks does not reduce the number of
928 crossings anymore. However, this increasing of the number of
929 crossings might be locally, such that after some more iterations,
930 the crossing number might decrease much more.
934 /* Cmax set the maximal number of interactions for crossing reduction.
935 This is helpful for speedup the layout process.
936 Default is infinite. */
939 /* Pmin set the minimal number of iterations that is done with the
940 pendulum method. Similar to the crossing reduction, this method
941 stops if the `imbalancement weight' does not decreases anymore.
942 However, the increasing of the imbalancement weight might be locally,
943 such that after some more iterations, the imbalancement weight might
948 /* Pmax set the maximal number of iterations of the pendulum method.
949 This is helpful for speedup the layout process.
953 /* Rmin set the minimal number of iterations that is done with the
954 rubberband method. This is similar as for the pendulum method.
958 /* Rmax set the maximal number of iterations of the rubberband method.
959 This is helpful for speedup the layout process.
963 /* Smax set the maximal number of iterations of the straight line
964 recognition phase (useful only, if the straight line recognition
965 phase is switched on, see attribute straight.phase).
974 /* List of nodes declared.
978 /* List of edges declared.
984 /* Graph typedefs. */
985 typedef struct graph graph
;
987 void new_graph (graph
*g
);
988 void new_node (node
*n
);
989 void new_edge (edge
*e
);
991 void add_node (graph
*g
, node
*n
);
992 void add_edge (graph
*g
, edge
*e
);
994 void add_colorentry (graph
*g
, int color_idx
, int red_cp
,
995 int green_cp
, int blue_cp
);
996 void add_classname (graph
*g
, int val
, const char *name
);
997 void add_infoname (graph
*g
, int val
, const char *name
);
999 void open_node (FILE *fout
);
1000 void output_node (node
*n
, FILE *fout
);
1001 void close_node (FILE *fout
);
1003 void open_edge (edge
*e
, FILE *fout
);
1004 void output_edge (edge
*e
, FILE *fout
);
1005 void close_edge (FILE *fout
);
1007 void open_graph (FILE *fout
);
1008 void output_graph (graph
*g
, FILE *fout
);
1009 void close_graph (graph
*g
, FILE *fout
);