00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
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
00033
00034
00035
00036
00037 typedef struct {
00038 bport_t *ports;
00039 int nports;
00040 boxf bb;
00041 int flags;
00042 int level;
00043 graph_t *parent;
00044 #ifdef DEBUG
00045 graph_t *orig;
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
00060
00061
00062
00063
00064
00065 typedef struct {
00066 node_t *dn;
00067
00068
00069 graph_t *parent;
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
00077
00078
00079
00080
00081
00082 typedef struct {
00083 int deg;
00084 int wdeg;
00085 node_t *dn;
00086
00087 double disp[NDIM];
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
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