Graphviz 13.0.0~dev.20241220.2304
Loading...
Searching...
No Matches
circle.c File Reference
#include <assert.h>
#include <cgraph/list.h>
#include <twopigen/circle.h>
#include <inttypes.h>
#include <limits.h>
#include <math.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <util/alloc.h>
#include <util/gv_ctype.h>
#include <util/gv_math.h>
#include <util/streq.h>
Include dependency graph for circle.c:

Go to the source code of this file.

Macros

#define DEF_RANKSEP   1.00
 
#define UNSET   10.00
 

Functions

static void setNStepsToLeaf (Agraph_t *g, Agnode_t *n, Agnode_t *prev)
 
static bool isLeaf (Agraph_t *g, Agnode_t *n)
 
static void initLayout (Agraph_t *g)
 
static Agnode_tfindCenterNode (Agraph_t *g)
 
static void setNStepsToCenter (Agraph_t *g, Agnode_t *n)
 
static uint64_t setParentNodes (Agraph_t *sg, Agnode_t *center)
 
static void setSubtreeSize (Agraph_t *g)
 
static void setChildSubtreeSpans (Agraph_t *g, Agnode_t *n)
 
static void setSubtreeSpans (Agraph_t *sg, Agnode_t *center)
 
static bool is_set (double a)
 has the given value been assigned?
 
static void setChildPositions (Agraph_t *sg, Agnode_t *n)
 
static void setPositions (Agraph_t *sg, Agnode_t *center)
 
static double * getRankseps (Agraph_t *g, uint64_t maxrank)
 
static void setAbsolutePos (Agraph_t *g, uint64_t maxrank)
 
Agnode_tcircleLayout (Agraph_t *sg, Agnode_t *center)
 

Macro Definition Documentation

◆ DEF_RANKSEP

#define DEF_RANKSEP   1.00

Definition at line 25 of file circle.c.

◆ UNSET

#define UNSET   10.00

Definition at line 26 of file circle.c.

Function Documentation

◆ circleLayout()

Agnode_t * circleLayout ( Agraph_t sg,
Agnode_t center 
)

Definition at line 312 of file circle.c.

References agerrorf(), agfstnode(), agnameof(), agnnodes(), center(), findCenterNode(), initLayout(), ND_pos, setAbsolutePos(), setParentNodes(), setPositions(), setSubtreeSize(), setSubtreeSpans(), and Verbose.

Referenced by twopi_layout().

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

◆ findCenterNode()

static Agnode_t * findCenterNode ( Agraph_t g)
static

Definition at line 96 of file circle.c.

References agfstnode(), agnxtnode(), center(), NULL, setNStepsToLeaf(), and SLEAF.

Referenced by circleLayout().

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

◆ getRankseps()

static double * getRankseps ( Agraph_t g,
uint64_t  maxrank 
)
static

Definition at line 257 of file circle.c.

References agfindgraphattr, DEF_RANKSEP, gv_calloc(), gv_isspace(), late_string(), MIN_RANKSEP, NULL, and Agraph_s::root.

Referenced by setAbsolutePos().

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

◆ initLayout()

static void initLayout ( Agraph_t g)
static

Definition at line 74 of file circle.c.

References agfstnode(), agnnodes(), agnxtnode(), INF, isLeaf(), SCENTER, SLEAF, THETA, and UNSET.

Referenced by circleLayout().

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

◆ is_set()

static bool is_set ( double  a)
static

Definition at line 214 of file circle.c.

References is_exactly_equal(), and UNSET.

Referenced by setChildPositions().

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

◆ isLeaf()

static bool isLeaf ( Agraph_t g,
Agnode_t n 
)
static

Definition at line 55 of file circle.c.

References agfstedge(), aghead, agnxtedge(), and agtail.

Referenced by initLayout().

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

◆ setAbsolutePos()

static void setAbsolutePos ( Agraph_t g,
uint64_t  maxrank 
)
static

Definition at line 288 of file circle.c.

References agfstnode(), agnxtnode(), free(), getRankseps(), ND_pos, SCENTER, THETA, and Verbose.

Referenced by circleLayout().

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

◆ setChildPositions()

static void setChildPositions ( Agraph_t sg,
Agnode_t n 
)
static

Definition at line 217 of file circle.c.

References agfstedge(), aghead, agnxtedge(), agtail, is_set(), NCHILD, setChildPositions(), SPAN, SPARENT, and THETA.

Referenced by setChildPositions(), and setPositions().

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

◆ setChildSubtreeSpans()

static void setChildSubtreeSpans ( Agraph_t g,
Agnode_t n 
)
static

Definition at line 186 of file circle.c.

References agfstedge(), aghead, agnxtedge(), agtail, NCHILD, setChildSubtreeSpans(), SPAN, SPARENT, and STSIZE.

Referenced by setChildSubtreeSpans(), and setSubtreeSpans().

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

◆ setNStepsToCenter()

static void setNStepsToCenter ( Agraph_t g,
Agnode_t n 
)
static

Definition at line 119 of file circle.c.

References ag_xget, agfindedgeattr, agfstedge(), aghead, agnxtedge(), agtail, NCHILD, SCENTER, SPARENT, and streq().

Referenced by setParentNodes().

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

◆ setNStepsToLeaf()

static void setNStepsToLeaf ( Agraph_t g,
Agnode_t n,
Agnode_t prev 
)
static

Definition at line 32 of file circle.c.

References agfstedge(), aghead, agnxtedge(), agtail, prev, setNStepsToLeaf(), and SLEAF.

Referenced by findCenterNode(), and setNStepsToLeaf().

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

◆ setParentNodes()

static uint64_t setParentNodes ( Agraph_t sg,
Agnode_t center 
)
static

Definition at line 149 of file circle.c.

References agfstnode(), agnxtnode(), center(), SCENTER, setNStepsToCenter(), and SPARENT.

Referenced by circleLayout().

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

◆ setPositions()

static void setPositions ( Agraph_t sg,
Agnode_t center 
)
static

Definition at line 243 of file circle.c.

References center(), setChildPositions(), and THETA.

Referenced by circleLayout().

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

◆ setSubtreeSize()

static void setSubtreeSize ( Agraph_t g)
static

Definition at line 174 of file circle.c.

References agfstnode(), agnxtnode(), NCHILD, parent, SPARENT, and STSIZE.

Referenced by circleLayout().

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

◆ setSubtreeSpans()

static void setSubtreeSpans ( Agraph_t sg,
Agnode_t center 
)
static

Definition at line 207 of file circle.c.

References center(), M_PI, setChildSubtreeSpans(), and SPAN.

Referenced by circleLayout().

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