Graphviz 12.0.1~dev.20240716.0800
Loading...
Searching...
No Matches
xlayout.c File Reference
#include <cgraph/gv_ctype.h>
#include <fdpgen/xlayout.h>
#include <neatogen/adjust.h>
#include <fdpgen/dbg.h>
#include <math.h>
Include dependency graph for xlayout.c:

Go to the source code of this file.

Macros

#define FDP_PRIVATE   1
 
#define BOX   /* Use bbox to determine overlap, else use circles */
 
#define DFLT_overlap   "9:prism" /* default overlap value */
 
#define WD2(n)   (X_marg.doAdd ? (ND_width(n)/2.0 + X_marg.x): ND_width(n)*X_marg.x/2.0)
 
#define HT2(n)   (X_marg.doAdd ? (ND_height(n)/2.0 + X_marg.y): ND_height(n)*X_marg.y/2.0)
 
#define X_T0   xParams.T0
 
#define X_K   xParams.K
 
#define X_numIters   xParams.numIters
 
#define X_loopcnt   xParams.loopcnt
 
#define X_C   xParams.C
 
#define EPSILON   0.01
 

Functions

static double RAD (Agnode_t *n)
 
static void xinit_params (graph_t *g, int n, xparams *xpms)
 
static double cool (int t)
 
static int overlap (node_t *p, node_t *q)
 
static int cntOverlaps (graph_t *g)
 
static int doRep (node_t *p, node_t *q, double xdelta, double ydelta, double dist2)
 
static int applyRep (Agnode_t *p, Agnode_t *q)
 
static void applyAttr (Agnode_t *p, Agnode_t *q)
 
static int adjust (Agraph_t *g, double temp)
 
static int x_layout (graph_t *g, xparams *pxpms, int tries)
 
void fdp_xLayout (graph_t *g, xparams *xpms)
 

Variables

static xparams xParams
 
static double K2
 
static expand_t X_marg
 
static double X_nonov
 
static double X_ov
 

Macro Definition Documentation

◆ BOX

#define BOX   /* Use bbox to determine overlap, else use circles */

Definition at line 38 of file xlayout.c.

◆ DFLT_overlap

#define DFLT_overlap   "9:prism" /* default overlap value */

Definition at line 40 of file xlayout.c.

◆ EPSILON

#define EPSILON   0.01

Definition at line 111 of file xlayout.c.

◆ FDP_PRIVATE

#define FDP_PRIVATE   1

Definition at line 25 of file xlayout.c.

◆ HT2

#define HT2 (   n)    (X_marg.doAdd ? (ND_height(n)/2.0 + X_marg.y): ND_height(n)*X_marg.y/2.0)

Definition at line 43 of file xlayout.c.

◆ WD2

#define WD2 (   n)    (X_marg.doAdd ? (ND_width(n)/2.0 + X_marg.x): ND_width(n)*X_marg.x/2.0)

Definition at line 42 of file xlayout.c.

◆ X_C

#define X_C   xParams.C

Definition at line 103 of file xlayout.c.

◆ X_K

#define X_K   xParams.K

Definition at line 100 of file xlayout.c.

◆ X_loopcnt

#define X_loopcnt   xParams.loopcnt

Definition at line 102 of file xlayout.c.

◆ X_numIters

#define X_numIters   xParams.numIters

Definition at line 101 of file xlayout.c.

◆ X_T0

#define X_T0   xParams.T0

Definition at line 99 of file xlayout.c.

Function Documentation

◆ adjust()

static int adjust ( Agraph_t g,
double  temp 
)
static

Definition at line 379 of file xlayout.c.

References agfstnode(), agfstout(), aghead, agnxtnode(), agnxtout(), applyAttr(), applyRep(), len(), ND_pinned, ND_pos, overlaps(), P_PIN, and Verbose.

Here is the call graph for this function:

◆ applyAttr()

static void applyAttr ( Agnode_t p,
Agnode_t q 
)
static

Definition at line 321 of file xlayout.c.

References dist(), ND_pos, overlap(), RAD(), Verbose, and X_K.

Referenced by adjust().

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

◆ applyRep()

static int applyRep ( Agnode_t p,
Agnode_t q 
)
static

Definition at line 312 of file xlayout.c.

References doRep(), and ND_pos.

Referenced by adjust().

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

◆ cntOverlaps()

static int cntOverlaps ( graph_t g)
static

Definition at line 235 of file xlayout.c.

References agfstnode(), agnxtnode(), cnt(), and overlap().

Referenced by x_layout().

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 106 of file xlayout.c.

References X_numIters, and X_T0.

◆ doRep()

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

Definition at line 253 of file xlayout.c.

References dist(), dist2(), EPSILON, K2, overlap(), RAD(), Verbose, X_C, X_K, X_nonov, and X_ov.

Referenced by applyRep().

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

◆ fdp_xLayout()

void fdp_xLayout ( graph_t g,
xparams xpms 
)

Definition at line 515 of file xlayout.c.

References agget(), DFLT_overlap, gv_isdigit(), removeOverlapAs(), Verbose, and x_layout().

Referenced by layout().

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

◆ overlap()

static int overlap ( node_t p,
node_t q 
)
static

Definition at line 210 of file xlayout.c.

References dist2(), HT2, ND_pos, RAD(), and WD2.

Referenced by applyAttr(), cntOverlaps(), and doRep().

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

◆ RAD()

static double RAD ( Agnode_t n)
static

Definition at line 64 of file xlayout.c.

References HT2, and WD2.

Referenced by applyAttr(), doRep(), and overlap().

Here is the caller graph for this function:

◆ x_layout()

static int x_layout ( graph_t g,
xparams pxpms,
int  tries 
)
static

Definition at line 445 of file xlayout.c.

References adjust, agnedges(), agnnodes(), agroot(), cntOverlaps(), cool, expand_t::doAdd, xparams::K, K2, nedges, PS2INCH, sepFactor(), Verbose, expand_t::x, X_C, X_loopcnt, X_marg, X_nonov, X_ov, xinit_params(), and expand_t::y.

Referenced by fdp_xLayout().

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

◆ xinit_params()

static void xinit_params ( graph_t g,
int  n,
xparams xpms 
)
static

Definition at line 74 of file xlayout.c.

References agroot(), xparams::C, xparams::K, K2, xparams::loopcnt, xparams::numIters, xparams::T0, Verbose, and xParams.

Referenced by x_layout().

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

Variable Documentation

◆ K2

double K2
static

Definition at line 52 of file xlayout.c.

Referenced by doRep(), x_layout(), and xinit_params().

◆ X_marg

expand_t X_marg
static

Definition at line 53 of file xlayout.c.

Referenced by x_layout().

◆ X_nonov

double X_nonov
static

Definition at line 54 of file xlayout.c.

Referenced by doRep(), and x_layout().

◆ X_ov

double X_ov
static

Definition at line 55 of file xlayout.c.

Referenced by doRep(), and x_layout().

◆ xParams

xparams xParams
static
Initial value:
= {
60,
0.0,
0.3,
1.5,
0
}

Definition at line 45 of file xlayout.c.

Referenced by xinit_params().