Back to index

wims  3.65+svn20090927
Classes | Defines | Typedefs | Functions | Variables
vdefs.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  tagFreenode
struct  tagFreelist
struct  tagPoint
struct  tagSite
struct  tagEdge
struct  tagHalfedge

Defines

#define NULL   0
#define DELETED   -2
#define le   0
#define re   1

Typedefs

typedef struct tagFreenode Freenode
typedef struct tagFreelist Freelist
typedef struct tagPoint Point
typedef struct tagSite Site
typedef struct tagEdge Edge
typedef struct tagHalfedge Halfedge

Functions

void ELinitialize (void)
HalfedgeHEcreate (Edge *, int)
void ELinsert (Halfedge *, Halfedge *)
HalfedgeELgethash (int)
HalfedgeELleftbnd (Point *)
void ELdelete (Halfedge *)
HalfedgeELright (Halfedge *)
HalfedgeELleft (Halfedge *)
Siteleftreg (Halfedge *)
Siterightreg (Halfedge *)
void geominit (void)
Edgebisect (Site *, Site *)
Siteintersect (Halfedge *, Halfedge *)
int right_of (Halfedge *, Point *)
void endpoint (Edge *, int, Site *)
float dist (Site *, Site *)
void makevertex (Site *)
void deref (Site *)
void ref (Site *)
void PQinsert (Halfedge *, Site *, float)
void PQdelete (Halfedge *)
int PQbucket (Halfedge *)
int PQempty (void)
Point PQ_min (void)
HalfedgePQextractmin (void)
void PQinitialize (void)
int getopt (int, char *const *, const char *)
void freeinit (Freelist *, int)
char * getfree (Freelist *)
void makefree (Freenode *, Freelist *)
char * myalloc (unsigned)
void openpl (void)
void line (float, float, float, float)
void circle (float, float, float)
void range (float, float, float, float)
void out_bisector (Edge *)
void out_ep (Edge *)
void out_vertex (Site *)
void out_site (Site *)
void out_triple (Site *, Site *, Site *)
void plotinit (void)
void clip_line (Edge *)
void voronoi (Site *(*)())

Variables

int ELhashsize
Sitebottomsite
Freelist hfl
HalfedgeELleftend
HalfedgeELrightend
Halfedge ** ELhash
float deltax
float deltay
int nsites
int nedges
int sqrt_nsites
int nvertices
Freelist sfl
Freelist efl
int PQmin
int PQcount
int PQhashsize
HalfedgePQhash
int sorted
int triangulate
int plot
int debug
int siteidx
float xmin
float xmax
float ymin
float ymax
Sitesites

Class Documentation

struct tagFreenode

Definition at line 10 of file vdefs.h.

Collaboration diagram for tagFreenode:
Class Members
struct tagFreenode * nextfree
struct tagFreelist

Definition at line 16 of file vdefs.h.

Collaboration diagram for tagFreelist:
Class Members
Freenode * head
int nodesize
struct tagPoint

Definition at line 22 of file vdefs.h.

Class Members
float x
float y
struct tagSite

Definition at line 30 of file vdefs.h.

Collaboration diagram for tagSite:
Class Members
Point coord
int refcnt
int sitenbr
struct tagEdge

Definition at line 38 of file vdefs.h.

Collaboration diagram for tagEdge:
Class Members
float a
float b
float c
int edgenbr
Site * ep
Site * reg
struct tagHalfedge

Definition at line 49 of file vdefs.h.

Collaboration diagram for tagHalfedge:
Class Members
Edge * ELedge
struct tagHalfedge * ELleft
char ELpm
int ELrefcnt
struct tagHalfedge * ELright
struct tagHalfedge * PQnext
Site * vertex
float ystar

Define Documentation

#define DELETED   -2

Definition at line 8 of file vdefs.h.

#define le   0

Definition at line 46 of file vdefs.h.

#define NULL   0

Definition at line 5 of file vdefs.h.

#define re   1

Definition at line 47 of file vdefs.h.


Typedef Documentation

typedef struct tagEdge Edge
typedef struct tagFreelist Freelist
typedef struct tagFreenode Freenode
typedef struct tagHalfedge Halfedge
typedef struct tagPoint Point
typedef struct tagSite Site

Function Documentation

Edge* bisect ( Site ,
Site  
)

Definition at line 22 of file geometry.c.

    {
    float dx, dy, adx, ady ;
    Edge * newedge ;

    newedge = (Edge *)getfree(&efl) ;
    newedge->reg[0] = s1 ;
    newedge->reg[1] = s2 ;
    ref(s1) ;
    ref(s2) ;
    newedge->ep[0] = newedge->ep[1] = (Site *)NULL ;
    dx = s2->coord.x - s1->coord.x ;
    dy = s2->coord.y - s1->coord.y ;
    adx = dx>0 ? dx : -dx ;
    ady = dy>0 ? dy : -dy ;
    newedge->c = s1->coord.x * dx + s1->coord.y * dy + (dx*dx +
dy*dy) * 0.5 ;
    if (adx > ady)
        {
        newedge->a = 1.0 ;
        newedge->b = dy/dx ;
        newedge->c /= dx ;
        }
    else
        {
        newedge->b = 1.0 ;
        newedge->a = dx/dy ;
        newedge->c /= dy ;
        }
    newedge->edgenbr = nedges ;
    out_bisector(newedge) ;
    nedges++ ;
    return (newedge) ;
    }

Here is the call graph for this function:

Here is the caller graph for this function:

void circle ( float  ,
float  ,
float   
)

Definition at line 27 of file output.c.

    {
    }

Here is the caller graph for this function:

void clip_line ( Edge )

Definition at line 133 of file output.c.

    {
    Site * s1, * s2 ;
    float x1, x2, y1, y2 ;

    if (e->a == 1.0 && e->b >= 0.0)
        {
        s1 = e->ep[1] ;
        s2 = e->ep[0] ;
        }
    else
        {
        s1 = e->ep[0] ;
        s2 = e->ep[1] ;
        }
    if (e->a == 1.0)
        {
        y1 = pymin ;
        if (s1 != (Site *)NULL && s1->coord.y > pymin)
            {
             y1 = s1->coord.y ;
             }
        if (y1 > pymax)
            {
            return ;
            }
        x1 = e->c - e->b * y1 ;
        y2 = pymax ;
        if (s2 != (Site *)NULL && s2->coord.y < pymax)
            {
            y2 = s2->coord.y ;
            }
        if (y2 < pymin)
            {
            return ;
            }
        x2 = e->c - e->b * y2 ;
        if (((x1 > pxmax) && (x2 > pxmax)) || ((x1 < pxmin) && (x2 < pxmin)))
            {
            return ;
            }
        if (x1 > pxmax)
            {
            x1 = pxmax ;
            y1 = (e->c - x1) / e->b ;
            }
        if (x1 < pxmin)
            {
            x1 = pxmin ;
            y1 = (e->c - x1) / e->b ;
            }
        if (x2 > pxmax)
            {
            x2 = pxmax ;
            y2 = (e->c - x2) / e->b ;
            }
        if (x2 < pxmin)
            {
            x2 = pxmin ;
            y2 = (e->c - x2) / e->b ;
            }
        }
    else
        {
        x1 = pxmin ;
        if (s1 != (Site *)NULL && s1->coord.x > pxmin)
            {
            x1 = s1->coord.x ;
            }
        if (x1 > pxmax)
            {
            return ;
            }
        y1 = e->c - e->a * x1 ;
        x2 = pxmax ;
        if (s2 != (Site *)NULL && s2->coord.x < pxmax)
            {
            x2 = s2->coord.x ;
            }
        if (x2 < pxmin)
            {
            return ;
            }
        y2 = e->c - e->a * x2 ;
        if (((y1 > pymax) && (y2 > pymax)) || ((y1 < pymin) && (y2 <pymin)))
            {
            return ;
            }
        if (y1> pymax)
            {
            y1 = pymax ;
            x1 = (e->c - y1) / e->a ;
            }
        if (y1 < pymin)
            {
            y1 = pymin ;
            x1 = (e->c - y1) / e->a ;
            }
        if (y2 > pymax)
            {
            y2 = pymax ;
            x2 = (e->c - y2) / e->a ;
            }
        if (y2 < pymin)
            {
            y2 = pymin ;
            x2 = (e->c - y2) / e->a ;
            }
        }
    line(x1,y1,x2,y2);
    }

Here is the call graph for this function:

Here is the caller graph for this function:

void deref ( Site )

Definition at line 208 of file geometry.c.

    {
    if (--(v->refcnt) == 0 )
        {
        makefree((Freenode *)v, (Freelist *)&sfl) ;
        }
    }

Here is the call graph for this function:

Here is the caller graph for this function:

float dist ( Site ,
Site  
)

Definition at line 191 of file geometry.c.

    {
    float dx,dy ;

    dx = s->coord.x - t->coord.x ;
    dy = s->coord.y - t->coord.y ;
    return (sqrt(dx*dx + dy*dy)) ;
    }
void ELdelete ( Halfedge )

Definition at line 148 of file edgelist.c.

    {
    (he->ELleft)->ELright = he->ELright ;
    (he->ELright)->ELleft = he->ELleft ;
    he->ELedge = (Edge *)DELETED ;
    }

Here is the call graph for this function:

Here is the caller graph for this function:

Halfedge* ELgethash ( int  )

Definition at line 61 of file edgelist.c.

    {
    Halfedge * he ;

    if ((b < 0) || (b >= ELhashsize))
        {
        return ((Halfedge *)NULL) ;
        }
    he = ELhash[b] ;
    if ((he == (Halfedge *)NULL) || (he->ELedge != (Edge *)DELETED))
        {
        return (he) ;
        }
    /* Hash table points to deleted half edge.  Patch as necessary. */
    ELhash[b] = (Halfedge *)NULL ;
    if ((--(he->ELrefcnt)) == 0)
        {
        makefree((Freenode *)he, (Freelist *)&hfl) ;
        }
    return ((Halfedge *)NULL) ;
    }

Here is the call graph for this function:

Here is the caller graph for this function:

void ELinitialize ( void  )

Definition at line 14 of file edgelist.c.

    {
    int i ;

    freeinit(&hfl, sizeof(Halfedge)) ;
    ELhashsize = 2 * sqrt_nsites ;
    ELhash = (Halfedge **)myalloc( sizeof(*ELhash) * ELhashsize) ;
    for (i = 0  ; i < ELhashsize  ; i++)
        {
        ELhash[i] = (Halfedge *)NULL ;
        }
    ELleftend = HEcreate((Edge *)NULL, 0) ;
    ELrightend = HEcreate((Edge *)NULL, 0) ;
    ELleftend->ELleft = (Halfedge *)NULL ;
    ELleftend->ELright = ELrightend ;
    ELrightend->ELleft = ELleftend ;
    ELrightend->ELright = (Halfedge *)NULL ;
    ELhash[0] = ELleftend ;
    ELhash[ELhashsize-1] = ELrightend ;
    }

Here is the call graph for this function:

Here is the caller graph for this function:

void ELinsert ( Halfedge ,
Halfedge  
)

Definition at line 50 of file edgelist.c.

    {
    new->ELleft = lb ;
    new->ELright = lb->ELright ;
    (lb->ELright)->ELleft = new ;
    lb->ELright = new ;
    }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 162 of file edgelist.c.

    {
    return (he->ELleft) ;
    }

Here is the caller graph for this function:

Definition at line 84 of file edgelist.c.

    {
    int i, bucket ;
    Halfedge * he ;

    /* Use hash table to get close to desired halfedge */
    bucket = (p->x - xmin) / deltax * ELhashsize ;
    if (bucket < 0)
        {
        bucket = 0 ;
        }
    if (bucket >= ELhashsize)
        {
        bucket = ELhashsize - 1 ;
        }
    he = ELgethash(bucket) ;
    if  (he == (Halfedge *)NULL)
        {
        for (i = 1 ; 1 ; i++)
            {
            if ((he = ELgethash(bucket-i)) != (Halfedge *)NULL)
                {
                break ;
                }
            if ((he = ELgethash(bucket+i)) != (Halfedge *)NULL)
                {
                break ;
                }
            }
        totalsearch += i ;
        }
    ntry++ ;
    /* Now search linear list of halfedges for the corect one */
    if (he == ELleftend || (he != ELrightend && right_of(he,p)))
        {
        do  {
            he = he->ELright ;
            } while (he != ELrightend && right_of(he,p)) ;
        he = he->ELleft ;
        }
    else
        {
        do  {
            he = he->ELleft ;
            } while (he != ELleftend && !right_of(he,p)) ;
        }
    /*** Update hash table and reference counts ***/
    if ((bucket > 0) && (bucket < ELhashsize-1))
        {
        if (ELhash[bucket] != (Halfedge *)NULL)
            {
            (ELhash[bucket]->ELrefcnt)-- ;
            }
        ELhash[bucket] = he ;
        (ELhash[bucket]->ELrefcnt)++ ;
        }
    return (he) ;
    }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 156 of file edgelist.c.

    {
    return (he->ELright) ;
    }

Here is the caller graph for this function:

void endpoint ( Edge ,
int  ,
Site  
)

Definition at line 176 of file geometry.c.

    {
    e->ep[lr] = s ;
    ref(s) ;
    if (e->ep[re-lr] == (Site *)NULL)
        {
        return ;
        }
    out_ep(e) ;
    deref(e->reg[le]) ;
    deref(e->reg[re]) ;
    makefree((Freenode *)e, (Freelist *) &efl) ;
    }

Here is the call graph for this function:

Here is the caller graph for this function:

void freeinit ( Freelist ,
int   
)

Definition at line 12 of file memory.c.

    {
    fl->head = (Freenode *)NULL ;
    fl->nodesize = size ;
    }

Here is the caller graph for this function:

void geominit ( void  )

Definition at line 12 of file geometry.c.

    {
    freeinit(&efl, sizeof(Edge)) ;
    nvertices = nedges = 0 ;
    sqrt_nsites = sqrt(nsites+4) ;
    deltay = ymax - ymin ;
    deltax = xmax - xmin ;
    }

Here is the call graph for this function:

Here is the caller graph for this function:

char* getfree ( Freelist )

Definition at line 19 of file memory.c.

    {
    int i ;
    Freenode * t ;
    if (fl->head == (Freenode *)NULL)
        {
        t =  (Freenode *) myalloc(sqrt_nsites * fl->nodesize) ;
        for(i = 0 ; i < sqrt_nsites ; i++)
            {
            makefree((Freenode *)((char *)t+i*fl->nodesize), fl) ;
            }
        }
    t = fl->head ;
    fl->head = (fl->head)->nextfree ;
    return ((char *)t) ;
    }

Here is the call graph for this function:

Here is the caller graph for this function:

int getopt ( int  ,
char *const *  ,
const char *   
)

Here is the caller graph for this function:

Halfedge* HEcreate ( Edge ,
int   
)

Definition at line 36 of file edgelist.c.

    {
    Halfedge * answer ;

    answer = (Halfedge *)getfree(&hfl) ;
    answer->ELedge = e ;
    answer->ELpm = pm ;
    answer->PQnext = (Halfedge *)NULL ;
    answer->vertex = (Site *)NULL ;
    answer->ELrefcnt = 0 ;
    return (answer) ;
    }

Here is the call graph for this function:

Here is the caller graph for this function:

Site* intersect ( Halfedge ,
Halfedge  
)

Definition at line 58 of file geometry.c.

    {
    Edge * e1, * e2, * e ;
    Halfedge * el ;
    float d, xint, yint ;
    int right_of_site ;
    Site * v ;

    e1 = el1->ELedge ;
    e2 = el2->ELedge ;
    if ((e1 == (Edge*)NULL) || (e2 == (Edge*)NULL))
        {
        return ((Site *)NULL) ;
        }
    if (e1->reg[1] == e2->reg[1])
        {
        return ((Site *)NULL) ;
        }
    d = (e1->a * e2->b) - (e1->b * e2->a) ;
    if ((-1.0e-10 < d) && (d < 1.0e-10))
        {
        return ((Site *)NULL) ;
        }
    xint = (e1->c * e2->b - e2->c * e1->b) / d ;
    yint = (e2->c * e1->a - e1->c * e2->a) / d ;
    if ((e1->reg[1]->coord.y < e2->reg[1]->coord.y) ||
        (e1->reg[1]->coord.y == e2->reg[1]->coord.y &&
        e1->reg[1]->coord.x < e2->reg[1]->coord.x))
        {
        el = el1 ;
        e = e1 ;
        }
    else
        {
        el = el2 ;
        e = e2 ;
        }
    right_of_site = (xint >= e->reg[1]->coord.x) ;
    if ((right_of_site && (el->ELpm == le)) ||
       (!right_of_site && (el->ELpm == re)))
        {
        return ((Site *)NULL) ;
        }
    v = (Site *)getfree(&sfl) ;
    v->refcnt = 0 ;
    v->coord.x = xint ;
    v->coord.y = yint ;
    return (v) ;
    }

Here is the call graph for this function:

Here is the caller graph for this function:

Site* leftreg ( Halfedge )

Definition at line 168 of file edgelist.c.

    {
    if (he->ELedge == (Edge *)NULL)
        {
        return(bottomsite) ;
        }
    return (he->ELpm == le ? he->ELedge->reg[le] :
        he->ELedge->reg[re]) ;
    }

Here is the caller graph for this function:

void line ( float  ,
float  ,
float  ,
float   
)

Definition at line 21 of file output.c.

    {
    }

Here is the caller graph for this function:

void makefree ( Freenode ,
Freelist  
)

Definition at line 37 of file memory.c.

    {
    curr->nextfree = fl->head ;
    fl->head = curr ;
    }

Here is the caller graph for this function:

void makevertex ( Site )

Definition at line 201 of file geometry.c.

    {
    v->sitenbr = nvertices++ ;
    out_vertex(v) ;
    }

Here is the call graph for this function:

Here is the caller graph for this function:

char* myalloc ( unsigned  )

Definition at line 46 of file memory.c.

    {
    char * t ;
    if ((t=malloc(n)) == (char *) 0)
        {
        fprintf(stderr,"Insufficient memory processing site %d (%d bytes in use)\n",
        siteidx, total_alloc) ;
        exit(0) ;
        }
    total_alloc += n ;
    return (t) ;
    }

Here is the caller graph for this function:

void openpl ( void  )

Definition at line 15 of file output.c.

    {
    }

Here is the caller graph for this function:

void out_bisector ( Edge )

Definition at line 38 of file output.c.

    {
    if (triangulate && plot && !debug)
        {
        line(e->reg[0]->coord.x, e->reg[0]->coord.y,
             e->reg[1]->coord.x, e->reg[1]->coord.y) ;
        }
    if (!triangulate && !plot && !debug)
        {
        printf("l %f %f %f\n", e->a, e->b, e->c) ;
        }
    if (debug)
        {
        printf("line(%d) %gx+%gy=%g, bisecting %d %d\n", e->edgenbr,
        e->a, e->b, e->c, e->reg[le]->sitenbr, e->reg[re]->sitenbr) ;
        }
    }

Here is the call graph for this function:

Here is the caller graph for this function:

void out_ep ( Edge )

Definition at line 57 of file output.c.

    {
    if (!triangulate && plot)
        {
        clip_line(e) ;
        }
    if (!triangulate && !plot)
        {
        printf("e %d", e->edgenbr);
        printf(" %d ", e->ep[le] != (Site *)NULL ? e->ep[le]->sitenbr : -1) ;
        printf("%d\n", e->ep[re] != (Site *)NULL ? e->ep[re]->sitenbr : -1) ;
        }
    }

Here is the call graph for this function:

Here is the caller graph for this function:

void out_site ( Site )

Definition at line 85 of file output.c.

    {
    if (!triangulate && plot && !debug)
        {
        circle (s->coord.x, s->coord.y, cradius) ;
        }
    if (!triangulate && !plot && !debug)
        {
        printf("s %f %f\n", s->coord.x, s->coord.y) ;
        }
    if (debug)
        {
        printf("site (%d) at %f %f\n", s->sitenbr, s->coord.x, s->coord.y) ;
        }
    }

Here is the call graph for this function:

Here is the caller graph for this function:

void out_triple ( Site ,
Site ,
Site  
)

Definition at line 102 of file output.c.

    {
    if (triangulate && !plot && !debug)
        {
        printf("%d %d %d\n", s1->sitenbr, s2->sitenbr, s3->sitenbr) ;
        }
    if (debug)
        {
        printf("circle through left=%d right=%d bottom=%d\n",
        s1->sitenbr, s2->sitenbr, s3->sitenbr) ;
        }
    }

Here is the caller graph for this function:

void out_vertex ( Site )

Definition at line 72 of file output.c.

    {
    if (!triangulate && !plot && !debug)
        {
        printf ("v %f %f\n", v->coord.x, v->coord.y) ;
        }
    if (debug)
        {
        printf("vertex(%d) at %f %f\n", v->sitenbr, v->coord.x, v->coord.y) ;
        }
    }

Here is the caller graph for this function:

void plotinit ( void  )

Definition at line 116 of file output.c.

    {
    float dx, dy, d ;

    dy = ymax - ymin ;
    dx = xmax - xmin ;
    d = ( dx > dy ? dx : dy) * 1.1 ;
    pxmin = xmin - (d-dx) / 2.0 ;
    pxmax = xmax + (d-dx) / 2.0 ;
    pymin = ymin - (d-dy) / 2.0 ;
    pymax = ymax + (d-dy) / 2.0 ;
    cradius = (pxmax - pxmin) / 350.0 ;
    openpl() ;
    range(pxmin, pymin, pxmax, pymax) ;
    }

Here is the call graph for this function:

Here is the caller graph for this function:

Point PQ_min ( void  )

Definition at line 82 of file heap.c.

    {
    Point answer ;

    while (PQhash[PQmin].PQnext == (Halfedge *)NULL)
        {
        ++PQmin ;
        }
    answer.x = PQhash[PQmin].PQnext->vertex->coord.x ;
    answer.y = PQhash[PQmin].PQnext->ystar ;
    return (answer) ;
    }

Here is the call graph for this function:

Here is the caller graph for this function:

int PQbucket ( Halfedge )

Definition at line 51 of file heap.c.

    {
    int bucket ;


    if     (he->ystar < ymin)  bucket = 0;
    else if (he->ystar >= ymax) bucket = PQhashsize-1;
    else                    bucket = (he->ystar - ymin)/deltay * PQhashsize;
    if (bucket < 0)
        {
        bucket = 0 ;
        }
    if (bucket >= PQhashsize)
        {
        bucket = PQhashsize-1 ;
        }
    if (bucket < PQmin)
        {
        PQmin = bucket ;
        }
    return (bucket);
    }

Here is the caller graph for this function:

void PQdelete ( Halfedge )

Definition at line 32 of file heap.c.

    {
    Halfedge * last;

    if(he ->  vertex != (Site *) NULL)
        {
        last = &PQhash[PQbucket(he)] ;
        while (last -> PQnext != he)
            {
            last = last->PQnext ;
            }
        last->PQnext = he->PQnext;
        PQcount-- ;
        deref(he->vertex) ;
        he->vertex = (Site *)NULL ;
        }
    }

Here is the call graph for this function:

Here is the caller graph for this function:

int PQempty ( void  )

Definition at line 75 of file heap.c.

    {
    return (PQcount == 0) ;
    }

Here is the caller graph for this function:

Halfedge* PQextractmin ( void  )

Definition at line 96 of file heap.c.

    {
    Halfedge * curr ;

    curr = PQhash[PQmin].PQnext ;
    PQhash[PQmin].PQnext = curr->PQnext ;
    PQcount-- ;
    return (curr) ;
    }

Here is the caller graph for this function:

void PQinitialize ( void  )

Definition at line 107 of file heap.c.

    {
    int i ;

    PQcount = PQmin = 0 ;
    PQhashsize = 4 * sqrt_nsites ;
    PQhash = (Halfedge *)myalloc(PQhashsize * sizeof *PQhash) ;
    for (i = 0 ; i < PQhashsize; i++)
        {
        PQhash[i].PQnext = (Halfedge *)NULL ;
        }
    }

Here is the call graph for this function:

Here is the caller graph for this function:

void PQinsert ( Halfedge ,
Site ,
float   
)

Definition at line 11 of file heap.c.

    {
    Halfedge * last, * next ;

    he->vertex = v ;
    ref(v) ;
    he->ystar = v->coord.y + offset ;
    last = &PQhash[ PQbucket(he)] ;
    while ((next = last->PQnext) != (Halfedge *)NULL &&
      (he->ystar  > next->ystar  ||
      (he->ystar == next->ystar &&
      v->coord.x > next->vertex->coord.x)))
        {
        last = next ;
        }
    he->PQnext = last->PQnext ;
    last->PQnext = he ;
    PQcount++ ;
    }

Here is the call graph for this function:

Here is the caller graph for this function:

void range ( float  ,
float  ,
float  ,
float   
)

Definition at line 33 of file output.c.

    {
    }

Here is the caller graph for this function:

void ref ( Site )

Definition at line 217 of file geometry.c.

    {
    ++(v->refcnt) ;
    }

Here is the caller graph for this function:

int right_of ( Halfedge ,
Point  
)

Definition at line 111 of file geometry.c.

    {
    Edge * e ;
    Site * topsite ;
    int right_of_site, above, fast ;
    float dxp, dyp, dxs, t1, t2, t3, yl ;

    e = el->ELedge ;
    topsite = e->reg[1] ;
    right_of_site = (p->x > topsite->coord.x) ;
    if (right_of_site && (el->ELpm == le))
        {
        return (1) ;
        }
    if(!right_of_site && (el->ELpm == re))
        {
        return (0) ;
        }
    if (e->a == 1.0)
        {
        dyp = p->y - topsite->coord.y ;
        dxp = p->x - topsite->coord.x ;
        fast = 0 ;
        if ((!right_of_site & (e->b < 0.0)) ||
         (right_of_site & (e->b >= 0.0)))
            {
            fast = above = (dyp >= e->b*dxp) ;
            }
        else
            {
            above = ((p->x + p->y * e->b) > (e->c)) ;
            if (e->b < 0.0)
                {
                above = !above ;
                }
            if (!above)
                {
                fast = 1 ;
                }
            }
        if (!fast)
            {
            dxs = topsite->coord.x - (e->reg[0])->coord.x ;
            above = (e->b * (dxp*dxp - dyp*dyp))
                    <
                    (dxs * dyp * (1.0 + 2.0 * dxp /
                    dxs + e->b * e->b)) ;
            if (e->b < 0.0)
                {
                above = !above ;
                }
            }
        }
    else  /*** e->b == 1.0 ***/
        {
        yl = e->c - e->a * p->x ;
        t1 = p->y - yl ;
        t2 = p->x - topsite->coord.x ;
        t3 = yl - topsite->coord.y ;
        above = ((t1*t1) > ((t2 * t2) + (t3 * t3))) ;
        }
    return (el->ELpm == le ? above : !above) ;
    }

Here is the caller graph for this function:

Definition at line 179 of file edgelist.c.

    {
    if (he->ELedge == (Edge *)NULL)
        {
        return(bottomsite) ;
        }
    return (he->ELpm == le ? he->ELedge->reg[re] :
        he->ELedge->reg[le]) ;
    }

Here is the caller graph for this function:

void voronoi ( Site *)()

Here is the caller graph for this function:


Variable Documentation

Definition at line 7 of file edgelist.c.

int debug

Definition at line 39 of file common.c.

float deltax

Definition at line 7 of file geometry.c.

float deltay

Definition at line 7 of file geometry.c.

Definition at line 9 of file geometry.c.

Definition at line 9 of file edgelist.c.

Definition at line 6 of file edgelist.c.

Definition at line 9 of file edgelist.c.

Definition at line 9 of file edgelist.c.

Definition at line 8 of file edgelist.c.

int nedges

Definition at line 8 of file geometry.c.

int nsites

Definition at line 103 of file vdefs.h.

int nvertices

Definition at line 8 of file geometry.c.

int plot

Definition at line 13 of file main.c.

int PQcount

Definition at line 7 of file heap.c.

Definition at line 8 of file heap.c.

Definition at line 7 of file heap.c.

int PQmin

Definition at line 7 of file heap.c.

Definition at line 106 of file vdefs.h.

int siteidx

Definition at line 13 of file main.c.

Definition at line 34 of file modstat.c.

int sorted

Definition at line 13 of file main.c.

Definition at line 8 of file geometry.c.

Definition at line 13 of file main.c.

float xmax

Definition at line 14 of file main.c.

float xmin

Definition at line 14 of file main.c.

float ymax

Definition at line 14 of file main.c.

float ymin

Definition at line 14 of file main.c.