Graphviz  2.41.20171026.1811
Data Structures | Macros | Functions
pack.c File Reference
#include <math.h>
#include <assert.h>
#include "render.h"
#include "pack.h"
#include "pointset.h"
Include dependency graph for pack.c:

Go to the source code of this file.

Data Structures

struct  ginfo
 
struct  ainfo
 

Macros

#define strneq(a, b, n)   (!strncmp(a,b,n))
 
#define C   100 /* Max. avg. polyomino size */
 
#define MOVEPT(p)   ((p).x += dx, (p).y += dy)
 
#define GRID(x, s)   ((int)ceil((x)/(s)))
 
#define CVAL(v, s)   ((v) >= 0 ? (v)/(s) : (((v)+1)/(s))-1)
 
#define CELL(p, s)   ((p).x = CVAL((p).x,s), (p).y = CVAL((p).y,(s)))
 
#define INC(m, c, r)
 
#define ARRAY   "array"
 
#define ASPECT   "aspect"
 
#define SLEN(s)   (sizeof(s)/sizeof(char) - 1)
 

Functions

void fillLine (pointf p, pointf q, PointSet *ps)
 
pointputGraphs (int ng, Agraph_t **gs, Agraph_t *root, pack_info *pinfo)
 
pointputRects (int ng, boxf *bbs, pack_info *pinfo)
 
int packRects (int ng, boxf *bbs, pack_info *pinfo)
 
int shiftGraphs (int ng, Agraph_t **gs, point *pp, Agraph_t *root, int doSplines)
 
int packGraphs (int ng, Agraph_t **gs, Agraph_t *root, pack_info *info)
 
int packSubgraphs (int ng, Agraph_t **gs, Agraph_t *root, pack_info *info)
 
int pack_graph (int ng, Agraph_t **gs, Agraph_t *root, boolean *fixed)
 
pack_mode parsePackModeInfo (char *p, pack_mode dflt, pack_info *pinfo)
 
pack_mode getPackModeInfo (Agraph_t *g, pack_mode dflt, pack_info *pinfo)
 
pack_mode getPackMode (Agraph_t *g, pack_mode dflt)
 
int getPack (Agraph_t *g, int not_def, int dflt)
 
pack_mode getPackInfo (Agraph_t *g, pack_mode dflt, int dfltMargin, pack_info *pinfo)
 

Macro Definition Documentation

#define ARRAY   "array"

Definition at line 1203 of file pack.c.

Referenced by parsePackModeInfo().

#define ASPECT   "aspect"

Definition at line 1204 of file pack.c.

Referenced by parsePackModeInfo().

#define C   100 /* Max. avg. polyomino size */
#define CELL (   p,
  s 
)    ((p).x = CVAL((p).x,s), (p).y = CVAL((p).y,(s)))

Definition at line 37 of file pack.c.

#define CVAL (   v,
  s 
)    ((v) >= 0 ? (v)/(s) : (((v)+1)/(s))-1)

Definition at line 35 of file pack.c.

#define GRID (   x,
  s 
)    ((int)ceil((x)/(s)))

Definition at line 33 of file pack.c.

#define INC (   m,
  c,
 
)
Value:
if (m){ c++; if (c == nc) { c = 0; r++; } } \
else { r++; if (r == nr) { r = 0; c++; } }
else
Definition: grammar.c:1428

Definition at line 603 of file pack.c.

#define MOVEPT (   p)    ((p).x += dx, (p).y += dy)

Definition at line 31 of file pack.c.

Referenced by shiftGraphs().

#define SLEN (   s)    (sizeof(s)/sizeof(char) - 1)

Definition at line 1205 of file pack.c.

Referenced by parsePackModeInfo().

#define strneq (   a,
  b,
 
)    (!strncmp(a,b,n))

Definition at line 27 of file pack.c.

Referenced by parsePackModeInfo().

Function Documentation

void fillLine ( pointf  p,
pointf  q,
PointSet ps 
)

Definition at line 112 of file pack.c.

References ABS, addPS(), ROUND, SGN, pointf_s::x, and pointf_s::y.

int getPack ( Agraph_t g,
int  not_def,
int  dflt 
)

Definition at line 1381 of file pack.c.

References agget().

Referenced by compoundEdges(), getPackInfo(), and neato_layout().

pack_mode getPackInfo ( Agraph_t g,
pack_mode  dflt,
int  dfltMargin,
pack_info pinfo 
)
pack_mode getPackMode ( Agraph_t g,
pack_mode  dflt 
)

Definition at line 1370 of file pack.c.

References getPackModeInfo().

pack_mode getPackModeInfo ( Agraph_t g,
pack_mode  dflt,
pack_info pinfo 
)

Definition at line 1364 of file pack.c.

References agget(), and parsePackModeInfo().

Referenced by getPackInfo(), getPackMode(), and neato_layout().

int pack_graph ( int  ng,
Agraph_t **  gs,
Agraph_t root,
boolean fixed 
)
int packGraphs ( int  ng,
Agraph_t **  gs,
Agraph_t root,
pack_info info 
)

Definition at line 1145 of file pack.c.

References pack_info::doSplines, putGraphs(), and shiftGraphs().

Referenced by main(), neato_layout(), and packSubgraphs().

int packRects ( int  ng,
boxf bbs,
pack_info pinfo 
)

Definition at line 982 of file pack.c.

References boxf::LL, putRects(), boxf::UR, point::x, pointf_s::x, point::y, and pointf_s::y.

int packSubgraphs ( int  ng,
Agraph_t **  gs,
Agraph_t root,
pack_info info 
)

Definition at line 1163 of file pack.c.

References compute_bb(), EXPANDBB, GD_bb, GD_clust, GD_n_cluster, and packGraphs().

Referenced by circoLayout(), pack_graph(), sfdp_layout(), and twopi_layout().

pack_mode parsePackModeInfo ( char *  p,
pack_mode  dflt,
pack_info pinfo 
)
point* putGraphs ( int  ng,
Agraph_t **  gs,
Agraph_t root,
pack_info pinfo 
)
point* putRects ( int  ng,
boxf bbs,
pack_info pinfo 
)

Definition at line 959 of file pack.c.

References l_array, l_clust, l_graph, l_node, pack_info::mode, and NULL.

Referenced by packRects().

int shiftGraphs ( int  ng,
Agraph_t **  gs,
point pp,
Agraph_t root,
int  doSplines 
)

Definition at line 1088 of file pack.c.

References agfstnode(), agfstout(), agnxtnode(), agnxtout(), MOVEPT, ND_coord, ND_pos, ND_xlabel, PS2INCH, point::x, and point::y.

Referenced by packGraphs().