Graphviz  2.41.20171026.1811
pack.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 
15 
16 #ifndef _PACK_H
17 #define _PACK_H 1
18 
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
22 
23 #include "types.h"
24 
25 /* Type indicating granularity and method
26  * l_undef - unspecified
27  * l_node - polyomino using nodes and edges
28  * l_clust - polyomino using nodes and edges and top-level clusters
29  * (assumes ND_clust(n) unused by application)
30  * l_graph - polyomino using computer graph bounding box
31  * l_array - array based on graph bounding boxes
32  * l_aspect - tiling based on graph bounding boxes preserving aspect ratio
33  * l_hull - polyomino using convex hull (unimplemented)
34  * l_tile - tiling using graph bounding box (unimplemented)
35  * l_bisect - alternate bisection using graph bounding box (unimplemented)
36  */
38 
39 #define PK_COL_MAJOR (1 << 0)
40 #define PK_USER_VALS (1 << 1)
41 #define PK_LEFT_ALIGN (1 << 2)
42 #define PK_RIGHT_ALIGN (1 << 3)
43 #define PK_TOP_ALIGN (1 << 4)
44 #define PK_BOT_ALIGN (1 << 5)
45 #define PK_INPUT_ORDER (1 << 6)
46 
47 typedef unsigned int packval_t;
48 
49  typedef struct {
50  float aspect; /* desired aspect ratio */
51  int sz; /* row/column size size */
52  unsigned int margin; /* margin left around objects, in points */
53  int doSplines; /* use splines in constructing graph shape */
54  pack_mode mode; /* granularity and method */
55  boolean *fixed; /* fixed[i] == true implies g[i] should not be moved */
56  packval_t* vals; /* for arrays, sort numbers */
57  int flags;
58  } pack_info;
59 
60 /*visual studio*/
61 #ifdef _WIN32
62 #ifndef GVC_EXPORTS
63 #define extern __declspec(dllimport)
64 #endif
65 #endif
66 /*end visual studio*/
67 
68  extern point *putRects(int ng, boxf* bbs, pack_info* pinfo);
69  extern int packRects(int ng, boxf* bbs, pack_info* pinfo);
70 
71  extern point *putGraphs(int, Agraph_t **, Agraph_t *, pack_info *);
72  extern int packGraphs(int, Agraph_t **, Agraph_t *, pack_info *);
73  extern int packSubgraphs(int, Agraph_t **, Agraph_t *, pack_info *);
74  extern int pack_graph(int ng, Agraph_t** gs, Agraph_t* root, boolean* fixed);
75 
76  extern int shiftGraphs(int, Agraph_t**, point*, Agraph_t*, int);
77 
78  extern pack_mode getPackMode(Agraph_t * g, pack_mode dflt);
79  extern int getPack(Agraph_t *, int not_def, int dflt);
80  extern pack_mode getPackInfo(Agraph_t * g, pack_mode dflt, int dfltMargin, pack_info*);
82  extern pack_mode parsePackModeInfo(char* p, pack_mode dflt, pack_info* pinfo);
83 
84  extern int isConnected(Agraph_t *);
85  extern Agraph_t **ccomps(Agraph_t *, int *, char *);
86  extern Agraph_t **cccomps(Agraph_t *, int *, char *);
87  extern Agraph_t **pccomps(Agraph_t *, int *, char *, boolean *);
88  extern int nodeInduce(Agraph_t *);
89  extern Agraph_t *mapClust(Agraph_t *);
90 #undef extern
91 #ifdef __cplusplus
92 }
93 #endif
94 #endif
int packRects(int ng, boxf *bbs, pack_info *pinfo)
Definition: pack.c:982
packval_t * vals
Definition: pack.h:56
pack_mode
Definition: pack.h:37
Definition: pack.h:49
int flags
Definition: pack.h:57
Definition: pack.h:37
int nodeInduce(Agraph_t *g)
Definition: ccomps.c:718
Definition: pack.h:37
Agraph_t ** pccomps(Agraph_t *g, int *ncc, char *pfx, boolean *pinned)
Definition: ccomps.c:196
Agraph_t ** cccomps(Agraph_t *g, int *ncc, char *pfx)
Definition: ccomps.c:608
pack_mode getPackInfo(Agraph_t *g, pack_mode dflt, int dfltMargin, pack_info *pinfo)
Definition: pack.c:1398
int packGraphs(int ng, Agraph_t **gs, Agraph_t *root, pack_info *info)
Definition: pack.c:1145
pack_mode mode
Definition: pack.h:54
int shiftGraphs(int ng, Agraph_t **gs, point *pp, Agraph_t *root, int doSplines)
Definition: pack.c:1088
boolean * fixed
Definition: pack.h:55
int doSplines
Definition: pack.h:53
unsigned int margin
Definition: pack.h:52
pack_mode getPackMode(Agraph_t *g, pack_mode dflt)
Definition: pack.c:1370
pack_mode getPackModeInfo(Agraph_t *g, pack_mode dflt, pack_info *pinfo)
Definition: pack.c:1364
int pack_graph(int ng, Agraph_t **gs, Agraph_t *root, boolean *fixed)
Definition: pack.c:1190
Definition: pack.h:37
point * putRects(int ng, boxf *bbs, pack_info *pinfo)
Definition: pack.c:959
int sz
Definition: pack.h:51
int packSubgraphs(int ng, Agraph_t **gs, Agraph_t *root, pack_info *info)
Definition: pack.c:1163
Definition: pack.h:37
Definition: geom.h:26
int getPack(Agraph_t *g, int not_def, int dflt)
Definition: pack.c:1381
unsigned int packval_t
Definition: pack.h:47
Definition: pack.h:37
Definition: pack.h:37
point * putGraphs(int ng, Agraph_t **gs, Agraph_t *root, pack_info *pinfo)
Definition: pack.c:916
pack_mode parsePackModeInfo(char *p, pack_mode dflt, pack_info *pinfo)
Definition: pack.c:1287
Agraph_t ** ccomps(Agraph_t *g, int *ncc, char *pfx)
Definition: ccomps.c:288
int isConnected(Agraph_t *g)
Definition: ccomps.c:682
Definition: geom.h:35
Agraph_t * mapClust(Agraph_t *cl)
Definition: ccomps.c:526
float aspect
Definition: pack.h:50