Main Page | Class Hierarchy | Class List | Directories | File List | Class Members | File Members

fdp.h

Go to the documentation of this file.
00001 /* $Id: fdp.h,v 1.1 2005/04/09 03:38:19 roxo Exp $ $Revision: 1.1 $ */
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 {
00027     pointf LL, UR;
00028 } boxf;
00029 
00030 typedef struct bport_s {
00031     edge_t *e;
00032     node_t *n;
00033     double alpha;
00034 } bport_t;
00035 
00036 /* gdata is attached to the root graph, each cluster graph, 
00037  * and to each derived graph.
00038  * Graphs also use "builtin" fields:
00039  *   n_cluster, clust - to record clusters  
00040  */
00041 typedef struct {
00042     bport_t *ports;             /* boundary ports. 0-terminated */
00043     int nports;                 /* no. of ports */
00044     boxf bb;                    /* bounding box of graph */
00045     int flags;
00046     int level;                  /* depth in graph hierarchy */
00047     graph_t *parent;            /* smallest containing cluster */
00048 } gdata;
00049 
00050 #define GDATA(g)    ((gdata*)(GD_alg(g)))
00051 #define BB(g)       (GDATA(g)->bb)
00052 #define PORTS(g)    (GDATA(g)->ports)
00053 #define NPORTS(g)   (GDATA(g)->nports)
00054 #define LEVEL(g)    (GDATA(g)->level)
00055 #define GPARENT(g)  (GDATA(g)->parent)
00056 
00057 /* ndata is attached to nodes in real graphs.
00058  * Real nodes also use "builtin" fields:
00059  *   pos   - position information
00060  *   width,height     - node dimensions
00061  *   xsize,ysize      - node dimensions in points
00062  */
00063 typedef struct {
00064     node_t *dn;                 /* points to corresponding derived node,
00065                                  * which may represent the node or its
00066                                  * containing cluster. */
00067     graph_t *parent;            /* smallest containing cluster */
00068 } ndata;
00069 
00070 #define NDATA(n) ((ndata*)(ND_alg(n)))
00071 #define DNODE(n) (NDATA(n)->dn)
00072 #define PARENT(n) (NDATA(n)->parent)
00073 
00074 /* dndata is attached to nodes in derived graphs.
00075  * Derived nodes also use "builtin" fields:
00076  *   clust - for cluster nodes, points to cluster in real graph.
00077  *   pos   - position information
00078  *   width,height     - node dimensions
00079  */
00080 typedef struct {
00081     int deg;                    /* degree of node */
00082     int wdeg;                   /* weighted degree of node */
00083     node_t *dn;                 /* If derived node is not a cluster, */
00084     /* dn points real node. */
00085     double disp[NDIM];          /* incremental displacement */
00086 } dndata;
00087 
00088 #define DNDATA(n) ((dndata*)(ND_alg(n)))
00089 #define DISP(n) (DNDATA(n)->disp)
00090 #define ANODE(n) (DNDATA(n)->dn)
00091 #define DEG(n) (DNDATA(n)->deg)
00092 #define WDEG(n) (DNDATA(n)->wdeg)
00093 #define IS_PORT(n) (!ANODE(n) && !ND_clust(n))
00094 
00095 #endif                          /*  FDP_PRIVATE */
00096 
00097 #ifdef __cplusplus
00098 extern "C" {
00099 #endif
00100 
00101     extern void fdp_layout(Agraph_t * g);
00102     extern void fdp_nodesize(node_t *, boolean);
00103     extern void fdp_init_graph(Agraph_t * g);
00104     extern void fdp_init_node_edge(Agraph_t * g);
00105     extern void fdp_cleanup(Agraph_t * g);
00106 
00107 #ifdef __cplusplus
00108 }
00109 #endif
00110 #endif
Untitled Document Pesquisa Psi SourceForge.net Logo