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 {
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
00037
00038
00039
00040
00041 typedef struct {
00042 bport_t *ports;
00043 int nports;
00044 boxf bb;
00045 int flags;
00046 int level;
00047 graph_t *parent;
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
00058
00059
00060
00061
00062
00063 typedef struct {
00064 node_t *dn;
00065
00066
00067 graph_t *parent;
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
00075
00076
00077
00078
00079
00080 typedef struct {
00081 int deg;
00082 int wdeg;
00083 node_t *dn;
00084
00085 double disp[NDIM];
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
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