📄 ibgd.c
字号:
/* last edit: Ilja Schmelzer -------------- 17-OCT-1994 19:34:21.97 */
/************************************************************************/
/* */
/* <<< I B G >>> - Intersection - Based Grid generation package */
/* */
/* Version 1.1 by Ilja Schmelzer schmelzer@iaas-berlin.d400.de */
/* */
/* to be distributed under IBG license conditions (see "readme.ibg") */
/* */
/************************************************************************/
#include "ibgd.h"
#include "ibglib.h"
#include "ibgdefault.h"
#include "ibgd0.h"
#include "ibgi.h"
ibGeometry ibgdCopy(ibGeometry old)
{
old->copy++;
return old;
}
int ibgdFree(ibGeometry old)
{
if(old==ibgNULL) return ibgSuccess;
if(old->copy>0) {old->copy--; return ibgSuccess;}
if(old->Class->Free) old->Class->Free(old);
free(old);
return ibgSuccess;
}
/* <<< ibgdNew >>> example of a simple geometry --- only one region: */
typedef struct _ibgConstant{
ibGeometryRec g;
ibgSegment u;
}ibgConstantRec,*ibgConstant;
static ibGeometryClassRec ibgConstantClass;
static int RegionOfPoint(ibGeometry g, ibgPoint *point, const ibgPoint *prev)
{ibgpSegment(*point) = ((ibgConstant)g)->u;
ibgpType(*point) = ibgSRegion;
return ibgRegionFound;
}
ibGeometry ibgdNew(ibgSegment region)
{ibgConstant geom = (ibgConstant) malloc(sizeof(ibgConstantRec));
ibgdInitialize((ibGeometry)geom,&ibgConstantClass);
ibgConstantClass.RegionOfPoint = RegionOfPoint;
geom->u = region;
return (ibGeometry)geom;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -