Graphviz
2.41.20171026.1811
Main Page
Data Structures
Files
File List
Globals
lib
circogen
circular.h
Go to the documentation of this file.
1
/* $Id$ $Revision$ */
2
/* vim:set shiftwidth=4 ts=8: */
3
4
/*************************************************************************
5
* Copyright (c) 2011 AT&T Intellectual Property
6
* All rights reserved. This program and the accompanying materials
7
* are made available under the terms of the Eclipse Public License v1.0
8
* which accompanies this distribution, and is available at
9
* http://www.eclipse.org/legal/epl-v10.html
10
*
11
* Contributors: See CVS logs. Details at http://www.graphviz.org/
12
*************************************************************************/
13
14
#ifndef CIRCULAR_H
15
#define CIRCULAR_H
16
17
#include "
render.h
"
18
#include "
block.h
"
19
20
typedef
struct
{
21
blocklist_t
bl
;
22
int
orderCount
;
23
int
blockCount
;
24
attrsym_t
*
N_artpos
;
25
attrsym_t
*
N_root
;
26
char
*
rootname
;
27
double
min_dist
;
28
}
circ_state
;
29
30
typedef
struct
{
31
Agnode_t
*
dnode
;
32
}
ndata
;
33
34
/* Extra node data used for layout:
35
* Pass O: build derived graph
36
* Pass 1: construct blocks
37
* Pass 2: construct block tree
38
* Pass 3: layout block
39
* a: construct block skeleton
40
* b: construct skeleton spanning tree
41
* c: construct circular list of nodes
42
* Pass 4: connect blocks
43
*/
44
typedef
struct
{
45
union
{
/* Pointer to node/cluster in original graph */
46
Agraph_t
*
g
;
47
Agnode_t
*
np
;
48
} orig;
49
int
flags
;
50
node_t
*
parent
;
/* parent in block-cutpoint traversal (1,2,4) */
51
block_t
*
block
;
/* Block containing node (1,2,3,4) */
52
union
{
53
struct
{
/* Pass 1 */
54
node_t
*
next
;
/* used for stack */
55
int
val
;
56
int
low_val
;
57
} bc;
58
node_t
*
clone
;
/* Cloned node (3a) */
59
struct
{
/* Spanning tree and longest path (3b) */
60
node_t
*
tparent
;
/* Parent in tree */
61
node_t
*
first
;
/* Leaf on longest path from node */
62
node_t
*
second
;
/* Leaf on 2nd longest path from node */
63
int
fdist
;
/* Length of longest path from node */
64
int
sdist
;
/* Length of 2nd longest path from node */
65
} t;
66
struct
{
67
int
pos
;
/* Index of node in block circle (3c,4) */
68
double
psi
;
/* Offset angle of children (4) */
69
} f;
70
} u;
71
}
cdata
;
72
73
typedef
struct
{
74
int
order
;
75
Agedge_t
*
next
;
76
}
edata
;
77
78
#define NDATA(n) ((ndata*)(ND_alg(n)))
79
#define DNODE(n) (NDATA(n)->dnode)
80
81
#define EDGEDATA(e) ((edata*)(ED_alg(e)))
82
#define ENEXT(e) (EDGEDATA(e)->next)
83
#define EDGEORDER(e) (EDGEDATA(e)->order)
84
85
#define DATA(n) ((cdata*)(ND_alg(n)))
86
#define ORIGG(n) (DATA(n)->orig.g)
87
#define ORIGN(n) (DATA(n)->orig.np)
88
#define FLAGS(n) (DATA(n)->flags)
89
#define PARENT(n) (DATA(n)->parent)
90
#define BLOCK(n) (DATA(n)->block)
91
#define NEXT(n) (DATA(n)->u.bc.next)
92
#define VAL(n) (DATA(n)->u.bc.val)
93
#define LOWVAL(n) (DATA(n)->u.bc.low_val)
94
#define CLONE(n) (DATA(n)->u.clone)
95
#define TPARENT(n) (DATA(n)->u.t.tparent)
96
#define LEAFONE(n) (DATA(n)->u.t.first)
97
#define LEAFTWO(n) (DATA(n)->u.t.second)
98
#define DISTONE(n) (DATA(n)->u.t.fdist)
99
#define DISTTWO(n) (DATA(n)->u.t.sdist)
100
#define POSITION(n) (DATA(n)->u.f.pos)
101
#define PSI(n) (DATA(n)->u.f.psi)
102
103
#define VISITED_F (1 << 0)
104
#define ONSTACK_F (1 << 2)
105
#define PARENT_F (1 << 3)
106
#define PATH_F (1 << 4)
107
#define NEIGHBOR_F (1 << 5)
108
109
#define VISITED(n) (FLAGS(n)&VISITED_F)
110
#define ONSTACK(n) (FLAGS(n)&ONSTACK_F)
111
#define ISPARENT(n) (FLAGS(n)&PARENT_F)
112
#define ONPATH(n) (FLAGS(n)&PATH_F)
113
#define NEIGHBOR(n) (FLAGS(n)&NEIGHBOR_F)
114
115
#define SET_VISITED(n) (FLAGS(n) |= VISITED_F)
116
#define SET_ONSTACK(n) (FLAGS(n) |= ONSTACK_F)
117
#define SET_PARENT(n) (FLAGS(n) |= PARENT_F)
118
#define SET_ONPATH(n) (FLAGS(n) |= PATH_F)
119
#define SET_NEIGHBOR(n) (FLAGS(n) |= NEIGHBOR_F)
120
121
#define UNSET_VISITED(n) (FLAGS(n) &= ~VISITED_F)
122
#define UNSET_ONSTACK(n) (FLAGS(n) &= ~ONSTACK_F)
123
#define UNSET_NEIGHBOR(n) (FLAGS(n) &= ~NEIGHBOR_F)
124
125
#define DEGREE(n) (ND_order(n))
126
127
#include <
circo.h
>
128
129
#ifdef __cplusplus
130
extern
"C"
{
131
#endif
132
133
#ifdef DEBUG
134
extern
void
prData(
Agnode_t
* n,
int
pass);
135
#endif
136
137
extern
void
circularLayout
(
Agraph_t
* sg,
Agraph_t
* rg);
138
139
#ifdef __cplusplus
140
}
141
#endif
142
#endif
cdata::low_val
int low_val
Definition:
circular.h:56
cdata::psi
double psi
Definition:
circular.h:68
cdata::block
block_t * block
Definition:
circular.h:51
circularLayout
void circularLayout(Agraph_t *g, Agraph_t *realg)
Definition:
circular.c:92
cdata::pos
int pos
Definition:
circular.h:67
circ_state::N_root
attrsym_t * N_root
Definition:
circular.h:25
ndata::dnode
Agnode_t * dnode
Definition:
circular.h:31
edata
Definition:
circular.h:73
cdata::first
node_t * first
Definition:
circular.h:61
cdata::val
int val
Definition:
circular.h:55
cdata::second
node_t * second
Definition:
circular.h:62
cdata::flags
int flags
Definition:
circular.h:49
cdata::fdist
int fdist
Definition:
circular.h:63
Agraph_s
Definition:
cgraph.h:239
cdata::parent
node_t * parent
Definition:
circular.h:50
circ_state::blockCount
int blockCount
Definition:
circular.h:23
cdata
Definition:
circular.h:44
circ_state::orderCount
int orderCount
Definition:
circular.h:22
Agedge_s
Definition:
cgraph.h:139
circ_state::min_dist
double min_dist
Definition:
circular.h:27
ndata
Definition:
circular.h:30
circ_state::rootname
char * rootname
Definition:
circular.h:26
cdata::next
node_t * next
Definition:
circular.h:54
Agsym_s
Definition:
cgraph.h:324
edata::next
Agedge_t * next
Definition:
circular.h:75
Agnode_s
Definition:
cgraph.h:133
circ_state::N_artpos
attrsym_t * N_artpos
Definition:
circular.h:24
block
Definition:
block.h:30
cdata::sdist
int sdist
Definition:
circular.h:64
blocklist_t
Definition:
block.h:25
circ_state::bl
blocklist_t bl
Definition:
circular.h:21
edata::order
int order
Definition:
circular.h:74
render.h
circo.h
cdata::clone
node_t * clone
Definition:
circular.h:58
circ_state
Definition:
circular.h:20
cdata::tparent
node_t * tparent
Definition:
circular.h:60
cdata::np
Agnode_t * np
Definition:
circular.h:47
cdata::g
Agraph_t * g
Definition:
circular.h:46
block.h
Generated by
1.8.5