00001 /* $Id: block.h,v 1.1.1.1 2004/12/23 04:04:28 ellson Exp $ $Revision: 1.1.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 #ifdef __cplusplus 00018 extern "C" { 00019 #endif 00020 00021 #ifndef BLOCK_H 00022 #define BLOCK_H 00023 00024 #include <nodelist.h> 00025 00026 typedef struct block block_t; 00027 00028 typedef struct { 00029 block_t *first; 00030 block_t *last; 00031 } blocklist_t; 00032 00033 struct block { 00034 Agnode_t *child; /* if non-null, points to node in parent block */ 00035 block_t *next; /* sibling block */ 00036 Agraph_t *sub_graph; /* nodes and edges in this block */ 00037 double radius; /* radius of block and subblocks */ 00038 double rad0; /* radius of block */ 00039 nodelist_t *circle_list; /* ordered list of nodes in block */ 00040 blocklist_t children; /* child blocks */ 00041 double parent_pos; /* if block has 1 node, angle to place parent */ 00042 int flags; 00043 }; 00044 00045 extern block_t *mkBlock(Agraph_t *); 00046 extern void freeBlock(block_t * sp); 00047 00048 extern void initBlocklist(blocklist_t *); 00049 extern void appendBlock(blocklist_t * sp, block_t * sn); 00050 extern void insertBlock(blocklist_t * sp, block_t * sn); 00051 /* extern void freeBlocklist (blocklist_t* sp); */ 00052 00053 #ifdef DEBUG 00054 extern void printBlocklist(blocklist_t * snl); 00055 #endif 00056 00057 #define CHILD(b) ((b)->child) 00058 #define BLK_PARENT(b) (CHILD(b)? PARENT(CHILD(b)) : 0) 00059 #define BLK_FLAGS(b) ((b)->flags) 00060 00061 #define COALESCED_F (1 << 0) 00062 #define COALESCED(b) (BLK_FLAGS(b)&COALESCED_F) 00063 #define SET_COALESCED(b) (BLK_FLAGS(b) |= COALESCED_F) 00064 00065 #endif 00066 00067 #ifdef __cplusplus 00068 } 00069 #endif