Graphviz 13.0.0~dev.20241212.1010
|
#include <assert.h>
#include <common/pointset.h>
#include <common/render.h>
#include <math.h>
#include <pack/pack.h>
#include <stdbool.h>
#include <stddef.h>
#include <util/alloc.h>
#include <util/prisize_t.h>
#include <util/sort.h>
#include <util/startswith.h>
#include <util/streq.h>
Go to the source code of this file.
Data Structures | |
struct | ginfo |
struct | ainfo |
Macros | |
#define | C 100 /* Max. avg. polyomino size */ |
#define | MOVEPT(p) ((p).x += dx, (p).y += dy) |
#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))) |
Functions | |
static int | GRID (double x, int s) |
given cell size s , how many cells are required by size x? | |
static int | computeStep (size_t ng, boxf *bbs, unsigned int margin) |
static int | cmpf (const void *X, const void *Y) |
static int | sgn (int x) |
sgn , as defined in Graphics Gems I, ยง11.8, pp. 99 | |
static void | fillLine (pointf p, pointf q, PointSet *ps) |
static void | fillEdge (Agedge_t *e, pointf p, PointSet *ps, double dx, double dy, int ssize, bool doS) |
static void | genBox (boxf bb0, ginfo *info, int ssize, unsigned int margin, pointf center, char *s) |
static int | genPoly (Agraph_t *root, Agraph_t *g, ginfo *info, int ssize, pack_info *pinfo, pointf center) |
static int | fits (int x, int y, ginfo *info, PointSet *ps, pointf *place, int step, boxf *bbs) |
static void | placeFixed (ginfo *info, PointSet *ps, pointf *place, pointf center) |
static void | placeGraph (size_t i, ginfo *info, PointSet *ps, pointf *place, int step, unsigned int margin, boxf *bbs) |
static int | ucmpf (const void *X, const void *Y, void *user_values) |
Sort by user values. | |
static int | acmpf (const void *X, const void *Y) |
Sort by height + width. | |
static void | INC (bool m, size_t *c, size_t *r, size_t nc, size_t nr) |
static pointf * | arrayRects (size_t ng, boxf *gs, pack_info *pinfo) |
static pointf * | polyRects (size_t ng, boxf *gs, pack_info *pinfo) |
static pointf * | polyGraphs (size_t ng, Agraph_t **gs, Agraph_t *root, pack_info *pinfo) |
pointf * | putGraphs (size_t ng, Agraph_t **gs, Agraph_t *root, pack_info *pinfo) |
pointf * | putRects (size_t ng, boxf *bbs, pack_info *pinfo) |
int | packRects (size_t ng, boxf *bbs, pack_info *pinfo) |
static void | shiftEdge (Agedge_t *e, double dx, double dy) |
Translate all of the edge components by the given offset. | |
static void | shiftGraph (Agraph_t *g, double dx, double dy) |
int | shiftGraphs (size_t ng, Agraph_t **gs, pointf *pp, Agraph_t *root, bool doSplines) |
int | packGraphs (size_t ng, Agraph_t **gs, Agraph_t *root, pack_info *info) |
int | packSubgraphs (size_t ng, Agraph_t **gs, Agraph_t *root, pack_info *info) |
int | pack_graph (size_t ng, Agraph_t **gs, Agraph_t *root, bool *fixed) |
Pack subgraphs followed by postprocessing. | |
static const char * | chkFlags (const char *p, pack_info *pinfo) |
static const char * | mode2Str (pack_mode m) |
pack_mode | parsePackModeInfo (const 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) |
|
static |
Definition at line 566 of file pack.c.
References ainfo::height, ainfo::width, X, and Y.
Referenced by arrayRects().
Definition at line 601 of file pack.c.
References acmpf(), pack_info::flags, free(), gv_calloc(), gv_sort(), ainfo::height, INC, ainfo::index, boxf::LL, pack_info::margin, PK_BOT_ALIGN, PK_COL_MAJOR, PK_INPUT_ORDER, PK_LEFT_ALIGN, PK_RIGHT_ALIGN, PK_TOP_ALIGN, PRISIZE_T, sinfo, pack_info::sz, ucmpf(), boxf::UR, pack_info::vals, Verbose, ainfo::width, pointf_s::x, and pointf_s::y.
Referenced by putGraphs(), and putRects().
|
static |
Definition at line 1140 of file pack.c.
References pack_info::flags, PK_BOT_ALIGN, PK_COL_MAJOR, PK_INPUT_ORDER, PK_LEFT_ALIGN, PK_RIGHT_ALIGN, PK_TOP_ALIGN, and PK_USER_VALS.
Referenced by parsePackModeInfo().
|
static |
Definition at line 100 of file pack.c.
References ginfo::perim, X, and Y.
Referenced by polyGraphs(), and polyRects().
|
static |
Definition at line 62 of file pack.c.
References C, boxf::LL, boxf::UR, Verbose, pointf_s::x, and pointf_s::y.
Referenced by polyGraphs(), and polyRects().
|
static |
Definition at line 167 of file pack.c.
References aghead, CELL, coord(), ED_spl, bezier::eflag, bezier::ep, fillLine(), bezier::list, MOVEPT, ps, bezier::sflag, bezier::size, and bezier::sp.
Referenced by genPoly().
Definition at line 119 of file pack.c.
References addPS(), dx, dy, ps, ROUND, sgn(), pointf_s::x, and pointf_s::y.
Referenced by fillEdge().
|
static |
Definition at line 417 of file pack.c.
References inPS(), insertPS(), boxf::LL, ps, Verbose, pointf_s::x, and pointf_s::y.
Referenced by placeGraph().
|
static |
Definition at line 224 of file pack.c.
References addPS(), CELL, center(), freePS(), GRID(), boxf::LL, newPS(), pointsOf(), ps, sizeOf(), boxf::UR, Verbose, point::x, pointf_s::x, point::y, and pointf_s::y.
Referenced by polyGraphs(), and polyRects().
|
static |
Definition at line 273 of file pack.c.
References add_pointf(), addPS(), agfstnode(), agfstout(), aghead, agnameof(), agnnodes(), agnxtnode(), agnxtout(), CELL, center(), coord(), pack_info::doSplines, dx, dy, fillEdge(), free(), freePS(), GD_bb, GD_clust, GD_n_cluster, GRID(), gv_calloc(), l_clust, boxf::LL, pack_info::margin, pack_info::mode, MOVEPT, ND_alg, ND_clust, ND_xsize, ND_ysize, newPS(), pointsOf(), ps, sizeOf(), sub_pointf(), boxf::UR, Verbose, point::x, pointf_s::x, point::y, and pointf_s::y.
Referenced by polyGraphs().
int getPack | ( | Agraph_t * | g, |
int | not_def, | ||
int | dflt | ||
) |
Definition at line 1266 of file pack.c.
References agget().
Referenced by compoundEdges(), doDot(), getPackInfo(), and neato_layout().
Definition at line 1281 of file pack.c.
References pack_info::doSplines, pack_info::fixed, getPack(), getPackModeInfo(), pack_info::margin, pack_info::mode, NULL, and Verbose.
Referenced by circoLayout(), doDot(), init_info(), layout(), pack_graph(), sfdp_layout(), and twopi_layout().
Definition at line 1257 of file pack.c.
References getPackModeInfo().
Definition at line 1253 of file pack.c.
References agget(), and parsePackModeInfo().
Referenced by doDot(), getPackInfo(), getPackMode(), and neato_layout().
|
static |
Definition at line 34 of file pack.c.
Referenced by genBox(), genPoly(), and placeGraph().
|
static |
|
static |
Definition at line 1127 of file pack.c.
References CL_OFFSET, dotneato_postprocess(), getPackInfo(), l_graph, and packSubgraphs().
Referenced by main().
Definition at line 1089 of file pack.c.
References free(), putGraphs(), and shiftGraphs().
Referenced by main(), neato_layout(), and packSubgraphs().
Definition at line 948 of file pack.c.
References add_pointf(), free(), boxf::LL, putRects(), and boxf::UR.
Definition at line 1104 of file pack.c.
References compute_bb(), EXPANDBB, GD_bb, GD_clust, GD_n_cluster, and packGraphs().
Referenced by circoLayout(), doDot(), pack_graph(), sfdp_layout(), and twopi_layout().
Definition at line 1208 of file pack.c.
References pack_info::aspect, chkFlags(), pack_info::flags, l_array, l_aspect, l_clust, l_graph, l_node, pack_info::mode, mode2Str(), NULL, startswith(), streq(), pack_info::sz, pack_info::vals, and Verbose.
Referenced by getPackModeInfo(), and init().
Definition at line 456 of file pack.c.
References center(), insertPS(), ps, Verbose, point::x, pointf_s::x, point::y, and pointf_s::y.
Referenced by polyGraphs().
|
static |
Definition at line 478 of file pack.c.
References fits(), GRID(), boxf::LL, ps, boxf::UR, pointf_s::x, and pointf_s::y.
Referenced by polyGraphs(), and polyRects().
Definition at line 782 of file pack.c.
References agnameof(), center(), cmpf(), compute_bb(), computeStep(), pack_info::fixed, free(), freePS(), GD_bb, genBox(), genPoly(), gv_calloc(), l_graph, boxf::LL, pack_info::margin, pack_info::mode, newPS(), placeFixed(), placeGraph(), PRISIZE_T, ps, sinfo, boxf::UR, Verbose, point::x, pointf_s::x, point::y, and pointf_s::y.
Referenced by putGraphs().
Definition at line 713 of file pack.c.
References cmpf(), computeStep(), free(), freePS(), genBox(), gv_calloc(), pack_info::margin, newPS(), placeGraph(), PRISIZE_T, ps, sinfo, and Verbose.
Referenced by putRects().
Definition at line 888 of file pack.c.
References agget(), arrayRects(), compute_bb(), pack_info::flags, free(), GD_bb, gv_calloc(), l_array, l_graph, pack_info::mode, NULL, PK_USER_VALS, polyGraphs(), and pack_info::vals.
Referenced by layout(), and packGraphs().
Definition at line 927 of file pack.c.
References arrayRects(), l_array, l_clust, l_graph, l_node, pack_info::mode, NULL, and polyRects().
Referenced by layout(), and packRects().
|
static |
Definition at line 114 of file pack.c.
Referenced by fillLine(), selfBottom(), selfLeft(), selfRight(), and selfTop().
|
static |
Definition at line 970 of file pack.c.
References ED_head_label, ED_label, ED_spl, ED_tail_label, ED_xlabel, bezier::eflag, bezier::list, MOVEPT, NULL, bezier::sflag, and bezier::size.
Referenced by shiftGraphs().
|
static |
Definition at line 995 of file pack.c.
References dx, dy, GD_bb, GD_clust, GD_label, GD_n_cluster, boxf::LL, MOVEPT, shiftGraph(), boxf::UR, pointf_s::x, and pointf_s::y.
Referenced by shiftGraph(), and shiftGraphs().
Definition at line 1037 of file pack.c.
References agfstnode(), agfstout(), agnxtnode(), agnxtout(), dx, dy, MOVEPT, ND_coord, ND_pos, ND_xlabel, PS2INCH, shiftEdge(), shiftGraph(), pointf_s::x, and pointf_s::y.
Referenced by packGraphs().
|
static |
Definition at line 551 of file pack.c.
References ainfo::index, X, and Y.
Referenced by arrayRects().