Back to index

wims  3.65+svn20090927
Functions | Variables
output.c File Reference
#include <stdio.h>
#include "vdefs.h"

Go to the source code of this file.

Functions

void openpl (void)
void line (float ax, float ay, float bx, float by)
void circle (float ax, float ay, float radius)
void range (float pxmin, float pxmax, float pymin, float pymax)
void out_bisector (Edge *e)
void out_ep (Edge *e)
void out_vertex (Site *v)
void out_site (Site *s)
void out_triple (Site *s1, Site *s2, Site *s3)
void plotinit (void)
void clip_line (Edge *e)

Variables

int triangulate
int plot
int debug
float ymax
float ymin
float xmax
float xmin
float pxmin
float pxmax
float pymin
float pymax
float cradius

Function Documentation

void circle ( float  ax,
float  ay,
float  radius 
)

Definition at line 27 of file output.c.

    {
    }

Here is the caller graph for this function:

void clip_line ( Edge e)

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 line ( float  ax,
float  ay,
float  bx,
float  by 
)

Definition at line 21 of file output.c.

    {
    }

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 e)

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 e)

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 s)

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 s1,
Site s2,
Site s3 
)

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 v)

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:

void range ( float  pxmin,
float  pxmax,
float  pymin,
float  pymax 
)

Definition at line 33 of file output.c.

    {
    }

Here is the caller graph for this function:


Variable Documentation

float cradius

Definition at line 12 of file output.c.

int debug

Definition at line 39 of file common.c.

int plot

Definition at line 13 of file main.c.

float pxmax

Definition at line 12 of file output.c.

float pxmin

Definition at line 12 of file output.c.

float pymax

Definition at line 12 of file output.c.

float pymin

Definition at line 12 of file output.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.