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#ifdef __cplusplus
15extern "C" {
16#endif
17
18#ifndef BLOCK_H
19#define BLOCK_H
20
21#include <nodelist.h>
22
23 typedef struct block block_t;
24
25 typedef struct {
26 block_t *first;
27 block_t *last;
28 } blocklist_t;
29
30 struct block {
31 Agnode_t *child; /* if non-null, points to node in parent block */
32 block_t *next; /* sibling block */
33 Agraph_t *sub_graph; /* nodes and edges in this block */
34 double radius; /* radius of block and subblocks */
35 double rad0; /* radius of block */
36 nodelist_t *circle_list; /* ordered list of nodes in block */
37 blocklist_t children; /* child blocks */
38 double parent_pos; /* if block has 1 node, angle to place parent */
39 int flags;
40 };
41
42 extern block_t *mkBlock(Agraph_t *);
43 extern void freeBlock(block_t * sp);
44 extern int blockSize(block_t * sp);
45
46 extern void initBlocklist(blocklist_t *);
47 extern void appendBlock(blocklist_t * sp, block_t * sn);
48 extern void insertBlock(blocklist_t * sp, block_t * sn);
49/* extern void freeBlocklist (blocklist_t* sp); */
50
51#ifdef DEBUG
52 extern void printBlocklist(blocklist_t * snl);
53#endif
54
55#define CHILD(b) ((b)->child)
56#define BLK_PARENT(b) (CHILD(b)? PARENT(CHILD(b)) : 0)
57#define BLK_FLAGS(b) ((b)->flags)
58
59#define COALESCED_F (1 << 0)
60#define COALESCED(b) (BLK_FLAGS(b)&COALESCED_F)
61#define SET_COALESCED(b) (BLK_FLAGS(b) |= COALESCED_F)
62
63#endif
64
65#ifdef __cplusplus
66}
67#endif
68