Graphviz 13.0.0~dev.20241220.2304
Loading...
Searching...
No Matches
circpos.c File Reference
#include "config.h"
#include <circogen/blockpath.h>
#include <circogen/circpos.h>
#include <circogen/nodelist.h>
#include <math.h>
#include <stddef.h>
#include <util/alloc.h>
Include dependency graph for circpos.c:

Go to the source code of this file.

Data Structures

struct  posstate
 
struct  posinfo_t
 

Functions

static double getRotation (block_t *sn, double x, double y, double theta)
 
static void applyDelta (block_t *sn, double x, double y, double rotate)
 
static double getInfo (posinfo_t *pi, posstate *stp, double min_dist)
 get size info for blocks attached to the given node.
 
static void setInfo (posinfo_t *p0, posinfo_t *p1, double delta)
 
static void positionChildren (posinfo_t *info, posstate *stp, size_t length, double min_dist)
 
static double position (size_t childCount, size_t length, nodelist_t *nodepath, block_t *sn, double min_dist)
 
static void doBlock (Agraph_t *g, block_t *sn, double min_dist, circ_state *state)
 
void circPos (Agraph_t *g, block_t *sn, circ_state *state)
 

Function Documentation

◆ applyDelta()

static void applyDelta ( block_t sn,
double  x,
double  y,
double  rotate 
)
static

Definition at line 118 of file circpos.c.

References agfstnode(), agnxtnode(), applyDelta(), block::children, blocklist_t::first, ND_pos, block::next, rotate(), block::sub_graph, X, and Y.

Referenced by applyDelta(), position(), and positionChildren().

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

◆ circPos()

void circPos ( Agraph_t g,
block_t sn,
circ_state state 
)

Definition at line 423 of file circpos.c.

References doBlock(), and circ_state::min_dist.

Referenced by circularLayout().

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

◆ doBlock()

static void doBlock ( Agraph_t g,
block_t sn,
double  min_dist,
circ_state state 
)
static

Set positions of block sn and its child blocks.

Parameters
stateContext containing a counter to use for graph copy naming

Definition at line 395 of file circpos.c.

References BLK_PARENT, block::children, block::circle_list, doBlock(), blocklist_t::first, layout_block(), M_PI, block::next, and block::parent_pos.

Referenced by circPos(), and doBlock().

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

◆ getInfo()

static double getInfo ( posinfo_t pi,
posstate stp,
double  min_dist 
)
static

Definition at line 179 of file circpos.c.

References BLK_PARENT, posinfo_t::childCount, posstate::cp, posinfo_t::diameter, posinfo_t::maxRadius, posinfo_t::minRadius, posinfo_t::n, block::next, block::radius, and posstate::radius.

Referenced by position().

Here is the caller graph for this function:

◆ getRotation()

static double getRotation ( block_t sn,
double  x,
double  y,
double  theta 
)
static

Definition at line 49 of file circpos.c.

References agfstnode(), agnxtnode(), CHILD, block::circle_list, COALESCED, LEN2, M_PI, ND_pos, neighbor, block::parent_pos, PSI, block::rad0, block::radius, and block::sub_graph.

Referenced by positionChildren().

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

◆ position()

static double position ( size_t  childCount,
size_t  length,
nodelist_t *  nodepath,
block_t sn,
double  min_dist 
)
static

Definition at line 307 of file circpos.c.

References applyDelta(), CHILD, block::children, posstate::cp, delta, blocklist_t::first, posstate::firstAngle, free(), getInfo(), gv_calloc(), ISPARENT, posstate::lastAngle, M_PI, posinfo_t::n, posstate::neighbor, posstate::nodeAngle, positionChildren(), block::radius, posstate::radius, posinfo_t::scale, SET_COALESCED, setInfo(), posstate::subtreeR, and posinfo_t::theta.

Here is the call graph for this function:

◆ positionChildren()

static void positionChildren ( posinfo_t info,
posstate stp,
size_t  length,
double  min_dist 
)
static

Definition at line 214 of file circpos.c.

References applyDelta(), BLK_PARENT, block::circle_list, cnt(), posstate::cp, posstate::firstAngle, getRotation(), posstate::lastAngle, M_PI, posstate::neighbor, block::next, PSI, block::radius, and posstate::subtreeR.

Referenced by position().

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

◆ setInfo()

static void setInfo ( posinfo_t p0,
posinfo_t p1,
double  delta 
)
static

Definition at line 202 of file circpos.c.

References delta, posinfo_t::diameter, posinfo_t::minRadius, and posinfo_t::scale.

Referenced by position().

Here is the caller graph for this function: