Graphviz 13.1.2~dev.20250807.2324
Loading...
Searching...
No Matches
hedges.c File Reference
#include <assert.h>
#include <neatogen/hedges.h>
#include <common/render.h>
#include <stdbool.h>
#include <stdlib.h>
#include <util/alloc.h>
Include dependency graph for hedges.c:

Go to the source code of this file.

Macros

#define DELETED   -2
 

Functions

void ELcleanup (el_state_t *st)
 
void ELinitialize (el_state_t *st)
 
Sitehintersect (Halfedge *el1, Halfedge *el2)
 
static int right_of (Halfedge *el, Point *p)
 
HalfedgeHEcreate (el_state_t *st, Edge *e, char pm)
 
void ELinsert (Halfedge *lb, Halfedge *new)
 
static HalfedgeELgethash (el_state_t *st, int b)
 
static int clamp (int lower, double v, int upper)
 
HalfedgeELleftbnd (el_state_t *st, Point *p)
 
void ELdelete (Halfedge *he)
 
HalfedgeELright (Halfedge *he)
 
HalfedgeELleft (Halfedge *he)
 
Siteleftreg (Halfedge *he)
 
Siterightreg (Halfedge *he)
 

Macro Definition Documentation

◆ DELETED

#define DELETED   -2

Definition at line 18 of file hedges.c.

Function Documentation

◆ clamp()

static int clamp ( int  lower,
double  v,
int  upper 
)
static

convert a double to an int, between bounds

Parameters
lowerLower bound to limit to
vValue to convert
upperUpper bound to limit to
Returns
A converted value in the range [lower, upper]

Definition at line 177 of file hedges.c.

Referenced by ELleftbnd().

Here is the caller graph for this function:

◆ ELcleanup()

void ELcleanup ( el_state_t st)

Definition at line 20 of file hedges.c.

References el_state_t::allocated, free(), el_state_t::hash, NULL, and Halfedge::previous_allocated.

Referenced by voronoi().

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

◆ ELdelete()

void ELdelete ( Halfedge he)

Definition at line 226 of file hedges.c.

References DELETED, Halfedge::ELedge, Halfedge::ELleft, and Halfedge::ELright.

Referenced by voronoi().

Here is the caller graph for this function:

◆ ELgethash()

static Halfedge * ELgethash ( el_state_t st,
int  b 
)
static

Definition at line 156 of file hedges.c.

References DELETED, Halfedge::ELedge, el_state_t::hash, el_state_t::hashsize, and NULL.

Referenced by ELleftbnd().

Here is the caller graph for this function:

◆ ELinitialize()

void ELinitialize ( el_state_t st)

Definition at line 29 of file hedges.c.

References Halfedge::ELleft, Halfedge::ELright, gv_calloc(), el_state_t::hash, el_state_t::hashsize, HEcreate(), el_state_t::leftend, NULL, el_state_t::rightend, and sqrt_nsites.

Referenced by voronoi().

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

◆ ELinsert()

void ELinsert ( Halfedge lb,
Halfedge new 
)

Definition at line 147 of file hedges.c.

References Halfedge::ELleft, and Halfedge::ELright.

Referenced by voronoi().

Here is the caller graph for this function:

◆ ELleft()

Halfedge * ELleft ( Halfedge he)

Definition at line 239 of file hedges.c.

References Halfedge::ELleft.

Referenced by voronoi().

Here is the caller graph for this function:

◆ ELleftbnd()

Halfedge * ELleftbnd ( el_state_t st,
Point p 
)

Definition at line 188 of file hedges.c.

References clamp(), deltax, ELgethash(), Halfedge::ELleft, Halfedge::ELright, el_state_t::hash, el_state_t::hashsize, el_state_t::leftend, NULL, right_of(), el_state_t::rightend, Point::x, and xmin.

Referenced by voronoi().

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

◆ ELright()

Halfedge * ELright ( Halfedge he)

Definition at line 234 of file hedges.c.

References Halfedge::ELright.

Referenced by voronoi().

Here is the caller graph for this function:

◆ HEcreate()

Halfedge * HEcreate ( el_state_t st,
Edge e,
char  pm 
)

Definition at line 135 of file hedges.c.

References el_state_t::allocated, Halfedge::ELedge, Halfedge::ELpm, gv_alloc(), NULL, Halfedge::PQnext, Halfedge::previous_allocated, and Halfedge::vertex.

Referenced by ELinitialize(), and voronoi().

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

◆ hintersect()

Site * hintersect ( Halfedge el1,
Halfedge el2 
)

Definition at line 47 of file hedges.c.

References Edge::a, Edge::b, Edge::c, Site::coord, Halfedge::ELedge, Halfedge::ELpm, getsite(), le, NULL, re, Site::refcnt, Edge::reg, Point::x, and Point::y.

Referenced by voronoi().

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

◆ leftreg()

Site * leftreg ( Halfedge he)

Definition at line 245 of file hedges.c.

References bottomsite, Halfedge::ELedge, Halfedge::ELpm, le, NULL, re, and Edge::reg.

Referenced by voronoi().

Here is the caller graph for this function:

◆ right_of()

static int right_of ( Halfedge el,
Point p 
)
static

Definition at line 90 of file hedges.c.

References Edge::a, Edge::b, Edge::c, coord(), Site::coord, Halfedge::ELedge, Halfedge::ELpm, le, re, Edge::reg, pointf_s::x, Point::x, and Point::y.

Referenced by ELleftbnd().

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

◆ rightreg()

Site * rightreg ( Halfedge he)

Definition at line 252 of file hedges.c.

References bottomsite, Halfedge::ELedge, Halfedge::ELpm, le, NULL, re, and Edge::reg.

Referenced by voronoi().

Here is the caller graph for this function: