From: Gordon K. <kin...@us...> - 2006-03-08 14:12:13
|
Update of /cvsroot/teem/Deft/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6959 Modified Files: Anisocontour.cxx Contour.cxx Object.cxx Object.h PolyData.cxx PolyProbe.cxx Scene.cxx main-sqd.cxx Log Message: lpld->vertNum --> lpld->xyzwNum, and other assorted tweaks Index: Scene.cxx =================================================================== RCS file: /cvsroot/teem/Deft/src/Scene.cxx,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Scene.cxx 6 Mar 2006 02:37:30 -0000 1.6 --- Scene.cxx 8 Mar 2006 14:12:06 -0000 1.7 *************** *** 165,169 **** double time0 = airTime(); ! glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, GL_TRUE); glEnable(GL_DEPTH_TEST); --- 165,169 ---- double time0 = airTime(); ! /* glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, GL_TRUE); */ glEnable(GL_DEPTH_TEST); *************** *** 206,210 **** // set materials (until scene objects have their own materials) ! GLfloat mat_zero[] = {0.0f, 0.0f, 0.0f, 0.0f}; /* YOOHOO changed for van gogh GLfloat mat_ambient[] = {0.1f, 0.1f, 0.1f, 1.0f}; --- 206,210 ---- // set materials (until scene objects have their own materials) ! /* GLfloat mat_zero[] = {0.0f, 0.0f, 0.0f, 0.0f}; */ /* YOOHOO changed for van gogh GLfloat mat_ambient[] = {0.1f, 0.1f, 0.1f, 1.0f}; Index: Contour.cxx =================================================================== RCS file: /cvsroot/teem/Deft/src/Contour.cxx,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Contour.cxx 6 Mar 2006 02:39:27 -0000 1.6 --- Contour.cxx 8 Mar 2006 14:12:06 -0000 1.7 *************** *** 46,64 **** int ftype; ! gageKind *kind = gageKindScl; ! /* ftype = seekTypeIsocontour; int sclvItem = gageSclValue; int normItem = gageSclNormal; ! */ ! ftype = seekTypeRidgeSurface; ! /* int normItem = gageSclNormal; */ ! int normItem = gageSclHessEvec2; this->twoSided(true); int gradItem = gageSclGradVec; int evalItem = gageSclHessEval; int evecItem = gageSclHessEvec; ! /* gageKind *kind = tenGageKind; */ --- 46,74 ---- int ftype; ! this->wireframe(true); ! ftype = seekTypeIsocontour; + /* + gageKind *kind = gageKindScl; int sclvItem = gageSclValue; int normItem = gageSclNormal; ! int strengthItem = gageSclGradMag; ! int strengthSign = 1; ! double strength = 0.2; ! */ ! /* ftype = seekTypeRidgeSurface; */ ! /* this->twoSided(true); + this->normalsUse(false); + this->lightingUse(true); + int normItem = gageSclHessEvec2; int gradItem = gageSclGradVec; int evalItem = gageSclHessEval; int evecItem = gageSclHessEvec; ! int strengthItem = gageSclHessEval2; ! int strengthSign = -1; ! double strength = 0.03; ! */ /* gageKind *kind = tenGageKind; */ *************** *** 71,79 **** ftype = seekTypeRidgeSurface; this->twoSided(true); int gradItem = tenGageFAGradVec; int evecItem = tenGageFAHessianEvec; int evalItem = tenGageFAHessianEval; */ - /* gageKind *kind = tenGageKind; --- 81,92 ---- ftype = seekTypeRidgeSurface; this->twoSided(true); + int normItem = tenGageFAHessianEvec2; int gradItem = tenGageFAGradVec; int evecItem = tenGageFAHessianEvec; int evalItem = tenGageFAHessianEval; + int strengthItem = tenGageFAHessianEval2; + int strengthSign = -1; + double strength = 17; */ /* gageKind *kind = tenGageKind; *************** *** 97,100 **** --- 110,114 ---- ** holy crap, it actually works */ + /* gageContext *gctx; gagePerVolume *gpvl; *************** *** 110,144 **** ELL_3V_SET(kparm, 2, 1.0, 0.0); if (!E) E |= gageKernelSet(gctx, gageKernel22, nrrdKernelBCCubicDD, kparm); ! /* if (!E) E |= gageQueryItemOn(gctx, gpvl, sclvItem); if (!E) E |= gageQueryItemOn(gctx, gpvl, normItem); */ if (!E) E |= gageQueryItemOn(gctx, gpvl, gradItem); if (!E) E |= gageQueryItemOn(gctx, gpvl, evalItem); if (!E) E |= gageQueryItemOn(gctx, gpvl, evecItem); ! if (!E) E |= gageUpdate(gctx); if (E) { fprintf(stderr, "%s: trouble:\n%s", me, biffGetDone(GAGE)); } /* */ size_t samples[3]; ! ELL_3V_SET(samples, 60, 60, 30); mop = airMopNew(); ! if (seekDataSet(_sctx, /* nvol */ NULL , gctx /* NULL */, 0) /* */ || seekTypeSet(_sctx, ftype) /* || seekSamplesSet(_sctx, samples) */ ! || seekItemGradientSet(_sctx, gradItem) ! || seekItemEigensystemSet(_sctx, evalItem, evecItem) || seekItemNormalSet(_sctx, normItem) ! /* ! || seekItemScalarSet(_sctx, sclvItem) || seekItemNormalSet(_sctx, normItem) */ /* */ --- 124,169 ---- ELL_3V_SET(kparm, 2, 1.0, 0.0); if (!E) E |= gageKernelSet(gctx, gageKernel22, nrrdKernelBCCubicDD, kparm); ! if (!E) E |= gageQueryItemOn(gctx, gpvl, sclvItem); if (!E) E |= gageQueryItemOn(gctx, gpvl, normItem); + if (!E) E |= gageQueryItemOn(gctx, gpvl, strengthItem); */ + /* + if (!E) E |= gageQueryItemOn(gctx, gpvl, normItem); if (!E) E |= gageQueryItemOn(gctx, gpvl, gradItem); if (!E) E |= gageQueryItemOn(gctx, gpvl, evalItem); if (!E) E |= gageQueryItemOn(gctx, gpvl, evecItem); ! if (!E) E |= gageQueryItemOn(gctx, gpvl, strengthItem); ! */ ! /* if (!E) E |= gageUpdate(gctx); if (E) { fprintf(stderr, "%s: trouble:\n%s", me, biffGetDone(GAGE)); } + */ /* */ size_t samples[3]; ! ELL_3V_SET(samples, 61, 61, 31); mop = airMopNew(); ! if (seekDataSet(_sctx, nvol /* NULL */, NULL /* gctx */, 0) /* */ || seekTypeSet(_sctx, ftype) /* || seekSamplesSet(_sctx, samples) */ + /* + || seekStrengthUseSet(_sctx, AIR_TRUE) + || seekStrengthSet(_sctx, strengthSign, strength) ! || seekItemStrengthSet(_sctx, strengthItem) ! || seekItemScalarSet(_sctx, sclvItem) || seekItemNormalSet(_sctx, normItem) ! */ /* ! || seekItemGradientSet(_sctx, gradItem) ! || seekItemEigensystemSet(_sctx, evalItem, evecItem) || seekItemNormalSet(_sctx, normItem) + || seekItemStrengthSet(_sctx, strengthItem) */ /* */ *************** *** 171,179 **** time0 = airTime(); ! if (/* seekIsovalueSet(_sctx, isovalue) ! || */ seekUpdate(_sctx) || seekExtract(_sctx, _lpldOwn)) { err = biffGetDone(SEEK); ! fprintf(stderr, "%s: trouble getting isosurface:\n%s", me, err); free(err); return; --- 196,204 ---- time0 = airTime(); ! if (seekIsovalueSet(_sctx, isovalue) ! || seekUpdate(_sctx) || seekExtract(_sctx, _lpldOwn)) { err = biffGetDone(SEEK); ! fprintf(stderr, "%s: trouble getting surface:\n%s", me, err); free(err); return; *************** *** 187,190 **** --- 212,222 ---- */ this->changed(); + + if (limnPolyDataVertexWindingFix(_lpldOwn)) { + err = biffGetDone(LIMN); + fprintf(stderr, "%s: trouble fixing winding:\n%s", me, err); + free(err); + } + return; } Index: Object.cxx =================================================================== RCS file: /cvsroot/teem/Deft/src/Object.cxx,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Object.cxx 15 Jan 2006 00:55:54 -0000 1.4 --- Object.cxx 8 Mar 2006 14:12:06 -0000 1.5 *************** *** 46,49 **** --- 46,50 ---- _visible = true; _colorUse = true; + _normalsUse = true; _normalizeUse = true; _compilingUse = true; *************** *** 174,177 **** --- 175,188 ---- void + Object::normalsUse(bool col) { + if (_normalsUse != col) { + _normalsUse = col; + this->changed(); + } + } + + bool Object::normalsUse() const { return _normalsUse; } + + void Object::normalizeUse(bool norm) { if (_normalizeUse != norm) { Index: Anisocontour.cxx =================================================================== RCS file: /cvsroot/teem/Deft/src/Anisocontour.cxx,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Anisocontour.cxx 1 Mar 2006 19:56:38 -0000 1.1 --- Anisocontour.cxx 8 Mar 2006 14:12:06 -0000 1.2 *************** *** 259,263 **** (1 << limnPolyDataInfoRGBA) | (1 << limnPolyDataInfoNorm), ! _lpldOwn->vertNum, _lpldOwn->indxNum, _lpldOwn->primNum)) { --- 259,263 ---- (1 << limnPolyDataInfoRGBA) | (1 << limnPolyDataInfoNorm), ! _lpldOwn->xyzwNum, _lpldOwn->indxNum, _lpldOwn->primNum)) { Index: PolyData.cxx =================================================================== RCS file: /cvsroot/teem/Deft/src/PolyData.cxx,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** PolyData.cxx 1 Mar 2006 20:00:41 -0000 1.11 --- PolyData.cxx 8 Mar 2006 14:12:06 -0000 1.12 *************** *** 117,121 **** // indicate the allocated size of all the values if (query() != gage->query() ! || lpld()->vertNum != _valid.size()) { // fprintf(stderr, "!%s: deleting new values\n", me); _valuesClear(); --- 117,121 ---- // indicate the allocated size of all the values if (query() != gage->query() ! || lpld()->xyzwNum != _valid.size()) { // fprintf(stderr, "!%s: deleting new values\n", me); _valuesClear(); *************** *** 125,129 **** if (!_values.size()) { // fprintf(stderr, "!%s: allocating new values\n", me); ! _valid.resize(lpld()->vertNum); _values.resize(gage->query().size()); /* --- 125,129 ---- if (!_values.size()) { // fprintf(stderr, "!%s: allocating new values\n", me); ! _valid.resize(lpld()->xyzwNum); _values.resize(gage->query().size()); /* *************** *** 132,136 **** */ for (unsigned int qi=0; qi<_values.size(); qi++) { ! _values[qi] = new Values(lpld()->vertNum, gage->volume()->kind(), gage->query()[qi]); /* --- 132,136 ---- */ for (unsigned int qi=0; qi<_values.size(); qi++) { ! _values[qi] = new Values(lpld()->xyzwNum, gage->volume()->kind(), gage->query()[qi]); /* *************** *** 148,152 **** } ! unsigned int N = lpld()->vertNum; const float *xyzw = lpld()->xyzw; for (unsigned int I=0; I<N; I++) { --- 148,152 ---- } ! unsigned int N = lpld()->xyzwNum; const float *xyzw = lpld()->xyzw; for (unsigned int I=0; I<N; I++) { *************** *** 187,191 **** cmap->map(_nrgba, _values[valuesIdx]); ! unsigned int N = _lpldOwn->vertNum; unsigned char *nrgba = AIR_CAST(unsigned char*, _nrgba->data); unsigned char *vrgba = _lpldOwn->rgba; --- 187,191 ---- cmap->map(_nrgba, _values[valuesIdx]); ! unsigned int N = _lpldOwn->xyzwNum; unsigned char *nrgba = AIR_CAST(unsigned char*, _nrgba->data); unsigned char *vrgba = _lpldOwn->rgba; *************** *** 211,215 **** return; } ! unsigned int N = _lpldOwn->vertNum; unsigned char *nrgba = AIR_CAST(unsigned char*, _nrgba->data); unsigned char *vrgba = _lpldOwn->rgba; --- 211,215 ---- return; } ! unsigned int N = _lpldOwn->xyzwNum; unsigned char *nrgba = AIR_CAST(unsigned char*, _nrgba->data); unsigned char *vrgba = _lpldOwn->rgba; *************** *** 279,283 **** } ! size_t N = _lpldOwn->vertNum; unsigned char *vrgba = _lpldOwn->rgba; for (size_t I=0; I<N; I++) { --- 279,283 ---- } ! size_t N = _lpldOwn->xyzwNum; unsigned char *vrgba = _lpldOwn->rgba; for (size_t I=0; I<N; I++) { *************** *** 296,300 **** if (nrrdMaybeAlloc_va(npos, nrrdTypeFloat, 2, AIR_CAST(size_t, 3), ! AIR_CAST(size_t, lpld->vertNum))) { err = biffGetDone(NRRD); fprintf(stderr, "%s: couldn't allocate output:\n%s", me, err); --- 296,300 ---- if (nrrdMaybeAlloc_va(npos, nrrdTypeFloat, 2, AIR_CAST(size_t, 3), ! AIR_CAST(size_t, lpld->xyzwNum))) { err = biffGetDone(NRRD); fprintf(stderr, "%s: couldn't allocate output:\n%s", me, err); *************** *** 302,309 **** } float *pos = static_cast<float *>(npos->data); ! for (unsigned int ii=0; ii<lpld->vertNum; ii++) { ELL_34V_HOMOG(pos + 3*ii, lpld->xyzw + 4*ii); } ! return lpld->vertNum; } --- 302,309 ---- } float *pos = static_cast<float *>(npos->data); ! for (unsigned int ii=0; ii<lpld->xyzwNum; ii++) { ELL_34V_HOMOG(pos + 3*ii, lpld->xyzw + 4*ii); } ! return lpld->xyzwNum; } *************** *** 364,368 **** glEnableClientState(GL_VERTEX_ARRAY); glVertexPointer(4, GL_FLOAT, 4*sizeof(float), lpld->xyzw); ! if (lpld->norm) { glEnableClientState(GL_NORMAL_ARRAY); glNormalPointer(GL_FLOAT, 3*sizeof(float), lpld->norm); --- 364,368 ---- glEnableClientState(GL_VERTEX_ARRAY); glVertexPointer(4, GL_FLOAT, 4*sizeof(float), lpld->xyzw); ! if (lpld->norm && _normalsUse) { glEnableClientState(GL_NORMAL_ARRAY); glNormalPointer(GL_FLOAT, 3*sizeof(float), lpld->norm); *************** *** 385,388 **** --- 385,389 ---- /* fprintf(stderr, "!%s: _colorUse = %s\n", me, _colorUse ? "true" : "false"); + fprintf(stderr, "!%s: _normalsUse = %s\n", me, _normalsUse ? "true" : "false"); fprintf(stderr, "!%s: _compiling = %s\n", me, _compiling ? "true" : "false"); */ *************** *** 405,409 **** glBegin(glWhat); for (unsigned int vii=0; vii<vertCnt; vii++) { ! if (lpld->norm) { glNormal3fv(lpld->norm + 3*(lpld->indx + vertIdx)[vii]); } --- 406,410 ---- glBegin(glWhat); for (unsigned int vii=0; vii<vertCnt; vii++) { ! if (lpld->norm && _normalsUse) { glNormal3fv(lpld->norm + 3*(lpld->indx + vertIdx)[vii]); } *************** *** 419,424 **** if (!_compiling) { glDisableClientState(GL_VERTEX_ARRAY); ! glDisableClientState(GL_NORMAL_ARRAY); ! if (_colorUse) { glDisableClientState(GL_COLOR_ARRAY); } --- 420,427 ---- if (!_compiling) { glDisableClientState(GL_VERTEX_ARRAY); ! if (lpld->norm && _normalsUse) { ! glDisableClientState(GL_NORMAL_ARRAY); ! } ! if (lpld->rgba && _colorUse) { glDisableClientState(GL_COLOR_ARRAY); } *************** *** 443,452 **** // char me[]="PolyData::boundsGet"; const limnPolyData *lpld = this->lpld(); ! unsigned int vi, vertNum; float vertB[4], vertC[4]; if (lpld) { ! vertNum = lpld->vertNum; ! for (vi=0; vi<vertNum; vi++) { /* fprintf(stderr, "!%s: xyzw[%u] = (%g,%g,%g,%g)", me, vi, --- 446,455 ---- // char me[]="PolyData::boundsGet"; const limnPolyData *lpld = this->lpld(); ! unsigned int vi, xyzwNum; float vertB[4], vertC[4]; if (lpld) { ! xyzwNum = lpld->xyzwNum; ! for (vi=0; vi<xyzwNum; vi++) { /* fprintf(stderr, "!%s: xyzw[%u] = (%g,%g,%g,%g)", me, vi, Index: main-sqd.cxx =================================================================== RCS file: /cvsroot/teem/Deft/src/main-sqd.cxx,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** main-sqd.cxx 6 Feb 2006 05:40:08 -0000 1.6 --- main-sqd.cxx 8 Mar 2006 14:12:06 -0000 1.7 *************** *** 53,57 **** 0.3f, 0.3f, 50, 50); Deft::PolyData *surf = new Deft::PolyData(pld, true); ! surf->wireframe(true); surf->visible(true); scene->objectAdd(surf); --- 53,58 ---- 0.3f, 0.3f, 50, 50); Deft::PolyData *surf = new Deft::PolyData(pld, true); ! surf->wireframe(false); ! surf->normalsUse(false); surf->visible(true); scene->objectAdd(surf); Index: Object.h =================================================================== RCS file: /cvsroot/teem/Deft/src/Object.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Object.h 2 Feb 2006 15:45:24 -0000 1.5 --- Object.h 8 Mar 2006 14:12:06 -0000 1.6 *************** *** 79,82 **** --- 79,84 ---- void colorUse(bool); bool colorUse() const; + void normalsUse(bool); + bool normalsUse() const; void normalizeUse(bool); bool normalizeUse() const; *************** *** 105,109 **** // internal booleans ! bool _wireframe, _twoSided, _visible, _colorUse, _normalizeUse, _compilingUse, _lightingUse, _transformUse; --- 107,112 ---- // internal booleans ! bool _wireframe, _twoSided, _visible, _colorUse, ! _normalsUse, _normalizeUse, _compilingUse, _lightingUse, _transformUse; Index: PolyProbe.cxx =================================================================== RCS file: /cvsroot/teem/Deft/src/PolyProbe.cxx,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** PolyProbe.cxx 1 Mar 2006 20:03:07 -0000 1.10 --- PolyProbe.cxx 8 Mar 2006 14:12:06 -0000 1.11 *************** *** 441,445 **** if (_flag[flagGeometry] || _flag[flagGageContext]) { ! if (_gage->querySet() && this->polyData()->vertNum) { // NOT ->query().size() probe(_gage); } --- 441,445 ---- if (_flag[flagGeometry] || _flag[flagGageContext]) { ! if (_gage->querySet() && this->polyData()->xyzwNum) { // NOT ->query().size() probe(_gage); } *************** *** 459,463 **** || _flag[flagColorMap]) { // NOT ->query().size(), but for reasons GLK can't remember ! if (_gage->querySet() && this->polyData()->vertNum) { /* fprintf(stderr, "!%s: lpld->rgba = %p\n", me, --- 459,463 ---- || _flag[flagColorMap]) { // NOT ->query().size(), but for reasons GLK can't remember ! if (_gage->querySet() && this->polyData()->xyzwNum) { /* fprintf(stderr, "!%s: lpld->rgba = %p\n", me, *************** *** 479,483 **** || _flag[flagInitialRGBA]) { _brightnessLutSet(_brightness); ! if (_colorDoit && this->polyData()->vertNum) { dynamic_cast<PolyData*>(this)->RGBLut(_brightnessLut); } else { --- 479,483 ---- || _flag[flagInitialRGBA]) { _brightnessLutSet(_brightness); ! if (_colorDoit && this->polyData()->xyzwNum) { dynamic_cast<PolyData*>(this)->RGBLut(_brightnessLut); } else { *************** *** 495,499 **** if (_alphaMaskDoit && _gage->querySet() ! && this->polyData()->vertNum) { // NOT ->query().size() dynamic_cast<PolyData*>(this)->alphaMask(1, _alphaMaskThreshold); } --- 495,499 ---- if (_alphaMaskDoit && _gage->querySet() ! && this->polyData()->xyzwNum) { // NOT ->query().size() dynamic_cast<PolyData*>(this)->alphaMask(1, _alphaMaskThreshold); } |