⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 delaunay.h

📁 this file is contain important facts aboute different programming langueges.
💻 H
字号:
/*
 * The author of this software is Steven Fortune.  Copyright (c) 1994 by AT&T
 * Bell Laboratories.
 * Permission to use, copy, modify, and distribute this software for any
 * purpose without fee is hereby granted, provided that this entire notice
 * is included in all copies of any software which is or includes a copy
 * or modification of this software and in all copies of the supporting
 * documentation for such software.
 * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED
 * WARRANTY.  IN PARTICULAR, NEITHER THE AUTHORS NOR AT&T MAKE ANY
 * REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY
 * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
 */

#ifndef NULL
#define NULL 0
#endif
#define DELETED -2

static int triangulate, sorted, debug;

struct	Freenode	{
struct	Freenode	*nextfree;
};
struct	Freelist	{
struct	Freenode	*head;
int			nodesize;
};


static float xmin, xmax, ymin, ymax, deltax, deltay;


struct Point	{
float x,y;
};

struct Tri	{
int t1,t2,t3;
};

/* structure used both for sites and for vertices */
struct Site	{
struct	Point	coord;
int		sitenbr;
int		refcnt;
};


static struct	Site	*sites;
static int		nsites;
static int		siteidx;
static int		sqrt_nsites;
static int		nvertices;
static struct 	Freelist sfl;
static struct	Site	*bottomsite;


struct Edge	{
float		a,b,c;
struct	Site 	*ep[2];
struct	Site	*reg[2];
int		edgenbr;
};
#define le 0
#define re 1
static int nedges;
static struct	Freelist efl;

static int has_endpoint(),right_of();
static struct Site *intersect();
static float dist();
static struct Point PQ_min();
static struct Halfedge *PQextractmin();
static struct Edge *bisect();

struct Halfedge {
struct Halfedge	*ELleft, *ELright;
struct Edge	*ELedge;
int		ELrefcnt;
char		ELpm;
struct	Site	*vertex;
float		ystar;
struct	Halfedge *PQnext;
};

static struct   Freelist	hfl;
static struct	Halfedge *ELleftend, *ELrightend;
static int 	ELhashsize;
static struct	Halfedge **ELhash;
static struct	Halfedge *HEcreate(), *ELleft(), *ELright(), *ELleftbnd();
static struct	Site *leftreg(), *rightreg();


static int PQhashsize;
static struct	Halfedge *PQhash;
static struct	Halfedge *PQfind();
static int PQcount;
static int PQmin;
static int PQempty();

static struct Point *mycord;
static struct Tri   *mynop;
static int   mynpts;
static int   myntri;
static int   mymaxtri;

static voronoi();
static out_vertex();
static out_ep();
static out_bisector();
static makefree();
static char *getfree();
static freeinit();
static int PQbucket();
static ref();
static deref();
static geominit();
static loadsites();
static void makevertex();
static char *myalloc();

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -