blob: d496febcccef01bb9366a9be88d589ddfc65acd0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
#
#include "defs.h"
#include <stdio.h>
double pxmin, pxmax, pymin, pymax, cradius;
void out_bisector(e) struct Edge *e;
{
if (line_count % nsites == 0) line_list = realloc(line_list, 3 * (nsites + line_count) * sizeof(double));
line_list[3*line_count] = e->a;
line_list[3*line_count+1] = e->b;
line_list[3*line_count+2] = e->c;
line_count++;
}
void out_ep(e) struct Edge *e;
{
if (edge_count % nsites == 0) edge_list = realloc(edge_list, 2 * (nsites + edge_count) * sizeof(unsigned int));
edge_list[2 * edge_count] = (e->ep[le] != (struct Site *)NULL ? e->ep[le]->sitenbr : UINT_MAX);
edge_list[2 * edge_count + 1] = (e->ep[re] != (struct Site *)NULL ? e->ep[re]->sitenbr : UINT_MAX);
edge_count++;
}
void out_vertex(v) struct Site *v;
{
if (vert_count % nsites == 0) vert_list = realloc(vert_list, 2 * (nsites + vert_count) * sizeof(double));
vert_list[2 * vert_count] = v->coord.x;
vert_list[2 * vert_count + 1] = v->coord.y;
vert_count++;
}
void out_site(s) struct Site *s;
{
site_list[2 * site_count] = s->coord.x;
site_list[2 * site_count + 1] = s->coord.y;
site_count++;
}
void out_triple(s1, s2, s3) struct Site *s1, *s2, *s3;
{
if (dual_count % nsites == 0) dual_list = realloc(dual_list, 3 * (nsites + dual_count) * sizeof(unsigned int));
dual_list[dual_count * 3] = s1->sitenbr;
dual_list[dual_count * 3 + 1] = s2->sitenbr;
dual_list[dual_count * 3 + 2] = s3->sitenbr;
dual_count++;
}
|