/misc/src/release/graphviz-2.18-1/src/graphviz-2.18/lib/fdpgen/fdp.h

Go to the documentation of this file.
00001 /* $Id: fdp.h,v 1.6 2006/12/07 22:49:36 erg Exp $ $Revision: 1.6 $ */
00002 /* vim:set shiftwidth=4 ts=8: */
00003 
00004 /**********************************************************
00005 *      This software is part of the graphviz package      *
00006 *                http://www.graphviz.org/                 *
00007 *                                                         *
00008 *            Copyright (c) 1994-2004 AT&T Corp.           *
00009 *                and is licensed under the                *
00010 *            Common Public License, Version 1.0           *
00011 *                      by AT&T Corp.                      *
00012 *                                                         *
00013 *        Information and Software Systems Research        *
00014 *              AT&T Research, Florham Park NJ             *
00015 **********************************************************/
00016 
00017 #ifndef FDP_H
00018 #define FDP_H
00019 
00020 #include <render.h>
00021 
00022 #ifdef FDP_PRIVATE
00023 
00024 #define NDIM     2
00025 
00026 typedef struct bport_s {
00027     edge_t *e;
00028     node_t *n;
00029     double alpha;
00030 } bport_t;
00031 
00032 /* gdata is attached to the root graph, each cluster graph, 
00033  * and to each derived graph.
00034  * Graphs also use "builtin" fields:
00035  *   n_cluster, clust - to record clusters  
00036  */
00037 typedef struct {
00038     bport_t *ports;             /* boundary ports. 0-terminated */
00039     int nports;                 /* no. of ports */
00040     boxf bb;                    /* bounding box of graph */
00041     int flags;
00042     int level;                  /* depth in graph hierarchy */
00043     graph_t *parent;            /* smallest containing cluster */
00044 #ifdef DEBUG
00045     graph_t *orig;              /* original of derived graph */
00046 #endif
00047 } gdata;
00048 
00049 #define GDATA(g)    ((gdata*)(GD_alg(g)))
00050 #define BB(g)       (GDATA(g)->bb)
00051 #define PORTS(g)    (GDATA(g)->ports)
00052 #define NPORTS(g)   (GDATA(g)->nports)
00053 #define LEVEL(g)    (GDATA(g)->level)
00054 #define GPARENT(g)  (GDATA(g)->parent)
00055 #ifdef DEBUG
00056 #define GORIG(g)    (GDATA(g)->orig)
00057 #endif
00058 
00059 /* ndata is attached to nodes in real graphs.
00060  * Real nodes also use "builtin" fields:
00061  *   pos   - position information
00062  *   width,height     - node dimensions
00063  *   xsize,ysize      - node dimensions in points
00064  */
00065 typedef struct {
00066     node_t *dn;                 /* points to corresponding derived node,
00067                                  * which may represent the node or its
00068                                  * containing cluster. */
00069     graph_t *parent;            /* smallest containing cluster */
00070 } ndata;
00071 
00072 #define NDATA(n) ((ndata*)(ND_alg(n)))
00073 #define DNODE(n) (NDATA(n)->dn)
00074 #define PARENT(n) (NDATA(n)->parent)
00075 
00076 /* dndata is attached to nodes in derived graphs.
00077  * Derived nodes also use "builtin" fields:
00078  *   clust - for cluster nodes, points to cluster in real graph.
00079  *   pos   - position information
00080  *   width,height     - node dimensions
00081  */
00082 typedef struct {
00083     int deg;                    /* degree of node */
00084     int wdeg;                   /* weighted degree of node */
00085     node_t *dn;                 /* If derived node is not a cluster, */
00086     /* dn points real node. */
00087     double disp[NDIM];          /* incremental displacement */
00088 } dndata;
00089 
00090 #define DNDATA(n) ((dndata*)(ND_alg(n)))
00091 #define DISP(n) (DNDATA(n)->disp)
00092 #define ANODE(n) (DNDATA(n)->dn)
00093 #define DEG(n) (DNDATA(n)->deg)
00094 #define WDEG(n) (DNDATA(n)->wdeg)
00095 #define IS_PORT(n) (!ANODE(n) && !ND_clust(n))
00096 
00097 #endif                          /*  FDP_PRIVATE */
00098 
00099 #ifdef __cplusplus
00100 extern "C" {
00101 #endif
00102 
00103     extern void fdp_layout(Agraph_t * g);
00104     extern void fdp_nodesize(node_t *, boolean);
00105     extern void fdp_init_graph(Agraph_t * g);
00106     extern void fdp_init_node_edge(Agraph_t * g);
00107     extern void fdp_cleanup(Agraph_t * g);
00108 
00109 #ifdef __cplusplus
00110 }
00111 #endif
00112 #endif

Generated on Mon Mar 31 19:03:26 2008 for Graphviz by  doxygen 1.5.1