Graphviz 13.0.0~dev.20241220.2304
|
#include <assert.h>
#include <neatogen/neato.h>
#include <common/utils.h>
#include <float.h>
#include <math.h>
#include <neatogen/voronoi.h>
#include <neatogen/info.h>
#include <neatogen/edges.h>
#include <neatogen/site.h>
#include <neatogen/hedges.h>
#include <neatogen/digcola.h>
#include <stdbool.h>
#include <stddef.h>
#include <util/agxbuf.h>
#include <util/alloc.h>
#include <util/gv_ctype.h>
#include <util/startswith.h>
#include <util/strcasecmp.h>
Go to the source code of this file.
Data Structures | |
struct | state_t |
information the ID allocator needs to do its job More... | |
struct | lookup_t |
Macros | |
#define | SEPFACT 0.8 |
#define | ELS "|edgelabel|" |
#define | IS_LNODE(n) startswith(agnameof(n), ELS) |
#define | ISZERO(d) (fabs(d) < 0.000000001) |
Functions | |
static void | setBoundBox (state_t *st, Point *ll, Point *ur) |
static void | freeNodes (void) |
Free node resources. | |
static void | chkBoundBox (state_t *st, Agraph_t *graph) |
static int | makeInfo (Agraph_t *graph) |
For each node in the graph, create a Info data structure. | |
static int | scomp (const void *S1, const void *S2) |
static void | sortSites (state_t *st) |
Fill array of pointer to sites and sort the sites using scomp. | |
static void | geomUpdate (state_t *st, int doSort) |
static Site * | nextOne (void *state) |
static void | rmEquality (state_t *st) |
Check for nodes with identical positions and tweak the positions. | |
static unsigned | countOverlap (unsigned iter) |
Count number of node-node overlaps at iteration iter. | |
static void | increaseBoundBox (state_t *st) |
static double | areaOf (Point a, Point b, Point c) |
Area of triangle whose vertices are a,b,c. | |
static void | centroidOf (Point a, Point b, Point c, double *x, double *y) |
static void | newpos (Info_t *ip) |
static void | addCorners (const state_t *st) |
static void | newPos (const state_t *st, bool doAll) |
static void | cleanup (void) |
static int | vAdjust (state_t *st) |
static void | rePos (void) |
static int | sAdjust (state_t *st) |
static void | updateGraph (void) |
Enter new node positions into the graph. | |
double * | getSizes (Agraph_t *g, pointf pad, int *n_elabels, int **elabels) |
Set up array of half sizes in inches. | |
SparseMatrix | makeMatrix (Agraph_t *g) |
static int | angleSet (graph_t *g, double *phi) |
int | normalize (graph_t *g) |
static void | setPrismValues (Agraph_t *g, const char *s, adjust_data *dp) |
Initialize and set prism values. | |
static void | getAdjustMode (Agraph_t *g, const char *s, adjust_data *dp) |
Convert string value to internal value of adjustment mode. | |
void | graphAdjustMode (graph_t *G, adjust_data *dp, char *dflt) |
static int | simpleScale (graph_t *g) |
int | removeOverlapWith (graph_t *G, adjust_data *am) |
int | removeOverlapAs (graph_t *G, char *flag) |
Use flag value to determine if and how to remove node overlaps. | |
int | adjustNodes (graph_t *G) |
static int | parseFactor (char *s, expand_t *pp, double sepfact, double dflt) |
expand_t | sepFactor (graph_t *g) |
expand_t | esepFactor (graph_t *g) |
Variables | |
static const double | incr = 0.05 |
static const lookup_t | adjustMode [] |
#define IS_LNODE | ( | n | ) | startswith(agnameof(n), ELS) |
|
static |
Definition at line 356 of file adjust.c.
References addVertex(), Site::coord, dist_2(), state_t::ne, nodeInfo, nsites, state_t::nw, state_t::se, Info_t::site, state_t::sw, Point::x, and Point::y.
Referenced by newPos().
int adjustNodes | ( | graph_t * | G | ) |
Definition at line 1022 of file adjust.c.
References agget(), G, and removeOverlapAs().
Referenced by circoLayout(), init_nop(), and twopi_layout().
|
static |
Definition at line 86 of file adjust.c.
References agget(), Site::coord, Poly::corner, graph(), nodeInfo, nsites, Poly::origin, Info_t::poly, setBoundBox(), Info_t::site, Point::x, and Point::y.
Referenced by removeOverlapWith().
|
static |
Definition at line 422 of file adjust.c.
References edgeinit(), ELcleanup(), and siteinit().
Referenced by vAdjust().
|
static |
Definition at line 274 of file adjust.c.
References Site::coord, nodeInfo, nsites, overlaps(), Info_t::overlaps, Info_t::poly, polyOverlap(), Info_t::site, and Verbose.
Referenced by sAdjust(), and vAdjust().
Definition at line 1094 of file adjust.c.
References agget(), DFLT_MARGIN, expand_t::doAdd, parseFactor(), SEPFACT, Verbose, expand_t::x, and expand_t::y.
Referenced by splineEdges().
|
static |
Definition at line 67 of file adjust.c.
References breakPoly(), free(), nodeInfo, nsites, NULL, polyFree(), and Info_t::verts.
Referenced by removeOverlapWith().
|
static |
Definition at line 201 of file adjust.c.
References Site::coord, deltax, nsites, state_t::sites, sortSites(), Point::x, xmax, xmin, Point::y, ymax, and ymin.
Referenced by vAdjust().
|
static |
Definition at line 831 of file adjust.c.
References adjustMode, agwarningf(), AM_PRISM, lookup_t::attrib, mapbool(), mapBool(), lookup_t::mode, adjust_data::mode, NULL, lookup_t::print, adjust_data::print, adjust_data::scaling, setPrismValues(), adjust_data::value, and Verbose.
Referenced by graphAdjustMode(), and removeOverlapAs().
Definition at line 529 of file adjust.c.
References agfstnode(), agnnodes(), agnxtnode(), gv_calloc(), IS_LNODE, ND_height, ND_id, ND_width, Ndim, pointf_s::x, and pointf_s::y.
Referenced by sfdpLayout().
void graphAdjustMode | ( | graph_t * | G, |
adjust_data * | dp, | ||
char * | dflt | ||
) |
Definition at line 880 of file adjust.c.
References agget(), G, and getAdjustMode().
Referenced by neato_layout(), and sfdp_layout().
|
static |
|
static |
Definition at line 120 of file adjust.c.
References agfstnode(), agnnodes(), agnxtnode(), Site::coord, expand_t::doAdd, free(), geominit(), graph(), gv_calloc(), makeAddPoly(), makePoly(), Info_t::n_verts, ND_pos, Info_t::node, nodeInfo, nsites, NULL, Info_t::poly, PS2INCH, Site::refcnt, sepFactor(), Info_t::site, Site::sitenbr, Info_t::verts, expand_t::x, Point::x, expand_t::y, and Point::y.
Referenced by removeOverlapWith().
SparseMatrix makeMatrix | ( | Agraph_t * | g | ) |
Definition at line 559 of file adjust.c.
References A, agfindedgeattr, agfstnode(), agfstout(), aghead, agnedges(), agnnodes(), agnxtnode(), agnxtout(), agxget(), free(), gv_calloc(), I, MATRIX_TYPE_REAL, ND_id, nedges, NULL, row, and SparseMatrix_from_coordinate_arrays().
Referenced by sfdpLayout().
|
static |
Definition at line 407 of file adjust.c.
References addCorners(), doAll, newpos(), nodeInfo, nsites, and Info_t::overlaps.
Referenced by vAdjust().
|
static |
Definition at line 330 of file adjust.c.
References areaOf(), centroidOf(), Site::coord, Info_t::n_verts, Info_t::site, Info_t::verts, Point::x, and Point::y.
Referenced by constrainX(), constrainY(), and newPos().
|
static |
Definition at line 219 of file adjust.c.
References state_t::endSite, state_t::nextSite, and NULL.
Referenced by vAdjust().
int normalize | ( | graph_t * | g | ) |
Definition at line 739 of file adjust.c.
References agfstnode(), agfstout(), aghead, agnxtnode(), agtail, angleSet(), ND_pos, NULL, pointf_s::x, and pointf_s::y.
Referenced by dot_splines_(), layout(), and removeOverlapWith().
|
static |
Definition at line 1032 of file adjust.c.
References expand_t::doAdd, gv_isspace(), expand_t::x, and expand_t::y.
Referenced by esepFactor(), and sepFactor().
int removeOverlapAs | ( | graph_t * | G, |
char * | flag | ||
) |
Definition at line 1009 of file adjust.c.
References agnnodes(), G, getAdjustMode(), and removeOverlapWith().
Referenced by adjustNodes(), and fdp_xLayout().
int removeOverlapWith | ( | graph_t * | G, |
adjust_data * | am | ||
) |
Definition at line 916 of file adjust.c.
References agnameof(), agnnodes(), agwarningf(), AM_COMPRESS, AM_IPSEP, AM_NONE, AM_NSCALE, AM_ORTHO, AM_ORTHO_YX, AM_ORTHOXY, AM_ORTHOYX, AM_PORTHO, AM_PORTHO_YX, AM_PORTHOXY, AM_PORTHOYX, AM_PRISM, AM_PUSH, AM_PUSHPULL, AM_SCALE, AM_SCALEXY, AM_VOR, AM_VPSC, cAdjust(), chkBoundBox(), fdpAdjust(), free(), freeNodes(), G, makeInfo(), adjust_data::mode, normalize(), adjust_data::print, sAdjust(), scAdjust(), simpleScale(), state_t::sites, updateGraph(), vAdjust(), and Verbose.
Referenced by neato_layout(), removeOverlapAs(), and sfdp_layout().
|
static |
Definition at line 479 of file adjust.c.
References Site::coord, incr, nodeInfo, nsites, Info_t::site, Point::x, and Point::y.
Referenced by sAdjust().
|
static |
Definition at line 228 of file adjust.c.
References cnt(), Site::coord, state_t::endSite, nodeInfo, state_t::sites, sortSites(), and Point::x.
Referenced by sAdjust(), and vAdjust().
|
static |
Definition at line 489 of file adjust.c.
References cnt(), countOverlap(), rePos(), rmEquality(), and Verbose.
Referenced by removeOverlapWith().
|
static |
Definition at line 164 of file adjust.c.
References Site::coord, s1(), Point::x, and Point::y.
Referenced by sortSites().
Definition at line 1069 of file adjust.c.
References agget(), DFLT_MARGIN, expand_t::doAdd, parseFactor(), SEPFACT, Verbose, expand_t::x, and expand_t::y.
Referenced by cAdjust(), compoundEdges(), majorization(), makeInfo(), scAdjust(), sfdp_layout(), and x_layout().
Definition at line 55 of file adjust.c.
References state_t::ne, state_t::nw, pxmax, pxmin, pymax, pymin, state_t::se, state_t::sw, Point::x, and Point::y.
Referenced by chkBoundBox(), and increaseBoundBox().
|
static |
Definition at line 820 of file adjust.c.
References agfindgraphattr, late_double(), adjust_data::scaling, and adjust_data::value.
Referenced by getAdjustMode().
|
static |
Definition at line 887 of file adjust.c.
References agfstnode(), agget(), agnxtnode(), ISZERO, ND_pos, Verbose, pointf_s::x, and pointf_s::y.
Referenced by removeOverlapWith().
|
static |
Definition at line 180 of file adjust.c.
References state_t::endSite, gv_calloc(), Info_t::n_verts, state_t::nextSite, nodeInfo, nsites, NULL, Site::refcnt, scomp(), Info_t::site, state_t::sites, and Info_t::verts.
Referenced by geomUpdate(), and rmEquality().
|
static |
Definition at line 515 of file adjust.c.
References Site::coord, ND_pos, Info_t::node, nodeInfo, nsites, Info_t::site, Point::x, and Point::y.
Referenced by removeOverlapWith().
|
static |
Definition at line 429 of file adjust.c.
References cleanup(), cnt(), countOverlap(), doAll, geomUpdate(), increaseBoundBox(), newPos(), nextOne(), rmEquality(), Verbose, and voronoi().
Referenced by removeOverlapWith().
|
static |
Definition at line 793 of file adjust.c.
Referenced by getAdjustMode().
|
static |
Definition at line 44 of file adjust.c.
Referenced by increaseBoundBox(), and rePos().