cdt.c

来自「关于限制性四叉树实现算法的」· C语言 代码 · 共 68 行

C
68
字号
/********************************************************************************* cdt.C: implementation of the C interface defined in cdt.h**** Copyright (C) 1995 by Dani Lischinski **** This program is free software; you can redistribute it and/or modify** it under the terms of the GNU General Public License as published by** the Free Software Foundation; either version 2 of the License, or** (at your option) any later version.**** This program is distributed in the hope that it will be useful,** but WITHOUT ANY WARRANTY; without even the implied warranty of** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the** GNU General Public License for more details.**** You should have received a copy of the GNU General Public License** along with this program; if not, write to the Free Software** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.********************************************************************************/#include "quadedge.h"// assumes that given points form a bounding convex polygonextern "C"void *create_mesh( int num_bdry_vertices, double *bdry_vertices){	return new Mesh( num_bdry_vertices, bdry_vertices );}// insert a Delaunay siteextern "C"void insert_vertex( Mesh *mesh, double x, double y ){    mesh->InsertSite(Point2d(x, y));}// insert a constraint edgeextern "C"void insert_edge( Mesh *mesh, double x1, double y1, double x2, double y2 ){    mesh->InsertEdge(Point2d(x1, y1), Point2d(x2, y2));}extern "C"void apply_vertices(	Mesh *mesh, void *apply_arg,	void (*func)( void *apply_arg, void *vertex )){    mesh->ApplyVertices(func, apply_arg);}extern "C"void apply_edges(	Mesh *mesh, void *apply_arg,	void (*func)( void *apply_arg, void *edge, int constrained )){    mesh->ApplyEdges(func, apply_arg);}extern "C"void destroy_mesh (Mesh *mesh){    delete mesh;}

⌨️ 快捷键说明

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