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

📄 cogenvoxmap.cxx

📁 Delaunay三角形的网格剖分程序
💻 CXX
字号:
#include "cogenvoxmap.hxx"#include "cogwarnings.hxx"// #include "wzoutput.hxx"void CogenVoxmap::endInitialization(){  if(dirx==0) {xm=0; xp=1;}  if(diry==0) {ym=0; yp=1;}  if(dirz==0) {zm=0; zp=1;}  dx = (xp-xm)/lx();  dy = (yp-ym)/ly();  dz = (zp-zm)/lz();  // setBorder(xm,xp, ym,yp, zm,zp);  //  pout("pixmap [<>,<>]x[<>,<>]\n")<<xm,xp,ym,yp;  CogenOctree::endInitialization();}cogIndex CogenVoxmap::Point( cogPoint& p0) const{// computation of the segment number for the point (x[0],x[1]): cogFloat rx,ry,rz; int ix = (int)((rx = (p0.x() - xm) / (dx))); int iy = (int)((ry = (p0.y() - ym) / (dy))); int iz = (int)((rz = (p0.z() - zm) / (dz))); int u000; rx -= ix; ry -= iy; rz -= iz; if(ix<0) {ix = 0; rx = 0;} else if(ix>=Lx) {ix = Lx - 1; rx = 1;} if(iy<0) {iy = 0; ry = 0;} else if(iy>=Ly) {iy = Ly - 1; ry = 1;} if(iz<0) {iz = 0; rz = 0;} else if(iz>=Lz) {iz = Lz - 1; rz = 1;} u000 = (*(wzByteVoxmap*)this)(ix,iy,iz); /* if(cutPixelCorner){   if(rx > 0.5) {jx = ix+1; rx -= 0.5;}	else {jx = ix-1; rx = 0.5-rx;}   if(ry > 0.5) {jy = iy+1; ry -= 0.5;}	else {jy = iy-1; ry = 0.5-ry;}   if(jx<0) jx = 0;	else if(jx>=lx) jx = lx - 1;   if(jy<0) jy = 0;	else if(jy>=ly) jy = ly - 1;   u01 = pixmap(ix,jy);   u10 = pixmap(jx,iy);   if(u10 == u01)	if(rx+ry > 0.5) u00 = u10; } */ p0.segment() = wzRegion(u000); return cogRCRegionFound;}CogenVoxmap::CogenVoxmap(int lx, int ly, int lz)  :wzByteVoxmap(lx,ly,lz)  ,dirx(0),diry(0),dirz(0){}CogenVoxmap::CogenVoxmap(const wzGrayScaleVoxmap& tmap,		const wzGrayScaleTable& table)  :wzByteVoxmap(tmap,table)  ,dirx(0),diry(0),dirz(0){}/*void CogenPixmap::alignCenter (wzFloat x) {a = x; mod = 2;}void CogenPixmap::alignMinimum(wzFloat x) {a = x; mod = 1;}void CogenPixmap::alignMaximum(wzFloat x) {a = x; mod = 3;}*/void CogenVoxmap::setXRange(wzFloat min, wzFloat max){xm = min; xp = max; dirx = 1;}void CogenVoxmap::setYRange(wzFloat min, wzFloat max){ym = min; yp = max; diry = 1;}void CogenVoxmap::setZRange(wzFloat min, wzFloat max){zm = min; zp = max; dirz = 1;}

⌨️ 快捷键说明

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