Graphviz 12.0.1~dev.20240716.0800
Loading...
Searching...
No Matches
circpos.c File Reference
#include "config.h"
#include <cgraph/alloc.h>
#include <circogen/blockpath.h>
#include <circogen/circpos.h>
#include <circogen/nodelist.h>
#include <math.h>
#include <stddef.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 426 of file circpos.c.

References doBlock(), and state.

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 398 of file circpos.c.

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

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 310 of file circpos.c.

References applyDelta(), CHILD, block::children, delta, blocklist_t::first, free(), getInfo(), gv_calloc(), ISPARENT, M_PI, posinfo_t::n, positionChildren(), block::radius, posinfo_t::scale, SET_COALESCED, setInfo(), state, 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 216 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 204 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: