Subversion Repositories wimsdev

Compare Revisions

Ignore whitespace Rev 41 → Rev 3806

/trunk/wims/src/Misc/voronoiW/voronoi.c
26,6 → 26,8
out_site(bottomsite) ;
ELinitialize() ;
newsite = (*nextsite)() ;
newintstar.x = 0; /* gcc -Wall */
newintstar.y = 0; /* gcc -Wall */
while (1)
{
if(!PQempty())
35,35 → 37,33
if (newsite != (Site *)NULL && (PQempty()
|| newsite -> coord.y < newintstar.y
|| (newsite->coord.y == newintstar.y
&& newsite->coord.x < newintstar.x))) {/* new site is
smallest */
{
&& newsite->coord.x < newintstar.x)))
{/* new site is smallest */
out_site(newsite) ;
lbnd = ELleftbnd(&(newsite->coord)) ;
rbnd = ELright(lbnd) ;
bot = rightreg(lbnd) ;
e = bisect(bot, newsite) ;
bisector = HEcreate(e, le) ;
ELinsert(lbnd, bisector) ;
p = intersect(lbnd, bisector) ;
if (p != (Site *)NULL)
{
PQdelete(lbnd) ;
PQinsert(lbnd, p, dist(p,newsite)) ;
}
lbnd = bisector ;
bisector = HEcreate(e, re) ;
ELinsert(lbnd, bisector) ;
p = intersect(bisector, rbnd) ;
if (p != (Site *)NULL)
{
PQinsert(bisector, p, dist(p,newsite)) ;
}
newsite = (*nextsite)() ;
}
lbnd = ELleftbnd(&(newsite->coord)) ;
rbnd = ELright(lbnd) ;
bot = rightreg(lbnd) ;
e = bisect(bot, newsite) ;
bisector = HEcreate(e, le) ;
ELinsert(lbnd, bisector) ;
p = intersect(lbnd, bisector) ;
if (p != (Site *)NULL)
else if (!PQempty()) /* intersection is smallest */
{
PQdelete(lbnd) ;
PQinsert(lbnd, p, dist(p,newsite)) ;
}
lbnd = bisector ;
bisector = HEcreate(e, re) ;
ELinsert(lbnd, bisector) ;
p = intersect(bisector, rbnd) ;
if (p != (Site *)NULL)
{
PQinsert(bisector, p, dist(p,newsite)) ;
}
newsite = (*nextsite)() ;
}
else if (!PQempty()) /* intersection is smallest */
{
lbnd = PQextractmin() ;
llbnd = ELleft(lbnd) ;
rbnd = ELright(lbnd) ;
/trunk/wims/src/Misc/voronoiW/output.c
16,22 → 16,22
{
}
 
#pragma argsused
void
line(float ax, float ay, float bx, float by)
{
(void)ax; (void)ay; (void)bx; (void)by;
}
 
#pragma argsused
void
circle(float ax, float ay, float radius)
{
(void)ax; (void)ay; (void)radius;
}
 
#pragma argsused
void
range(float pxmin, float pxmax, float pymin, float pymax)
{
(void)pxmin; (void)pxmax; (void)pymin; (void)pymin; (void)pymax;
}
 
void
/trunk/wims/src/Misc/voronoiW/Makefile.in
17,7 → 17,7
$(cc) -o voronoi $O -lm
 
%.o: %.c
$(cc) -o $@ -c $<
$(cc) $(cflags) -o $@ -c $<
 
$O:vdefs.h
 
/trunk/wims/src/Misc/voronoiW/main.c
3,7 → 3,8
#include <stdio.h>
#include <stdlib.h> /* realloc(), qsort() */
 
#include <strings.h>
#include <string.h>
#include <ctype.h>
 
#include "vdefs.h"
 
18,7 → 19,6
int
main(int argc, char *argv[])
{
int c ;
Site *(*next)() ;
 
sorted = plot = debug = 0 ;