Graphviz 12.0.1~dev.20240716.0800
Loading...
Searching...
No Matches
position.c File Reference
#include <common/geomprocs.h>
#include <cgraph/alloc.h>
#include <cgraph/gv_math.h>
#include <dotgen/dot.h>
#include <dotgen/aspect.h>
#include <math.h>
#include <stdbool.h>
#include <stdlib.h>
Include dependency graph for position.c:

Go to the source code of this file.

Functions

static int nsiter2 (graph_t *g)
 
static void create_aux_edges (graph_t *g)
 
static void remove_aux_edges (graph_t *g)
 
static void set_xcoords (graph_t *g)
 Set x coords of nodes.
 
static void set_ycoords (graph_t *g)
 
static void set_aspect (graph_t *g)
 
static void expand_leaves (graph_t *g)
 
static void make_lrvn (graph_t *g)
 
static void contain_nodes (graph_t *g)
 
static bool idealsize (graph_t *g, double)
 
static double largeMinlen (double l)
 
static void connectGraph (graph_t *g)
 
void dot_position (graph_t *g)
 
static bool go (node_t *u, node_t *v)
 
static bool canreach (node_t *u, node_t *v)
 
edge_tmake_aux_edge (node_t *u, node_t *v, double len, int wt)
 
static void allocate_aux_edges (graph_t *g)
 
static void make_LR_constraints (graph_t *g)
 
static void make_edge_pairs (graph_t *g)
 make virtual edge pairs corresponding to input edges
 
static void contain_clustnodes (graph_t *g)
 
static bool vnode_not_related_to (graph_t *g, node_t *v)
 
static void keepout_othernodes (graph_t *g)
 
static void contain_subclust (graph_t *g)
 
static void separate_subclust (graph_t *g)
 
static void pos_clusters (graph_t *g)
 
static void compress_graph (graph_t *g)
 
static void adjustSimple (graph_t *g, double delta, int margin_total)
 
static void adjustRanks (graph_t *g, int margin_total)
 
static int clust_ht (Agraph_t *g)
 
static void dot_compute_bb (graph_t *g, graph_t *root)
 
static void rec_bb (graph_t *g, graph_t *root)
 
static void scale_bb (graph_t *g, graph_t *root, double xf, double yf)
 
static void make_leafslots (graph_t *g)
 
int ports_eq (edge_t *e, edge_t *f)
 

Function Documentation

◆ adjustRanks()

static void adjustRanks ( graph_t g,
int  margin_total 
)
static

Definition at line 628 of file position.c.

References adjustRanks(), adjustSimple(), CL_OFFSET, delta, dot_root(), G_margin, GD_border, GD_clust, GD_ht1, GD_ht2, GD_label, GD_maxrank, GD_minrank, GD_n_cluster, GD_rank, late_int(), LEFT_IX, MAX, ND_coord, rank(), and RIGHT_IX.

Referenced by adjustRanks(), and set_ycoords().

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

◆ adjustSimple()

static void adjustSimple ( graph_t g,
double  delta,
int  margin_total 
)
static

Definition at line 594 of file position.c.

References delta, dot_root(), GD_ht1, GD_ht2, GD_maxrank, GD_minrank, GD_rank, ND_coord, and rank().

Referenced by adjustRanks().

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

◆ allocate_aux_edges()

static void allocate_aux_edges ( graph_t g)
static

Definition at line 196 of file position.c.

References alloc_elist, GD_nlist, ND_in, ND_next, ND_out, ND_save_in, and ND_save_out.

Referenced by create_aux_edges().

Here is the caller graph for this function:

◆ canreach()

static bool canreach ( node_t u,
node_t v 
)
static

Definition at line 172 of file position.c.

References go().

Referenced by make_LR_constraints().

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

◆ clust_ht()

static int clust_ht ( Agraph_t g)
static

Definition at line 680 of file position.c.

References agroot(), BOTTOM_IX, CL_OFFSET, clust_ht(), dot_root(), G_margin, GD_border, GD_clust, GD_flip, GD_ht1, GD_ht2, GD_label, GD_maxrank, GD_minrank, GD_n_cluster, GD_rank, late_int(), MAX, rank(), and TOP_IX.

Referenced by clust_ht(), and set_ycoords().

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

◆ compress_graph()

static void compress_graph ( graph_t g)
static

Definition at line 501 of file position.c.

References contain_nodes(), GD_drawing, GD_flip, GD_ln, GD_rn, make_aux_edge(), MIN, R_COMPRESS, pointf_s::x, and pointf_s::y.

Referenced by create_aux_edges().

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

◆ connectGraph()

static void connectGraph ( graph_t g)
static

Definition at line 77 of file position.c.

References aghead, agtail, GD_maxrank, GD_minrank, GD_rank, make_aux_edge(), MIN, rank_t::n, ND_node_type, ND_rank, ND_save_in, ND_save_out, NULL, SLACKNODE, rank_t::v, and virtual_node().

Referenced by dot_position().

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

◆ contain_clustnodes()

static void contain_clustnodes ( graph_t g)
static

Definition at line 352 of file position.c.

References contain_clustnodes(), contain_nodes(), dot_root(), ED_weight, find_fast_edge(), GD_clust, GD_ln, GD_n_cluster, GD_rn, and make_aux_edge().

Referenced by contain_clustnodes(), and pos_clusters().

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

◆ contain_nodes()

static void contain_nodes ( graph_t g)
static

Definition at line 1084 of file position.c.

References agerrorf(), agnameof(), CL_OFFSET, G_margin, GD_border, GD_ln, GD_maxrank, GD_minrank, GD_rank, GD_rn, late_int(), LEFT_IX, make_aux_edge(), make_lrvn(), ND_lw, ND_rw, NULL, and RIGHT_IX.

Referenced by compress_graph(), and contain_clustnodes().

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

◆ contain_subclust()

static void contain_subclust ( graph_t g)
static

Definition at line 429 of file position.c.

References CL_OFFSET, contain_subclust(), G_margin, GD_border, GD_clust, GD_ln, GD_n_cluster, GD_rn, late_int(), LEFT_IX, make_aux_edge(), make_lrvn(), and RIGHT_IX.

Referenced by contain_subclust(), and pos_clusters().

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

◆ create_aux_edges()

static void create_aux_edges ( graph_t g)
static

Definition at line 525 of file position.c.

References allocate_aux_edges(), compress_graph(), make_edge_pairs(), make_LR_constraints(), and pos_clusters().

Referenced by dot_position().

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

◆ dot_compute_bb()

static void dot_compute_bb ( graph_t g,
graph_t root 
)
static

Definition at line 836 of file position.c.

References CL_OFFSET, dot_root(), GD_bb, GD_clust, GD_ht1, GD_ht2, GD_ln, GD_maxrank, GD_minrank, GD_n_cluster, GD_rank, GD_rn, MAX, MIN, ND_coord, ND_lw, ND_node_type, ND_rank, ND_rw, NORMAL, NULL, offset, pointf_s::x, and pointf_s::y.

Referenced by rec_bb().

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

◆ dot_position()

void dot_position ( graph_t g)

Definition at line 125 of file position.c.

References Concentrate, connectGraph(), create_aux_edges(), dot_concentrate(), expand_leaves(), flat_edges(), GD_nlist, mark_lowclusters(), nsiter2(), NULL, rank(), remove_aux_edges(), set_aspect(), set_xcoords(), and set_ycoords().

Referenced by dotLayout(), and make_flat_adj_edges().

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

◆ expand_leaves()

static void expand_leaves ( graph_t g)
static

Definition at line 1024 of file position.c.

References aghead, ED_to_orig, fast_edge(), GD_nlist, make_leafslots(), ND_next, ND_other, ND_rank, ports_eq(), and zapinlist().

Referenced by dot_position().

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

◆ go()

static bool go ( node_t u,
node_t v 
)
static

Definition at line 159 of file position.c.

References aghead, go(), and ND_out.

Referenced by canreach(), and go().

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

◆ idealsize()

static bool idealsize ( graph_t g,
double  minallowed 
)
static

Definition at line 1113 of file position.c.

References GD_bb, GD_drawing, MAX, MIN, sub_pointf(), pointf_s::x, and pointf_s::y.

Referenced by set_aspect().

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

◆ keepout_othernodes()

static void keepout_othernodes ( graph_t g)
static

Definition at line 390 of file position.c.

References CL_OFFSET, dot_root(), G_margin, GD_clust, GD_ln, GD_maxrank, GD_minrank, GD_n_cluster, GD_rank, GD_rn, keepout_othernodes(), late_int(), make_aux_edge(), ND_lw, ND_node_type, ND_order, ND_rw, NORMAL, NULL, and vnode_not_related_to().

Referenced by keepout_othernodes(), and pos_clusters().

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

◆ largeMinlen()

static double largeMinlen ( double  l)
static

Definition at line 62 of file position.c.

References agerrorf().

Referenced by make_aux_edge().

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

◆ make_aux_edge()

edge_t * make_aux_edge ( node_t u,
node_t v,
double  len,
int  wt 
)

Definition at line 176 of file position.c.

References aghead, AGINEDGE, AGOUTEDGE, agtail, AGTYPE, Agedge_s::base, Agobj_s::data, ED_minlen, ED_weight, fast_edge(), gv_alloc(), Agedgepair_s::in, largeMinlen(), len(), Agedgepair_s::out, and ROUND.

Referenced by compress_graph(), connectGraph(), contain_clustnodes(), contain_nodes(), contain_subclust(), interclust1(), keepout_othernodes(), make_edge_pairs(), make_LR_constraints(), make_lrvn(), and separate_subclust().

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

◆ make_edge_pairs()

static void make_edge_pairs ( graph_t g)
static

Definition at line 325 of file position.c.

References aghead, agtail, ED_head_port, ED_tail_port, ED_weight, GD_nlist, make_aux_edge(), MIN, ND_next, ND_node_type, ND_rank, ND_save_out, SLACKNODE, and virtual_node().

Referenced by create_aux_edges().

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

◆ make_leafslots()

static void make_leafslots ( graph_t g)
static

Definition at line 984 of file position.c.

References free(), GD_maxrank, GD_minrank, GD_rank, gv_calloc(), LEAFSET, ND_order, ND_ranktype, ND_UF_size, and NULL.

Referenced by expand_leaves().

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

◆ make_LR_constraints()

static void make_LR_constraints ( graph_t g)
static

Definition at line 214 of file position.c.

References aghead, agtail, canreach(), ED_dist, ED_label, ED_minlen, ED_weight, EDGE_LABEL, find_fast_edge(), GD_has_labels, GD_maxrank, GD_minrank, GD_nodesep, GD_rank, last, make_aux_edge(), MAX, ND_alg, ND_flat_out, ND_lw, ND_mval, ND_order, ND_other, ND_rank, ND_rw, ND_save_out, rank(), Agraph_s::root, ROUND, and selfRightSpace().

Referenced by create_aux_edges().

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

◆ make_lrvn()

static void make_lrvn ( graph_t g)
static

Definition at line 1061 of file position.c.

References agroot(), BOTTOM_IX, dot_root(), GD_border, GD_flip, GD_label, GD_ln, GD_rn, make_aux_edge(), MAX, ND_node_type, SLACKNODE, TOP_IX, and virtual_node().

Referenced by contain_nodes(), contain_subclust(), and separate_subclust().

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

◆ nsiter2()

static int nsiter2 ( graph_t g)
static

Definition at line 149 of file position.c.

References agget(), agnnodes(), and scale_clamp().

Referenced by dot_position().

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

◆ ports_eq()

int ports_eq ( edge_t e,
edge_t f 
)

Definition at line 1013 of file position.c.

References ED_head_port, and ED_tail_port.

Referenced by class2(), expand_leaves(), map_path(), and mergeable().

Here is the caller graph for this function:

◆ pos_clusters()

static void pos_clusters ( graph_t g)
static

Definition at line 491 of file position.c.

References contain_clustnodes(), contain_subclust(), GD_n_cluster, keepout_othernodes(), and separate_subclust().

Referenced by create_aux_edges().

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

◆ rec_bb()

static void rec_bb ( graph_t g,
graph_t root 
)
static

Definition at line 883 of file position.c.

References dot_compute_bb(), GD_clust, GD_n_cluster, and rec_bb().

Referenced by rec_bb(), and set_aspect().

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

◆ remove_aux_edges()

static void remove_aux_edges ( graph_t g)
static

Definition at line 534 of file position.c.

References Agnode_s::base, Agedge_s::base, Agobj_s::data, free(), free_list, GD_nlist, ND_in, ND_next, ND_node_type, ND_out, ND_prev, ND_save_in, ND_save_out, NULL, and SLACKNODE.

Referenced by dot_position().

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

◆ scale_bb()

static void scale_bb ( graph_t g,
graph_t root,
double  xf,
double  yf 
)
static

Definition at line 894 of file position.c.

References GD_bb, GD_clust, GD_n_cluster, and scale_bb().

Referenced by scale_bb(), and set_aspect().

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

◆ separate_subclust()

static void separate_subclust ( graph_t g)
static

Definition at line 452 of file position.c.

References CL_OFFSET, G_margin, GD_clust, GD_ln, GD_maxrank, GD_minrank, GD_n_cluster, GD_rank, GD_rn, late_int(), left, make_aux_edge(), make_lrvn(), ND_order, right, and separate_subclust().

Referenced by pos_clusters(), and separate_subclust().

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

◆ set_aspect()

static void set_aspect ( graph_t g)
static

Definition at line 910 of file position.c.

References exch_xyf(), GD_bb, GD_drawing, GD_flip, GD_maxrank, GD_nlist, idealsize(), ND_coord, ND_next, R_AUTO, R_EXPAND, R_FILL, R_VALUE, rec_bb(), scale(), scale_bb(), pointf_s::x, and pointf_s::y.

Referenced by dot_position(), and spline_edges0().

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

◆ set_xcoords()

static void set_xcoords ( graph_t g)
static

Definition at line 569 of file position.c.

References GD_maxrank, GD_minrank, GD_rank, ND_coord, ND_rank, and rank().

Referenced by dot_position().

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

◆ set_ycoords()

static void set_ycoords ( graph_t g)
static

Definition at line 728 of file position.c.

References adjustRanks(), aghead, agtail, CL_OFFSET, clust_ht(), delta, ED_label, G_margin, GD_exact_ranksep, GD_flip, GD_ht1, GD_ht2, GD_maxrank, GD_minrank, GD_nlist, GD_rank, GD_ranksep, late_int(), lbl, ND_clust, ND_coord, ND_ht, ND_next, ND_other, ND_rank, and rank().

Referenced by dot_position().

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

◆ vnode_not_related_to()

static bool vnode_not_related_to ( graph_t g,
node_t v 
)
static

Definition at line 368 of file position.c.

References agcontains(), aghead, agtail, ED_to_orig, ND_node_type, ND_save_out, and VIRTUAL.

Referenced by keepout_othernodes().

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