⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 vcg.h

📁 bison 2.0 主要可以用来做语法分析用的
💻 H
📖 第 1 页 / 共 3 页
字号:
  struct classname *classname;  /* Infoname allows to introduce names for the additional text labels.     The names are used in the menus.     Infoname is given by an integer and a string.     The default value is NULL.  */  struct infoname *infoname;  /* Colorentry allows to fill the color map. A color is a triplet of integer     values for the red/green/blue-part. Each integer is between 0 (off) and     255 (on), e.g., 0 0 0 is black and 255 255 255 is white. For instance     colorentry 75 : 70 130 180 sets the map entry 75 to steel blue. This     color can be used by specifying just the number 75.     Default id NULL.  */  struct colorentry *colorentry;  /* Layout downfactor, layout upfactor, layout nearfactor The layout     algorithm partitions the set of edges into edges pointing upward,     edges pointing downward, and edges pointing sidewards. The last type     of edges is also called near edges. If the layout.downfactor is     large compared to the layout.upfactor and the layout.nearfactor,     then the positions of the nodes is mainly determined by the edges     pointing downwards. If the layout.upfactor is large compared to the     layout.downfactor and the layout.nearfactor, then the positions of     the nodes is mainly determined by the edges pointing upwards. If the     layout.nearfactor is large, then the positions of the nodes is     mainly determined by the edges pointing sidewards. These attributes     have no effect, if the method for downward laid out trees is used.     Default is normal. */  int layout_downfactor;  int layout_upfactor;  int layout_nearfactor;  /* Layout splinefactor determines the bending at splines. The factor     100 indicates a very sharp bending, a factor 1 indicates a very flat     bending. Useful values are 30 : : : 80. */  int layout_splinefactor;  /* Late edge labels yes means that the graph is first partitioned and     then, labels are introduced. The default algorithm first creates     labels and then partitions the graph, which yield a more compact     layout, but may have more crossings.     Default is no. */  enum decision late_edge_labels;  /* Display edge labels yes means display labels and no means don't     display edge labels.     Default vaule is no. */  enum decision display_edge_labels;  /* Dirty edge labels yes enforces a fast layout of edge labels, which     may very ugly because several labels may be drawn at the same place.     Dirty edge labels cannot be used if splines are used.     Default is no.  */  enum decision dirty_edge_labels;  /* Finetuning no switches the fine tuning phase of the graph layout     algorithm off, while it is on as default. The fine tuning phase     tries to give all edges the same length.     Default is yes. */  enum decision finetuning;  /* Ignore singles yes hides all nodes which would appear single and     unconnected from the remaining graph. Such nodes have no edge at all     and are sometimes very ugly. Default is to show all nodes.     Default is no. */  enum decision ignore_singles;  /* priority phase yes replaces the normal pendulum method by a     specialized method: It forces straight long edges with 90 degree,     just as the straight phase. In fact, the straight phase is a fine     tune phase of the priority method. This phase is also recommended,     if an orthogonal layout is selected (see manhattan.edges).     Default is no. */  enum decision priority_phase;  /* manhattan edges yes switches the orthogonal layout on. Orthogonal     layout (or manhattan layout) means that all edges consist of line     segments with gradient 0 or 90 degree. Vertical edge segments might     by shared by several edges, while horizontal edge segments are never     shared. This results in very aesthetical layouts just for flowcharts.     If the orthogonal layout is used, then the priority phase and     straight phase should be used. Thus, these both phases are switched     on, too, unless priority layout and straight line tuning are     switched off explicitly.     Default is no. */  enum decision manhattan_edges;  /* Smanhattan edges yes switches a specialized orthogonal layout on:     Here, all horizontal edge segments between two levels share the same     horizontal line, i.e. not only vertical edge segments are shared,     but horizontal edge segments are shared by several edges, too. This     looks nice for trees but might be too confusing in general, because     the location of an edge might be ambiguously.     Default is no. */  enum decision smanhattan_edges;  /* Near edges no suppresses near edges and bent near edges in the     graph layout.     Default is yes. */  enum decision near_edges;  /* Orientation specifies the orientation of the graph: top.to.bottom,     bottom.to.top, left.to.right or right.to.left. Note: the normal     orientation is top.to.bottom. All explanations here are given     relatively to the normal orientation, i.e., e.g., if the orientation     is left to right, the attribute xlspace is not the horizontal but     the vertical distance between lines, etc.     Default is to_to_bottom. */  enum orientation orientation;  /* Node alignment specified the vertical alignment of nodes at the     horizontal reference line of the levels. If top is specified, the     tops of all nodes of a level have the same y-coordinate; on bottom,     the bottoms have the same y-coordinate, on center the nodes are     centered at the levels.     Default is center. */  enum alignment node_alignment;  /* Port sharing no suppresses the sharing of ports of edges at the     nodes. Normally, if multiple edges are adjacent to the same node,     and the arrow head of all these edges has the same visual appearance     (color, size, etc.), then these edges may share a port at a node,     i.e. only one arrow head is draw, and all edges are incoming into     this arrow head. This allows to have many edges adjacent to one node     without getting confused by too many arrow heads. If no port sharing     is used, each edge has its own port, i.e. its own place where it is     adjacent to the node.     Default is yes. */  enum decision port_sharing;  /* Arrow mode fixed (default) should be used, if port sharing is used,     because then, only a fixed set of rotations for the arrow heads are     used. If the arrow mode is free, then each arrow head is rotated     individually to each edge. But this can yield to a black spot, where     nothing is recognizable, if port sharing is used, since all these     qdifferently rotated arrow heads are drawn at the same place. If the     arrow mode is fixed, then the arrow head is rotated only in steps of     45 degree, and only one arrow head occurs at each port.     Default is fixed. */  enum arrow_mode arrow_mode;  /* Treefactor The algorithm tree for downward laid out trees tries to     produce a medium dense, balanced tree-like layout. If the tree     factor is greater than 0.5, the tree edges are spread, i.e. they     get a larger gradient. This may improve the readability of the tree.     Note: it is not obvious whether spreading results in a more dense or     wide layout. For a tree, there is a tree factor such that the whole     tree is minimal wide.     Default is 0.5. */  float treefactor;  /* Spreadlevel This parameter only influences the algorithm tree, too.     For large, balanced trees, spreading of the uppermost nodes would     enlarge the width of the tree too much, such that the tree does not     fit anymore in a window. Thus, the spreadlevel specifies the minimal     level (rank) where nodes are spread. Nodes of levels upper than     spreadlevel are not spread.     Default is 1. */  int spreadlevel;  /* Crossing weight specifies the weight that is used for the crossing     reduction: bary (default), median, barymedian or medianbary. We     cannot give a general recommendation, which is the best method. For     graphs with very large average degree of edges (number of incoming     and outgoing edges at a node), the weight bary is the fastest     method. With the weights barymedian and medianbary, equal weights of     different nodes are not very probable, thus the crossing reduction     phase 2 might be very fast.     Default is bary. */  enum crossing_type crossing_weight;  /* Crossing phase2 is the most time consuming phase of the crossing     reduction. In this phase, the nodes that happen to have equal     crossing weights are permuted. By specifying no, this phase is     suppressed.     Default is yes. */  enum decision crossing_phase2;  /* Crossing optimization is a postprocessing phase after the normal     crossing reduction: we try to optimize locally, by exchanging pairs     of nodes to reduce the crossings. Although this phase is not very     time consuming, it can be suppressed by specifying no.     Default is yes. */  enum decision crossing_optimization;  /* View allows to select the fisheye views. Because     of the fixed size of the window that shows the graph, we normally     can only see a small amount of a large graph. If we shrink the graph     such that it fits into the window, we cannot recognize any detail     anymore. Fisheye views are coordinate transformations: the view onto     the graph is distort, to overcome this usage deficiency. The polar     fisheye is easy to explain: assume a projection of the plane that     contains the graph picture onto a spheric ball. If we now look onto     this ball in 3 D, we have a polar fisheye view. There is a focus     point which is magnified such that we see all details. Parts of the     plane that are far away from the focus point are demagnified very     much. Cartesian fisheye have a similar effect; only the formula for     the coordinate transformation is different. Selecting cfish means     the cartesian fisheye is used which demagnifies such that the whole     graph is visible (self adaptable cartesian fisheye). With fcfish,     the cartesian fisheye shows the region of a fixed radius around the     focus point (fixed radius cartesian fisheye). This region might be     smaller than the whole graph, but the demagnification needed to show     this region in the window is also not so large, thus more details     are recognizable. With pfish the self adaptable polar fisheye is     selected that shows the whole graph, and with fpfish the fixed     radius polar fisheye is selected.     Default is normal view.  */  enum view view;  /* Edges no suppresses the drawing of edges.     Default is yes. */  enum decision edges;  /* Nodes no suppresses the drawing of nodes.     Default is yes. */  enum decision nodes;  /* Splines specifies whether splines are used to draw edges (yes or no).     As default, polygon segments are used to draw edges, because this is     much faster. Note that the spline drawing routine is not fully     validated, and is very slow. Its use is mainly to prepare high     quality PostScript output for very small graphs.     Default is no. */  enum decision splines;  /* Bmax set the maximal number of iterations that are done for the     reduction of edge bendings.   Default is 100. */  int bmax;  /* Cmin set the minimal number of iterations that are done for the     crossing reduction with the crossing weights. The normal method     stops if two consecutive checks does not reduce the number of     crossings anymore. However, this increasing of the number of     crossings might be locally, such that after some more iterations,     the crossing number might decrease much more.     Default is 0. */  int cmin;  /* Cmax set the maximal number of interactions for crossing reduction.     This is helpful for speedup the layout process.     Default is infinite. */  int cmax;  /* Pmin set the minimal number of iterations that is done with the     pendulum method. Similar to the crossing reduction, this method     stops if the `imbalancement weight' does not decreases anymore.     However, the increasing of the imbalancement weight might be locally,     such that after some more iterations, the imbalancement weight might     decrease much more.     Default is 0. */  int pmin;  /* Pmax set the maximal number of iterations of the pendulum method.     This is helpful for speedup the layout process.     Default is 100. */  int pmax;  /* Rmin set the minimal number of iterations that is done with the     rubberband method. This is similar as for the pendulum method.     Default is 0. */  int rmin;  /* Rmax set the maximal number of iterations of the rubberband method.     This is helpful for speedup the layout process.     Default is 100. */  int rmax;  /* Smax set the maximal number of iterations of the straight line     recognition phase (useful only, if the straight line recognition     phase is switched on, see attribute straight.phase).     Default is 100. */  int smax;  /* Generic values.   */  node node;  edge edge;  /* List of nodes declared.     Pointer. */  node *node_list;  /* List of edges declared.     Pointer. */  edge *edge_list;};/* Graph typedefs. */typedef struct graph graph;void new_graph (graph *g);void new_node (node *n);void new_edge (edge *e);void add_node (graph *g, node *n);void add_edge (graph *g, edge *e);void add_colorentry (graph *g, int color_idx, int red_cp,		     int green_cp, int blue_cp);void add_classname (graph *g, int val, const char *name);void add_infoname (graph *g, int val, const char *name);void open_node (FILE *fout);void output_node (node *n, FILE *fout);void close_node (FILE *fout);void open_edge (edge *e, FILE *fout);void output_edge (edge *e, FILE *fout);void close_edge (FILE *fout);void open_graph (FILE *fout);void output_graph (graph *g, FILE *fout);void close_graph (graph *g, FILE *fout);#endif /* VCG_H_ */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -