Graphviz 12.0.1~dev.20240716.0800
Loading...
Searching...
No Matches
block.h
Go to the documentation of this file.
1/*************************************************************************
2 * Copyright (c) 2011 AT&T Intellectual Property
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * https://www.eclipse.org/legal/epl-v10.html
7 *
8 * Contributors: Details at https://graphviz.org
9 *************************************************************************/
10
11#pragma once
12
13#ifdef __cplusplus
14extern "C" {
15#endif
16
17#include <circogen/nodelist.h>
18
19 typedef struct block block_t;
20
21 typedef struct {
25
26 struct block {
27 Agnode_t *child; /* if non-null, points to node in parent block */
28 block_t *next; /* sibling block */
29 Agraph_t *sub_graph; /* nodes and edges in this block */
30 double radius; /* radius of block and subblocks */
31 double rad0; /* radius of block */
32 nodelist_t circle_list; /* ordered list of nodes in block */
33 blocklist_t children; /* child blocks */
34 double parent_pos; /* if block has 1 node, angle to place parent */
35 int flags;
36 };
37
38 extern block_t *mkBlock(Agraph_t *);
39 extern void freeBlock(block_t * sp);
40 extern int blockSize(block_t * sp);
41
42 extern void initBlocklist(blocklist_t *);
43 extern void appendBlock(blocklist_t * sp, block_t * sn);
44 extern void insertBlock(blocklist_t * sp, block_t * sn);
45
46#ifdef DEBUG
47 extern void printBlocklist(blocklist_t * snl);
48#endif
49
50#define CHILD(b) ((b)->child)
51#define BLK_PARENT(b) (CHILD(b)? PARENT(CHILD(b)) : 0)
52#define BLK_FLAGS(b) ((b)->flags)
53
54#define COALESCED_F (1 << 0)
55#define COALESCED(b) (BLK_FLAGS(b)&COALESCED_F)
56#define SET_COALESCED(b) (BLK_FLAGS(b) |= COALESCED_F)
57
58#ifdef __cplusplus
59}
60#endif
void insertBlock(blocklist_t *sp, block_t *sn)
add block at beginning
Definition block.c:58
void initBlocklist(blocklist_t *)
Definition block.c:17
int blockSize(block_t *sp)
Definition block.c:39
void freeBlock(block_t *sp)
Definition block.c:31
block_t * mkBlock(Agraph_t *)
Definition block.c:23
void appendBlock(blocklist_t *sp, block_t *sn)
add block at end
Definition block.c:45
graph or subgraph
Definition cgraph.h:425
Definition block.h:26
int flags
Definition block.h:35
double radius
Definition block.h:30
Agnode_t * child
Definition block.h:27
nodelist_t circle_list
Definition block.h:32
blocklist_t children
Definition block.h:33
Agraph_t * sub_graph
Definition block.h:29
double parent_pos
Definition block.h:34
block_t * next
Definition block.h:28
double rad0
Definition block.h:31
block_t * last
Definition block.h:23
block_t * first
Definition block.h:22