wolffd@0
|
1 /* $Id: pack.h,v 1.17 2009/08/11 21:23:23 erg Exp $ $Revision: 1.17 $ */
|
wolffd@0
|
2 /* vim:set shiftwidth=4 ts=8: */
|
wolffd@0
|
3
|
wolffd@0
|
4 /**********************************************************
|
wolffd@0
|
5 * This software is part of the graphviz package *
|
wolffd@0
|
6 * http://www.graphviz.org/ *
|
wolffd@0
|
7 * *
|
wolffd@0
|
8 * Copyright (c) 1994-2004 AT&T Corp. *
|
wolffd@0
|
9 * and is licensed under the *
|
wolffd@0
|
10 * Common Public License, Version 1.0 *
|
wolffd@0
|
11 * by AT&T Corp. *
|
wolffd@0
|
12 * *
|
wolffd@0
|
13 * Information and Software Systems Research *
|
wolffd@0
|
14 * AT&T Research, Florham Park NJ *
|
wolffd@0
|
15 **********************************************************/
|
wolffd@0
|
16
|
wolffd@0
|
17
|
wolffd@0
|
18
|
wolffd@0
|
19 #ifndef _PACK_H
|
wolffd@0
|
20 #define _PACK_H 1
|
wolffd@0
|
21
|
wolffd@0
|
22 #ifdef __cplusplus
|
wolffd@0
|
23 extern "C" {
|
wolffd@0
|
24 #endif
|
wolffd@0
|
25
|
wolffd@0
|
26 #include "types.h"
|
wolffd@0
|
27
|
wolffd@0
|
28 /* Type indicating granularity and method
|
wolffd@0
|
29 * l_undef - unspecified
|
wolffd@0
|
30 * l_node - polyomino using nodes and edges
|
wolffd@0
|
31 * l_clust - polyomino using nodes and edges and top-level clusters
|
wolffd@0
|
32 * (assumes ND_clust(n) unused by application)
|
wolffd@0
|
33 * l_graph - polyomino using computer graph bounding box
|
wolffd@0
|
34 * l_array - array based on graph bounding boxes
|
wolffd@0
|
35 * l_aspect - tiling based on graph bounding boxes preserving aspect ratio
|
wolffd@0
|
36 * l_hull - polyomino using convex hull (unimplemented)
|
wolffd@0
|
37 * l_tile - tiling using graph bounding box (unimplemented)
|
wolffd@0
|
38 * l_bisect - alternate bisection using graph bounding box (unimplemented)
|
wolffd@0
|
39 */
|
wolffd@0
|
40 typedef enum { l_undef, l_clust, l_node, l_graph, l_array, l_aspect } pack_mode;
|
wolffd@0
|
41
|
wolffd@0
|
42 #define PK_COL_MAJOR 1
|
wolffd@0
|
43 #define PK_USER_VALS 2
|
wolffd@0
|
44
|
wolffd@0
|
45 typedef unsigned char packval_t;
|
wolffd@0
|
46
|
wolffd@0
|
47 typedef struct {
|
wolffd@0
|
48 float aspect; /* desired aspect ratio */
|
wolffd@0
|
49 int sz; /* row/column size size */
|
wolffd@0
|
50 unsigned int margin; /* margin left around objects, in points */
|
wolffd@0
|
51 int doSplines; /* use splines in constructing graph shape */
|
wolffd@0
|
52 pack_mode mode; /* granularity and method */
|
wolffd@0
|
53 boolean *fixed; /* fixed[i] == true implies g[i] should not be moved */
|
wolffd@0
|
54 packval_t* vals; /* for arrays, sort numbers */
|
wolffd@0
|
55 int flags;
|
wolffd@0
|
56 } pack_info;
|
wolffd@0
|
57 #ifdef GVDLL
|
wolffd@0
|
58 #define extern __declspec(dllexport)
|
wolffd@0
|
59 #else
|
wolffd@0
|
60 #define extern
|
wolffd@0
|
61 #endif
|
wolffd@0
|
62
|
wolffd@0
|
63 /*visual studio*/
|
wolffd@0
|
64 #ifdef WIN32_DLL
|
wolffd@0
|
65 #ifndef GVC_EXPORTS
|
wolffd@0
|
66 #define extern __declspec(dllimport)
|
wolffd@0
|
67 #endif
|
wolffd@0
|
68 #endif
|
wolffd@0
|
69 /*end visual studio*/
|
wolffd@0
|
70
|
wolffd@0
|
71 extern point *putRects(int ng, boxf* bbs, pack_info* pinfo);
|
wolffd@0
|
72 extern int packRects(int ng, boxf* bbs, pack_info* pinfo);
|
wolffd@0
|
73
|
wolffd@0
|
74 extern point *putGraphs(int, Agraph_t **, Agraph_t *, pack_info *);
|
wolffd@0
|
75 extern int packGraphs(int, Agraph_t **, Agraph_t *, pack_info *);
|
wolffd@0
|
76 extern int packSubgraphs(int, Agraph_t **, Agraph_t *, pack_info *);
|
wolffd@0
|
77 extern int pack_graph(int ng, Agraph_t** gs, Agraph_t* root, boolean* fixed);
|
wolffd@0
|
78
|
wolffd@0
|
79 extern int shiftGraphs(int, Agraph_t**, point*, Agraph_t*, int);
|
wolffd@0
|
80
|
wolffd@0
|
81 extern pack_mode getPackMode(Agraph_t * g, pack_mode dflt);
|
wolffd@0
|
82 extern int getPack(Agraph_t *, int not_def, int dflt);
|
wolffd@0
|
83 extern pack_mode getPackInfo(Agraph_t * g, pack_mode dflt, int dfltMargin, pack_info*);
|
wolffd@0
|
84 extern pack_mode getPackModeInfo(Agraph_t * g, pack_mode dflt, pack_info*);
|
wolffd@0
|
85 extern pack_mode parsePackModeInfo(char* p, pack_mode dflt, pack_info* pinfo);
|
wolffd@0
|
86
|
wolffd@0
|
87 extern int isConnected(Agraph_t *);
|
wolffd@0
|
88 extern Agraph_t **ccomps(Agraph_t *, int *, char *);
|
wolffd@0
|
89 extern Agraph_t **pccomps(Agraph_t *, int *, char *, boolean *);
|
wolffd@0
|
90 extern int nodeInduce(Agraph_t *);
|
wolffd@0
|
91 #undef extern
|
wolffd@0
|
92 #ifdef __cplusplus
|
wolffd@0
|
93 }
|
wolffd@0
|
94 #endif
|
wolffd@0
|
95 #endif
|