Graphviz 12.0.1~dev.20240716.0800
Loading...
Searching...
No Matches
tlayout.c File Reference
#include "config.h"
#include <math.h>
#include <stdlib.h>
#include <time.h>
#include <unistd.h>
#include <ctype.h>
#include <fdpgen/dbg.h>
#include <fdpgen/grid.h>
#include <neatogen/neato.h>
#include <fdpgen/tlayout.h>
#include <common/globals.h>
Include dependency graph for tlayout.c:

Go to the source code of this file.

Data Structures

struct  parms_t
 

Macros

#define FDP_PRIVATE   1
 
#define srand48   srand
 
#define D_useGrid   (fdp_parms->useGrid)
 
#define D_useNew   (fdp_parms->useNew)
 
#define D_numIters   (fdp_parms->numIters)
 
#define D_unscaled   (fdp_parms->unscaled)
 
#define D_C   (fdp_parms->C)
 
#define D_Tfact   (fdp_parms->Tfact)
 
#define D_K   (fdp_parms->K)
 
#define D_T0   (fdp_parms->T0)
 
#define T_useGrid   (parms.useGrid)
 
#define T_useNew   (parms.useNew)
 
#define T_seed   (parms.seed)
 
#define T_numIters   (parms.numIters)
 
#define T_maxIters   (parms.maxIters)
 
#define T_unscaled   (parms.unscaled)
 
#define T_C   (parms.C)
 
#define T_Tfact   (parms.Tfact)
 
#define T_K   (parms.K)
 
#define T_T0   (parms.T0)
 
#define T_smode   (parms.smode)
 
#define T_Cell   (parms.Cell)
 
#define T_Wd   (parms.Wd)
 
#define T_Ht   (parms.Ht)
 
#define T_pass1   (parms.pass1)
 
#define T_loopcnt   (parms.loopcnt)
 
#define EXPFACTOR   1.2
 
#define DFLT_maxIters   600
 
#define DFLT_K   0.3
 
#define DFLT_Cell   0.0
 
#define DFLT_seed   1
 
#define DFLT_smode   INIT_RANDOM
 
#define FLOOR(d)   ((int)floor(d))
 

Functions

static double cool (int t)
 
static void reset_params (void)
 
static int init_params (graph_t *g, xparams *xpms)
 
void fdp_initParams (graph_t *g)
 
static void doRep (node_t *p, node_t *q, double xdelta, double ydelta, double dist2)
 
static void applyRep (Agnode_t *p, Agnode_t *q)
 
static void doNeighbor (Grid *grid, int i, int j, node_list *nodes)
 
static int gridRepulse (cell *cellp, Grid *grid)
 
static void applyAttr (Agnode_t *p, Agnode_t *q, Agedge_t *e)
 
static void updatePos (Agraph_t *g, double temp, bport_t *pp)
 
static void gAdjust (Agraph_t *g, double temp, bport_t *pp, Grid *grid)
 
static void adjust (Agraph_t *g, double temp, bport_t *pp)
 
static pointf initPositions (graph_t *g, bport_t *pp)
 
void fdp_tLayout (graph_t *g, xparams *xpms)
 

Variables

static parms_t parms
 

Macro Definition Documentation

◆ D_C

#define D_C   (fdp_parms->C)

Definition at line 55 of file tlayout.c.

◆ D_K

#define D_K   (fdp_parms->K)

Definition at line 57 of file tlayout.c.

◆ D_numIters

#define D_numIters   (fdp_parms->numIters)

Definition at line 53 of file tlayout.c.

◆ D_T0

#define D_T0   (fdp_parms->T0)

Definition at line 58 of file tlayout.c.

◆ D_Tfact

#define D_Tfact   (fdp_parms->Tfact)

Definition at line 56 of file tlayout.c.

◆ D_unscaled

#define D_unscaled   (fdp_parms->unscaled)

Definition at line 54 of file tlayout.c.

◆ D_useGrid

#define D_useGrid   (fdp_parms->useGrid)

Definition at line 51 of file tlayout.c.

◆ D_useNew

#define D_useNew   (fdp_parms->useNew)

Definition at line 52 of file tlayout.c.

◆ DFLT_Cell

#define DFLT_Cell   0.0

Definition at line 104 of file tlayout.c.

◆ DFLT_K

#define DFLT_K   0.3

Definition at line 103 of file tlayout.c.

◆ DFLT_maxIters

#define DFLT_maxIters   600

Definition at line 102 of file tlayout.c.

◆ DFLT_seed

#define DFLT_seed   1

Definition at line 105 of file tlayout.c.

◆ DFLT_smode

#define DFLT_smode   INIT_RANDOM

Definition at line 106 of file tlayout.c.

◆ EXPFACTOR

#define EXPFACTOR   1.2

Definition at line 101 of file tlayout.c.

◆ FDP_PRIVATE

#define FDP_PRIVATE   1

Definition at line 28 of file tlayout.c.

◆ FLOOR

#define FLOOR (   d)    ((int)floor(d))

Definition at line 383 of file tlayout.c.

◆ srand48

#define srand48   srand

Definition at line 45 of file tlayout.c.

◆ T_C

#define T_C   (parms.C)

Definition at line 90 of file tlayout.c.

◆ T_Cell

#define T_Cell   (parms.Cell)

Definition at line 95 of file tlayout.c.

◆ T_Ht

#define T_Ht   (parms.Ht)

Definition at line 97 of file tlayout.c.

◆ T_K

#define T_K   (parms.K)

Definition at line 92 of file tlayout.c.

◆ T_loopcnt

#define T_loopcnt   (parms.loopcnt)

Definition at line 99 of file tlayout.c.

◆ T_maxIters

#define T_maxIters   (parms.maxIters)

Definition at line 88 of file tlayout.c.

◆ T_numIters

#define T_numIters   (parms.numIters)

Definition at line 87 of file tlayout.c.

◆ T_pass1

#define T_pass1   (parms.pass1)

Definition at line 98 of file tlayout.c.

◆ T_seed

#define T_seed   (parms.seed)

Definition at line 86 of file tlayout.c.

◆ T_smode

#define T_smode   (parms.smode)

Definition at line 94 of file tlayout.c.

◆ T_T0

#define T_T0   (parms.T0)

Definition at line 93 of file tlayout.c.

◆ T_Tfact

#define T_Tfact   (parms.Tfact)

Definition at line 91 of file tlayout.c.

◆ T_unscaled

#define T_unscaled   (parms.unscaled)

Definition at line 89 of file tlayout.c.

◆ T_useGrid

#define T_useGrid   (parms.useGrid)

Definition at line 84 of file tlayout.c.

◆ T_useNew

#define T_useNew   (parms.useNew)

Definition at line 85 of file tlayout.c.

◆ T_Wd

#define T_Wd   (parms.Wd)

Definition at line 96 of file tlayout.c.

Function Documentation

◆ adjust()

static void adjust ( Agraph_t g,
double  temp,
bport_t *  pp 
)
static

Definition at line 416 of file tlayout.c.

References agfstnode(), agfstout(), aghead, agnxtnode(), agnxtout(), applyAttr(), applyRep(), and updatePos().

Here is the call graph for this function:

◆ applyAttr()

static void applyAttr ( Agnode_t p,
Agnode_t q,
Agedge_t e 
)
static

Definition at line 311 of file tlayout.c.

References dist(), dist2(), ED_dist, ED_factor, ND_pos, and T_useNew.

Referenced by adjust(), and gAdjust().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ applyRep()

static void applyRep ( Agnode_t p,
Agnode_t q 
)
static

Definition at line 235 of file tlayout.c.

References doRep(), and ND_pos.

Referenced by adjust(), and gridRepulse().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cool()

static double cool ( int  t)
static

Definition at line 108 of file tlayout.c.

References T_maxIters, and T_T0.

◆ doNeighbor()

static void doNeighbor ( Grid grid,
int  i,
int  j,
node_list nodes 
)
static

Definition at line 244 of file tlayout.c.

References dist2(), doRep(), findGrid(), gLength(), grid, ND_pos, _node_list::next, _node_list::node, cell::nodes, T_Cell, and Verbose.

Referenced by gridRepulse().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ doRep()

static void doRep ( node_t p,
node_t q,
double  xdelta,
double  ydelta,
double  dist2 
)
static

Definition at line 208 of file tlayout.c.

References dist(), dist2(), T_K, and T_useNew.

Referenced by applyRep(), and doNeighbor().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fdp_initParams()

void fdp_initParams ( graph_t g)

Definition at line 168 of file tlayout.c.

References agattr(), agnameof(), AGRAPH, agwarningf(), D_C, D_K, D_numIters, D_T0, D_Tfact, D_unscaled, D_useGrid, D_useNew, DFLT_Cell, DFLT_K, DFLT_maxIters, DFLT_seed, DFLT_smode, INIT_SELF, late_double(), late_int(), NULL, setSeed(), T_C, T_Cell, T_K, T_maxIters, T_numIters, T_pass1, T_seed, T_smode, T_T0, T_Tfact, T_unscaled, T_useGrid, T_useNew, and Verbose.

Referenced by fdp_init_graph().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fdp_tLayout()

void fdp_tLayout ( graph_t g,
xparams xpms 
)

Definition at line 614 of file tlayout.c.

References adjust, adjustGrid(), agfstnode(), agnnodes(), agnxtnode(), cool, delGrid(), gAdjust(), grid, init_params(), initPositions(), mkGrid(), ND_pos, reset(), reset_params(), T_loopcnt, T_T0, T_useGrid, pointf_s::x, and pointf_s::y.

Referenced by layout().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gAdjust()

static void gAdjust ( Agraph_t g,
double  temp,
bport_t *  pp,
Grid grid 
)
static

Definition at line 387 of file tlayout.c.

References addGrid(), agfstnode(), agfstout(), aghead, agnxtnode(), agnxtout(), applyAttr(), clearGrid(), FLOOR, grid, gridRepulse(), ND_pos, T_Cell, updatePos(), and walkGrid().

Referenced by fdp_tLayout().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gridRepulse()

static int gridRepulse ( cell cellp,
Grid grid 
)
static

Definition at line 275 of file tlayout.c.

References applyRep(), doNeighbor(), gLength(), grid, gridpt::i, gridpt::j, _node_list::next, _node_list::node, cell::nodes, cell::p, and Verbose.

Referenced by gAdjust().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ init_params()

static int init_params ( graph_t g,
xparams xpms 
)
static

Definition at line 127 of file tlayout.c.

References agnameof(), agnnodes(), xparams::C, cool, xparams::K, xparams::loopcnt, xparams::numIters, Agraph_s::root, xparams::T0, T_C, T_K, T_loopcnt, T_maxIters, T_numIters, T_pass1, T_T0, T_Tfact, and Verbose.

Referenced by fdp_tLayout().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ initPositions()

static pointf initPositions ( graph_t g,
bport_t *  pp 
)
static

Definition at line 448 of file tlayout.c.

References agfstedge(), agfstnode(), aghead, agnnodes(), agnxtedge(), agnxtnode(), agtail, alpha, cnt(), drand48(), EXPFACTOR, hasPos, INIT_RANDOM, boxf::LL, M_PI, MAX, MIN, ND_pinned, ND_pos, NULL, P_SET, srand48, T_Ht, T_K, T_seed, T_smode, T_Wd, boxf::UR, pointf_s::x, and pointf_s::y.

Referenced by fdp_tLayout().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ reset_params()

static void reset_params ( void  )
static

Definition at line 115 of file tlayout.c.

References T_T0.

Referenced by fdp_tLayout().

Here is the caller graph for this function:

◆ updatePos()

static void updatePos ( Agraph_t g,
double  temp,
bport_t *  pp 
)
static

Definition at line 337 of file tlayout.c.

References agfstnode(), agnxtnode(), dx, dy, ND_pinned, ND_pos, P_FIX, T_Ht, and T_Wd.

Referenced by adjust(), and gAdjust().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ parms

parms_t parms
static

Definition at line 82 of file tlayout.c.

Referenced by create_hierarchy(), makeHier(), positionAllItems(), and set_active_levels().