|
From: <kin...@us...> - 2004-02-13 23:06:14
|
Update of /cvsroot/teem/teem/src/ten In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30035 Modified Files: enumsTen.c fiberMethods.c glyph.c ten.h tenGage.c tendGlyph.c Log Message: should be no external changes- various things needed to reflect changes in limn and gage Index: enumsTen.c =================================================================== RCS file: /cvsroot/teem/teem/src/ten/enumsTen.c,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** enumsTen.c 7 Jan 2004 15:34:31 -0000 1.13 --- enumsTen.c 13 Feb 2004 23:00:08 -0000 1.14 *************** *** 67,72 **** "trace", "frob", ! "eigenvalues", ! "eigenvectors", "tensor gradient", "Q anisotropy", --- 67,76 ---- "trace", "frob", ! "eigenvalue0", ! "eigenvalue1", ! "eigenvalue2", ! "eigenvector0", ! "eigenvector1", ! "eigenvector2", "tensor gradient", "Q anisotropy", *************** *** 87,92 **** "tensor trace", "frob(tensor)", ! "tensor eigenvalues", ! "tensor eigenvectors", "tensor gradient", "Q anisotropy", --- 91,100 ---- "tensor trace", "frob(tensor)", ! "tensor eigenvalue 0", ! "tensor eigenvalue 1", ! "tensor eigenvalue 2", ! "tensor eigenvector 0", ! "tensor eigenvector 1", ! "tensor eigenvector 2", "tensor gradient", "Q anisotropy", *************** *** 107,112 **** tenGageTrace, tenGageFrobTensor, ! tenGageEval, ! tenGageEvec, tenGageTensorGrad, tenGageQ, --- 115,124 ---- tenGageTrace, tenGageFrobTensor, ! tenGageEval0, ! tenGageEval1, ! tenGageEval2, ! tenGageEvec0, ! tenGageEvec1, ! tenGageEvec2, tenGageTensorGrad, tenGageQ, *************** *** 124,129 **** #define TG_TR tenGageTrace #define TG_FT tenGageFrobTensor ! #define TG_AL tenGageEval ! #define TG_EC tenGageEvec #define TG_TG tenGageTensorGrad #define TG_Q tenGageQ --- 136,145 ---- #define TG_TR tenGageTrace #define TG_FT tenGageFrobTensor ! #define TG_AL0 tenGageEval0 ! #define TG_AL1 tenGageEval1 ! #define TG_AL2 tenGageEval2 ! #define TG_EC0 tenGageEvec0 ! #define TG_EC1 tenGageEvec1 ! #define TG_EC2 tenGageEvec2 #define TG_TG tenGageTensorGrad #define TG_Q tenGageQ *************** *** 142,147 **** "tr", "trace", "frt", "fro", "frob", "frobt", ! "eval", "eigenvalues", ! "evec", "eigenvectors", "tg", "tgrad", "t grad", "tensor gradient", "q", --- 158,167 ---- "tr", "trace", "frt", "fro", "frob", "frobt", ! "eval0", "eigenvalue0", ! "eval1", "eigenvalue1", ! "eval2", "eigenvalue2", ! "evec0", "eigenvector0", ! "evec1", "eigenvector1", ! "evec2", "eigenvector2", "tg", "tgrad", "t grad", "tensor gradient", "q", *************** *** 162,167 **** TG_TR, TG_TR, TG_FT, TG_FT, TG_FT, TG_FT, ! TG_AL, TG_AL, ! TG_EC, TG_EC, TG_TG, TG_TG, TG_TG, TG_TG, TG_Q, --- 182,191 ---- TG_TR, TG_TR, TG_FT, TG_FT, TG_FT, TG_FT, ! TG_AL0, TG_AL0, ! TG_AL1, TG_AL1, ! TG_AL2, TG_AL2, ! TG_EC0, TG_EC0, ! TG_EC1, TG_EC1, ! TG_EC2, TG_EC2, TG_TG, TG_TG, TG_TG, TG_TG, TG_Q, *************** *** 179,183 **** _tenGage = { "tenGage", ! TEN_GAGE_MAX+1, _tenGageStr, _tenGageVal, _tenGageDesc, --- 203,207 ---- _tenGage = { "tenGage", ! TEN_GAGE_ITEM_MAX+1, _tenGageStr, _tenGageVal, _tenGageDesc, Index: fiberMethods.c =================================================================== RCS file: /cvsroot/teem/teem/src/ten/fiberMethods.c,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** fiberMethods.c 16 Jan 2004 17:35:12 -0000 1.13 --- fiberMethods.c 13 Feb 2004 23:00:08 -0000 1.14 *************** *** 98,105 **** tfx->stop = 0; ! tfx->query = 0; tfx->dten = gageAnswerPointer(tfx->gtx, tfx->gtx->pvl[0], tenGageTensor); ! tfx->eval = gageAnswerPointer(tfx->gtx, tfx->gtx->pvl[0], tenGageEval); ! tfx->evec = gageAnswerPointer(tfx->gtx, tfx->gtx->pvl[0], tenGageEvec); tfx->aniso = gageAnswerPointer(tfx->gtx, tfx->gtx->pvl[0], tenGageAniso); } --- 98,105 ---- tfx->stop = 0; ! GAGE_QUERY_RESET(tfx->query); tfx->dten = gageAnswerPointer(tfx->gtx, tfx->gtx->pvl[0], tenGageTensor); ! tfx->eval = gageAnswerPointer(tfx->gtx, tfx->gtx->pvl[0], tenGageEval0); ! tfx->evec = gageAnswerPointer(tfx->gtx, tfx->gtx->pvl[0], tenGageEvec0); tfx->aniso = gageAnswerPointer(tfx->gtx, tfx->gtx->pvl[0], tenGageAniso); } *************** *** 119,134 **** switch(type) { case tenFiberTypeEvec1: ! tfx->query |= (1 << tenGageEvec); break; case tenFiberTypeTensorLine: ! tfx->query |= ((1 << tenGageTensor) ! | (1 << tenGageEval) /* we'll compute c_l by hand */ ! | (1 << tenGageEvec)); break; case tenFiberTypePureLine: ! tfx->query |= (1 << tenGageTensor); break; case tenFiberTypeZhukov: ! sprintf(err, "%s: sorry, not Zhukov oriented tensors implemented", me); biffAdd(TEN, err); return 1; break; --- 119,138 ---- switch(type) { case tenFiberTypeEvec1: ! GAGE_QUERY_ITEM_ON(tfx->query, tenGageEvec0); break; case tenFiberTypeTensorLine: ! GAGE_QUERY_ITEM_ON(tfx->query, tenGageTensor); ! GAGE_QUERY_ITEM_ON(tfx->query, tenGageEval0); ! GAGE_QUERY_ITEM_ON(tfx->query, tenGageEval1); ! GAGE_QUERY_ITEM_ON(tfx->query, tenGageEval2); ! GAGE_QUERY_ITEM_ON(tfx->query, tenGageEvec0); ! GAGE_QUERY_ITEM_ON(tfx->query, tenGageEvec1); ! GAGE_QUERY_ITEM_ON(tfx->query, tenGageEvec2); break; case tenFiberTypePureLine: ! GAGE_QUERY_ITEM_ON(tfx->query, tenGageTensor); break; case tenFiberTypeZhukov: ! sprintf(err, "%s: sorry, Zhukov oriented tensors not implemented", me); biffAdd(TEN, err); return 1; break; *************** *** 181,185 **** biffAdd(TEN, err); ret = 1; goto end; } ! tfx->query |= (1 << tenGageAniso); break; case tenFiberStopLength: --- 185,189 ---- biffAdd(TEN, err); ret = 1; goto end; } ! GAGE_QUERY_ITEM_ON(tfx->query, tenGageAniso); break; case tenFiberStopLength: *************** *** 205,209 **** biffAdd(TEN, err); ret = 1; goto end; } ! tfx->query |= (1 << tenGageTensor); break; case tenFiberStopBounds: --- 209,213 ---- biffAdd(TEN, err); ret = 1; goto end; } ! GAGE_QUERY_ITEM_ON(tfx->query, tenGageTensor); break; case tenFiberStopBounds: Index: glyph.c =================================================================== RCS file: /cvsroot/teem/teem/src/ten/glyph.c,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** glyph.c 7 Jan 2004 15:34:31 -0000 1.31 --- glyph.c 13 Feb 2004 23:00:08 -0000 1.32 *************** *** 158,162 **** int ! tenGlyphGen(limnObj *glyphsLimn, echoScene *glyphsEcho, tenGlyphParm *parm, Nrrd *nten, Nrrd *npos, Nrrd *nslc) { char me[]="tenGlyphGen", err[AIR_STRLEN_MED]; --- 158,162 ---- int ! tenGlyphGen(limnObject *glyphsLimn, echoScene *glyphsEcho, tenGlyphParm *parm, Nrrd *nten, Nrrd *npos, Nrrd *nslc) { char me[]="tenGlyphGen", err[AIR_STRLEN_MED]; *************** *** 167,173 **** aniso[TEN_ANISO_MAX+1], sRot[16], mA[16], mB[16], R, G, B, qA, qB, glyphAniso, sliceGray; ! int slcCoord[3], slcIdx, idx, _idx=0, ri, axis, spi=0, numGlyphs, duh; ! limnPart *lglyph; ! limnSP *sp; echoObject *eglyph, *inst, *list=NULL, *split, *esquare; echoPos_t eM[16], originOffset[3], edge0[3], edge1[3]; --- 167,172 ---- aniso[TEN_ANISO_MAX+1], sRot[16], mA[16], mB[16], R, G, B, qA, qB, glyphAniso, sliceGray; ! int slcCoord[3], idx, _idx=0, glyphIdx, axis, numGlyphs, duh; ! limnLook *look; int lookIdx; echoObject *eglyph, *inst, *list=NULL, *split, *esquare; echoPos_t eM[16], originOffset[3], edge0[3], edge1[3]; *************** *** 241,254 **** } if (glyphsLimn) { ! /* create limnSPs for diffuse (#0) and flat (#1) shading */ ! spi = airArrayIncrLen(glyphsLimn->sA, 2); ! sp = glyphsLimn->s + spi + 0; ! ELL_4V_SET(sp->rgba, 1, 1, 1, 1); ! ELL_3V_SET(sp->k, 0, 1, 0); ! sp->spec = 0; ! sp = glyphsLimn->s + spi + 1; ! ELL_4V_SET(sp->rgba, 1, 1, 1, 1); ! ELL_3V_SET(sp->k, 1, 0, 0); ! sp->spec = 0; } if (glyphsEcho) { --- 240,244 ---- } if (glyphsLimn) { ! /* create limnLooks for diffuse and ambient-only shading */ } if (glyphsEcho) { *************** *** 287,292 **** } ELL_3V_COPY(slcCoord, pI); ! slcIdx = slcCoord[0] + nslc->axis[0].size*slcCoord[1]; ! sliceGray = nrrdFLookup[nslc->type](nslc->data, slcIdx); } else { if (!( tdata[0] >= parm->confThresh )) --- 277,283 ---- } ELL_3V_COPY(slcCoord, pI); ! sliceGray = ! nrrdFLookup[nslc->type](nslc->data, ! slcCoord[0] + nslc->axis[0].size*slcCoord[1]); } else { if (!( tdata[0] >= parm->confThresh )) *************** *** 304,308 **** /* make slice contribution */ if (glyphsLimn) { ! ri = limnObjSquareAdd(glyphsLimn, spi + 1); ELL_4M_IDENTITY_SET(mA); ell_4m_post_mul_f(mA, sRot); --- 295,304 ---- /* make slice contribution */ if (glyphsLimn) { ! lookIdx = limnObjectLookAdd(glyphsLimn); ! look = glyphsLimn->look + lookIdx; ! ELL_4V_SET(look->rgba, sliceGray, sliceGray, sliceGray, 1); ! ELL_3V_SET(look->kads, 1, 0, 0); ! look->spow = 0; ! glyphIdx = limnObjectSquareAdd(glyphsLimn, lookIdx); ELL_4M_IDENTITY_SET(mA); ell_4m_post_mul_f(mA, sRot); *************** *** 321,327 **** originOffset[2]); ell_4m_post_mul_f(mA, mB); ! lglyph = glyphsLimn->r + ri; ! ELL_4V_SET(lglyph->rgba, sliceGray, sliceGray, sliceGray, 1); ! limnObjPartTransform(glyphsLimn, ri, mA); } if (glyphsEcho) { --- 317,321 ---- originOffset[2]); ell_4m_post_mul_f(mA, mB); ! limnObjectPartTransform(glyphsLimn, glyphIdx, mA); } if (glyphsEcho) { *************** *** 405,428 **** /* add the glyph */ if (glyphsLimn) { switch(parm->glyphType) { case tenGlyphTypeBox: ! ri = limnObjCubeAdd(glyphsLimn, spi + 0); break; case tenGlyphTypeSphere: ! ri = limnObjPolarSphereAdd(glyphsLimn, spi + 0, axis, ! 2*parm->facetRes, parm->facetRes); break; case tenGlyphTypeCylinder: ! ri = limnObjCylinderAdd(glyphsLimn, spi + 0, axis, parm->facetRes); break; case tenGlyphTypeSuperquad: default: ! ri = limnObjPolarSuperquadAdd(glyphsLimn, spi + 0, axis, qA, qB, ! 2*parm->facetRes, parm->facetRes); break; } ! lglyph = glyphsLimn->r + ri; ! ELL_4V_SET(lglyph->rgba, R, G, B, 1); ! limnObjPartTransform(glyphsLimn, ri, mA); } if (glyphsEcho) { --- 399,427 ---- /* add the glyph */ if (glyphsLimn) { + lookIdx = limnObjectLookAdd(glyphsLimn); + look = glyphsLimn->look + lookIdx; + ELL_4V_SET(look->rgba, R, G, B, 1); + ELL_3V_SET(look->kads, 0, 1, 0); + look->spow = 0; switch(parm->glyphType) { case tenGlyphTypeBox: ! glyphIdx = limnObjectCubeAdd(glyphsLimn, lookIdx); break; case tenGlyphTypeSphere: ! glyphIdx = limnObjectPolarSphereAdd(glyphsLimn, lookIdx, axis, ! 2*parm->facetRes, parm->facetRes); break; case tenGlyphTypeCylinder: ! glyphIdx = limnObjectCylinderAdd(glyphsLimn, lookIdx, axis, ! parm->facetRes); break; case tenGlyphTypeSuperquad: default: ! glyphIdx = limnObjectPolarSuperquadAdd(glyphsLimn, lookIdx, axis, ! qA, qB, 2*parm->facetRes, ! parm->facetRes); break; } ! limnObjectPartTransform(glyphsLimn, glyphIdx, mA); } if (glyphsEcho) { Index: ten.h =================================================================== RCS file: /cvsroot/teem/teem/src/ten/ten.h,v retrieving revision 1.70 retrieving revision 1.71 diff -C2 -d -r1.70 -r1.71 *** ten.h 16 Jan 2004 17:35:12 -0000 1.70 --- ten.h 13 Feb 2004 23:00:08 -0000 1.71 *************** *** 110,114 **** int glyphType, facetRes; float glyphScale, sqdSharp; ! float edgeWidth[5]; /* same as limnOptsPS */ /* glyphs are colored by eigenvector colEvec with the standard XYZ-RGB --- 110,114 ---- int glyphType, facetRes; float glyphScale, sqdSharp; ! float edgeWidth[3]; /* 0: contour, 1: front crease, 2: front non-crease */ /* glyphs are colored by eigenvector colEvec with the standard XYZ-RGB *************** *** 153,179 **** tenGageTrace, /* 1: "tr", trace of tensor: *GT */ tenGageFrobTensor, /* 2: "fro", frobenius norm of tensor: *GT */ ! tenGageEval, /* 3: "eval", eigenvalues of tensor ! (sorted descending) : GT[3] */ ! tenGageEvec, /* 4: "evec", eigenvectors of tensor: GT[9] */ ! tenGageTensorGrad, /* 5: "tg", all tensor component gradients, starting with the confidence value gradient: GT[21] */ ! tenGageQ, /* 6: "q", Q anisotropy (or 9 times it): *GT */ ! tenGageQGradVec, /* 7: "qv", gradient of Q anisotropy: GT[3] */ ! tenGageQGradMag, /* 8: "qg", grad mag of Q anisotropy: *GT */ ! tenGageQNormal, /* 9: "qn", normalized gradient of Q anisotropy: GT[3] */ ! tenGageMultiGrad, /* 10: "mg", sum of outer products of the tensor ! matrix elements, correctly counting the off-diagonal entries twice, but not counting the confidence value: GT[9] */ ! tenGageFrobMG, /* 11: "frmg", frobenius norm of multi gradient: *GT */ ! tenGageMGEval, /* 12: "mgeval", eigenvalues of multi gradient: GT[3]*/ ! tenGageMGEvec, /* 13: "mgevec", eigenvectors of multi gradient: GT[9] */ ! tenGageAniso, /* 14: "an", all anisotropies: GT[TEN_ANISO_MAX+1] */ tenGageLast }; ! #define TEN_GAGE_MAX 14 ! #define TEN_GAGE_TOTAL_ANS_LENGTH (72+TEN_ANISO_MAX+1) /* --- 153,181 ---- tenGageTrace, /* 1: "tr", trace of tensor: *GT */ tenGageFrobTensor, /* 2: "fro", frobenius norm of tensor: *GT */ ! tenGageEval0, /* 3: "eval0", major eigenvalue of tensor : *GT */ ! tenGageEval1, /* 4: "eval1", medium eigenvalue of tensor : *GT */ ! tenGageEval2, /* 5: "eval2", minor eigenvalue of tensor : *GT */ ! tenGageEvec0, /* 6: "evec0", major eigenvectors of tensor: GT[3] */ ! tenGageEvec1, /* 7: "evec1", medium eigenvectors of tensor: GT[3] */ ! tenGageEvec2, /* 8: "evec2", minor eigenvectors of tensor: GT[3] */ ! tenGageTensorGrad, /* 9: "tg", all tensor component gradients, starting with the confidence value gradient: GT[21] */ ! tenGageQ, /* 10: "q", Q anisotropy (or 9 times it): *GT */ ! tenGageQGradVec, /* 11: "qv", gradient of Q anisotropy: GT[3] */ ! tenGageQGradMag, /* 12: "qg", grad mag of Q anisotropy: *GT */ ! tenGageQNormal, /* 13: "qn", normalized gradient of Q anisotropy: GT[3] */ ! tenGageMultiGrad, /* 14: "mg", sum of outer products of gradients of ! tensor elements, correctly counting the off-diagonal entries twice, but not counting the confidence value: GT[9] */ ! tenGageFrobMG, /* 15: "frmg", frobenius norm of multi gradient: *GT */ ! tenGageMGEval, /* 16: "mgeval", eigenvalues of multi gradient: GT[3]*/ ! tenGageMGEvec, /* 17: "mgevec", eigenvectors of multi gradient: GT[9] */ ! tenGageAniso, /* 18: "an", all anisotropies: GT[TEN_ANISO_MAX+1] */ tenGageLast }; ! #define TEN_GAGE_ITEM_MAX 18 /* *************** *** 267,272 **** double wPunct; /* knob for tensor lines */ /* ---- internal ----- */ ! int query, /* query we'll send to gageQuerySet */ ! dir; /* current direction being computed (0 or 1) */ double wPos[3], /* current world space location */ wDir[3], /* difference between this and last world space pos */ --- 269,274 ---- double wPunct; /* knob for tensor lines */ /* ---- internal ----- */ ! gageQuery query; /* query we'll send to gageQuerySet */ ! int dir; /* current direction being computed (0 or 1) */ double wPos[3], /* current world space location */ wDir[3], /* difference between this and last world space pos */ *************** *** 353,357 **** extern int tenGlyphParmCheck(tenGlyphParm *parm, Nrrd *nten, Nrrd *npos, Nrrd *nslc); ! extern int tenGlyphGen(limnObj *glyphs, echoScene *scene, tenGlyphParm *parm, Nrrd *nten, Nrrd *npos, Nrrd *nslc); --- 355,359 ---- extern int tenGlyphParmCheck(tenGlyphParm *parm, Nrrd *nten, Nrrd *npos, Nrrd *nslc); ! extern int tenGlyphGen(limnObject *glyphs, echoScene *scene, tenGlyphParm *parm, Nrrd *nten, Nrrd *npos, Nrrd *nslc); Index: tenGage.c =================================================================== RCS file: /cvsroot/teem/teem/src/ten/tenGage.c,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** tenGage.c 16 Jan 2004 17:35:12 -0000 1.10 --- tenGage.c 13 Feb 2004 23:00:09 -0000 1.11 *************** *** 22,131 **** #include "privateTen.h" ! /* ! tenGageTensor, * 0: "t", the reconstructed tensor: GT[7] * ! tenGageTrace, * 1: "tr", trace of tensor: *GT * ! tenGageFrobTensor, * 2: "fro", frobenius norm of tensor: *GT * ! tenGageEval, * 3: "eval", eigenvalues of tensor ! (sorted descending) : GT[3] * ! tenGageEvec, * 4: "evec", eigenvectors of tensor: GT[9] * ! tenGageTensorGrad, * 5: "tg", all tensor component gradients, starting ! with the confidence value gradient: GT[21] * ! tenGageQ, * 6: "q", Q anisotropy: *GT * ! tenGageQGradVec, * 7: "qv", gradient of Q anisotropy: GT[3] * ! tenGageQGradMag, * 8: "qg", grad mag of Q anisotropy: *GT * ! tenGageQNormal, * 9: "qn", normalized gradient of Q ! anisotropy: GT[3] * ! tenGageMultiGrad, * 10: "mg", sum of outer products of the tensor ! matrix elements, correctly counting the ! off-diagonal entries twice, but not counting ! the confidence value: GT[9] * ! tenGageFrobMG, * 11: "frmg", frobenius norm of multi gradient: *GT * ! tenGageMGEval, * 12: "mgeval", eigenvalues of multi gradient: GT[3]* ! tenGageMGEvec, * 13: "mgevec", eigenvectors of multi ! gradient: GT[9] * ! tenGageAniso, * 14: "an", all anisotropies: GT[TEN_ANISO_MAX+1] * ! tenGageLast ! ! */ ! ! int ! tenGageAnsLength[TEN_GAGE_MAX+1] = { ! 7, 1, 1, 3, 9, 21, 1, 3, 1, 3, 9, 1, 3, 9, TEN_ANISO_MAX+1 ! }; ! ! int ! tenGageAnsOffset[TEN_GAGE_MAX+1] = { ! 0, 7, 8, 9, 12, 21, 42, 43, 46, 47, 50, 59, 60, 63, 72 ! /* --> 72+TEN_ANISO_MAX+1 == TEN_GAGE_TOTAL_ANS_LENGTH */ ! }; ! ! /* ! ** _tenGageNeedDeriv[] ! ** ! ** each value is a BIT FLAG representing the different value/derivatives ! ** that are needed to calculate the quantity. ! ** ! ** 1: need value interpolation reconstruction (as with k00) ! ** 2: need first derivatives (as with k11) ! ** 4: need second derivatives (as with k22) ! */ ! int ! _tenGageNeedDeriv[TEN_GAGE_MAX+1] = { ! 1, 1, 1, 1, 1, 2, 1, 2, 2, 2, 2, 2, 2, 2, 1 ! }; ! ! /* ! ** _tenGagePrereq[] ! ** ! ** this records the measurements which are needed as ingredients for any ! ** given measurement, but it is not necessarily the recursive expansion of ! ** that requirement (that role is performed by gageQuerySet()) ! */ ! unsigned int ! _tenGagePrereq[TEN_GAGE_MAX+1] = { ! /* 0: tenGageTensor */ ! 0, ! ! /* 1: tenGageTrace */ ! (1<<tenGageTensor), ! ! /* 2: tenGageFrobTensor */ ! (1<<tenGageTensor), ! ! /* 3: tenGageEval */ ! (1<<tenGageTensor), ! ! /* 4: tenGageEvec */ ! (1<<tenGageTensor), ! ! /* 5: tenGageTensorGrad */ ! 0, ! ! /* 6: tenGageQ */ ! (1<<tenGageTensor), ! ! /* 7: tenGageQGradVec */ ! (1<<tenGageTensor) | (1<<tenGageTensorGrad), ! ! /* 8: tenGageQGradMag */ ! (1<<tenGageQGradVec), ! ! /* 9: tenGageQNormal */ ! (1<<tenGageQGradMag) | (1<<tenGageQGradVec), ! ! /* 10: tenGageMultiGrad */ ! (1<<tenGageTensorGrad), ! ! /* 11: tenGageFrobMG */ ! (1<<tenGageMultiGrad), ! ! /* 12: tenGageMGEval */ ! (1<<tenGageMultiGrad), ! ! /* 13: tenGageMGEvec */ ! (1<<tenGageMultiGrad), ! ! /* 14: tenGageAniso */ ! (1<<tenGageEval) }; --- 22,47 ---- #include "privateTen.h" ! gageItemEntry ! _tenGageTable[GAGE_SCL_ITEM_MAX+1] = { ! /* enum value len,deriv, prereqs, parent item, index*/ ! {tenGageTensor, 7, 0, {-1, -1, -1, -1, -1}, -1, -1}, ! {tenGageTrace, 1, 0, {tenGageTensor, -1, -1, -1, -1}, -1, -1}, ! {tenGageFrobTensor, 1, 0, {tenGageTensor, -1, -1, -1, -1}, -1, -1}, ! {tenGageEval0, 1, 0, {tenGageTensor, -1, -1, -1, -1}, -1, -1}, ! {tenGageEval1, 1, 0, {tenGageTensor, -1, -1, -1, -1}, -1, -1}, ! {tenGageEval2, 1, 0, {tenGageTensor, -1, -1, -1, -1}, -1, -1}, ! {tenGageEvec0, 3, 0, {tenGageTensor, -1, -1, -1, -1}, -1, -1}, ! {tenGageEvec1, 3, 0, {tenGageTensor, -1, -1, -1, -1}, -1, -1}, ! {tenGageEvec2, 3, 0, {tenGageTensor, -1, -1, -1, -1}, -1, -1}, ! {tenGageTensorGrad, 21, 1, {-1, -1, -1, -1, -1}, -1, -1}, ! {tenGageQ, 1, 0, {-1, -1, -1, -1, -1}, -1, -1}, ! {tenGageQGradVec, 3, 1, {tenGageTensor, tenGageTensorGrad, -1, -1, -1}, -1, -1}, ! {tenGageQGradMag, 1, 1, {tenGageQGradVec, -1, -1, -1, -1}, -1, -1}, ! {tenGageQNormal, 3, 1, {tenGageQGradVec, tenGageQGradMag, -1, -1, -1}, -1, -1}, ! {tenGageMultiGrad, 9, 1, {tenGageTensorGrad, -1, -1, -1, -1}, -1, -1}, ! {tenGageFrobMG, 1, 1, {tenGageMultiGrad, -1, -1, -1, -1}, -1, -1}, ! {tenGageMGEval, 3, 1, {tenGageMultiGrad, -1, -1, -1, -1}, -1, -1}, ! {tenGageMGEvec, 9, 1, {tenGageMultiGrad, -1, -1, -1, -1}, -1, -1}, ! {tenGageAniso, TEN_ANISO_MAX+1, 0, {tenGageEval0, tenGageEval1, tenGageEval2, -1, -1}, -1, -1} }; *************** *** 138,148 **** void _tenGageFilter (gageContext *ctx, gagePerVolume *pvl) { ! char me[]="_gageVecFilter"; gage_t *fw00, *fw11, *fw22, *tensor, *tgrad; int fd; fd = GAGE_FD(ctx); ! tensor = GAGE_ANSWER_POINTER(pvl, tenGageTensor); ! tgrad = GAGE_ANSWER_POINTER(pvl, tenGageTensorGrad); if (!ctx->parm.k3pack) { fprintf(stderr, "!%s: sorry, 6pack filtering not implemented\n", me); --- 54,64 ---- void _tenGageFilter (gageContext *ctx, gagePerVolume *pvl) { ! char me[]="_tenGageFilter"; gage_t *fw00, *fw11, *fw22, *tensor, *tgrad; int fd; fd = GAGE_FD(ctx); ! tensor = pvl->directAnswer[tenGageTensor]; ! tgrad = pvl->directAnswer[tenGageTensorGrad]; if (!ctx->parm.k3pack) { fprintf(stderr, "!%s: sorry, 6pack filtering not implemented\n", me); *************** *** 191,198 **** _tenGageAnswer (gageContext *ctx, gagePerVolume *pvl) { /* char me[]="_tenGageAnswer"; */ - unsigned int query; gage_t *ans, *tenAns, *tgradAns, *QgradAns, *evalAns, *evecAns, tmptmp=0, dtA=0, dtB=0, dtC=0, dtD=0, dtE=0, dtF=0, cbA, cbB; ! int *offset; #if !GAGE_TYPE_FLOAT --- 107,113 ---- _tenGageAnswer (gageContext *ctx, gagePerVolume *pvl) { /* char me[]="_tenGageAnswer"; */ gage_t *ans, *tenAns, *tgradAns, *QgradAns, *evalAns, *evecAns, tmptmp=0, dtA=0, dtB=0, dtC=0, dtD=0, dtE=0, dtF=0, cbA, cbB; ! int wantEvals, wantEvecs; #if !GAGE_TYPE_FLOAT *************** *** 201,213 **** #endif ! query = pvl->query; ! ans = pvl->ans; ! offset = tenGageKind->ansOffset; ! tenAns = ans + offset[tenGageTensor]; ! tgradAns = ans + offset[tenGageTensorGrad]; ! QgradAns = ans + offset[tenGageQGradVec]; ! evalAns = ans + offset[tenGageEval]; ! evecAns = ans + offset[tenGageEvec]; ! if (1 & (query >> tenGageTensor)) { /* done if doV */ dtA = tenAns[1]; --- 116,126 ---- #endif ! ans = pvl->answer; ! tenAns = pvl->directAnswer[tenGageTensor]; ! tgradAns = pvl->directAnswer[tenGageTensorGrad]; ! QgradAns = pvl->directAnswer[tenGageQGradVec]; ! evalAns = pvl->directAnswer[tenGageEval0]; ! evecAns = pvl->directAnswer[tenGageEvec0]; ! if (GAGE_QUERY_ITEM_TEST(pvl->query, tenGageTensor)) { /* done if doV */ dtA = tenAns[1]; *************** *** 222,248 **** } } ! if (1 & (query >> tenGageTrace)) { ! ans[offset[tenGageTrace]] = dtA + dtD + dtF; } ! if (1 & (query >> tenGageFrobTensor)) { ! ans[offset[tenGageTrace]] = sqrt(dtA*dtA + 2*dtB*dtB + 2*dtC*dtC ! + dtD*dtD + 2*dtE*dtE + dtF*dtF); } ! /* HEY: this is pretty sub-optimal if the only thing we want is the ! eigenvalues for doing anisotropy determination ... */ ! if ( (1 & (query >> tenGageEval)) || (1 & (query >> tenGageEvec)) ) { #if GAGE_TYPE_FLOAT ! tenEigensolve(evalAns, evecAns, tenAns); #else ! TEN_LIST_COPY(tenAnsF, tenAns); ! tenEigensolve(evalAnsF, evecAnsF, tenAnsF); ! ELL_3V_COPY(evalAns, evalAnsF); ! ELL_3M_COPY(evecAns, evecAnsF); #endif } ! if (1 & (query >> tenGageTensorGrad)) { /* done if doD1 */ } ! if (1 & (query >> tenGageQ)) { cbA = -(dtA + dtD + dtF); cbB = dtA*dtD - dtB*dtB + dtA*dtF - dtC*dtC + dtD*dtF - dtE*dtE; --- 135,177 ---- } } ! if (GAGE_QUERY_ITEM_TEST(pvl->query, tenGageTrace)) { ! pvl->directAnswer[tenGageTrace][0] = dtA + dtD + dtF; } ! if (GAGE_QUERY_ITEM_TEST(pvl->query, tenGageFrobTensor)) { ! pvl->directAnswer[tenGageFrobTensor][0] = sqrt(dtA*dtA + 2*dtB*dtB ! + 2*dtC*dtC + dtD*dtD ! + 2*dtE*dtE + dtF*dtF); } ! wantEvals = ((GAGE_QUERY_ITEM_TEST(pvl->query, tenGageEval0)) || ! (GAGE_QUERY_ITEM_TEST(pvl->query, tenGageEval1)) || ! (GAGE_QUERY_ITEM_TEST(pvl->query, tenGageEval2))); ! wantEvecs = ((GAGE_QUERY_ITEM_TEST(pvl->query, tenGageEvec0)) || ! (GAGE_QUERY_ITEM_TEST(pvl->query, tenGageEvec1)) || ! (GAGE_QUERY_ITEM_TEST(pvl->query, tenGageEvec2))); ! if (wantEvecs) { ! /* we do the longer process to get eigenvectors, and in the process ! we always find the eigenvalues, whether or not they were asked for */ #if GAGE_TYPE_FLOAT ! tenEigensolve(evalAns, evecAns, tenAns); #else ! TEN_LIST_COPY(tenAnsF, tenAns); ! tenEigensolve(evalAnsF, evecAnsF, tenAnsF); ! ELL_3V_COPY(evalAns, evalAnsF); ! ELL_3M_COPY(evecAns, evecAnsF); ! #endif ! } else if (wantEvals) { ! /* else eigenvectors are NOT needed, but eigenvalues ARE needed */ ! #if GAGE_TYPE_FLOAT ! tenEigensolve(evalAns, NULL, tenAns); ! #else ! TEN_LIST_COPY(tenAnsF, tenAns); ! tenEigensolve(evalAnsF, NULL, tenAnsF); ! ELL_3V_COPY(evalAns, evalAnsF); #endif } ! if (GAGE_QUERY_ITEM_TEST(pvl->query, tenGageTensorGrad)) { /* done if doD1 */ } ! if (GAGE_QUERY_ITEM_TEST(pvl->query, tenGageQ)) { cbA = -(dtA + dtD + dtF); cbB = dtA*dtD - dtB*dtB + dtA*dtF - dtC*dtC + dtD*dtF - dtE*dtE; *************** *** 251,257 **** - dtC*dtC*dtD - dtB*dtB*dtF - dtA*dtE*dtE); */ ! ans[offset[tenGageQ]] = cbA*cbA - 3*cbB; } ! if (1 & (query >> tenGageQGradVec)) { ELL_3V_SET(QgradAns, 0, 0, 0); ELL_3V_SCALE_INCR(QgradAns, dtA, tgradAns + 1*3); --- 180,186 ---- - dtC*dtC*dtD - dtB*dtB*dtF - dtA*dtE*dtE); */ ! pvl->directAnswer[tenGageQ][0] = cbA*cbA - 3*cbB; } ! if (GAGE_QUERY_ITEM_TEST(pvl->query, tenGageQGradVec)) { ELL_3V_SET(QgradAns, 0, 0, 0); ELL_3V_SCALE_INCR(QgradAns, dtA, tgradAns + 1*3); *************** *** 266,282 **** ELL_3V_SCALE_INCR(QgradAns, tmptmp, tgradAns + 6*3); } ! if (1 & (query >> tenGageQGradMag)) { ! tmptmp = ans[offset[tenGageQGradMag]] = ELL_3V_LEN(QgradAns); } ! if (1 & (query >> tenGageQNormal)) { ! ELL_3V_SCALE(ans + offset[tenGageQNormal], 1.0/tmptmp, QgradAns); } ! if (1 & (query >> tenGageAniso)) { #if GAGE_TYPE_FLOAT ! tenAnisoCalc(ans + offset[tenGageAniso], evalAns); #else tenAnisoCalc(aniso, evalAnsF); for (ci=0; ci<=TEN_ANISO_MAX; ci++) { ! (ans + offset[tenGageAniso])[ci] = aniso[ci]; } #endif --- 195,211 ---- ELL_3V_SCALE_INCR(QgradAns, tmptmp, tgradAns + 6*3); } ! if (GAGE_QUERY_ITEM_TEST(pvl->query, tenGageQGradMag)) { ! tmptmp = pvl->directAnswer[tenGageQGradMag][0] = ELL_3V_LEN(QgradAns); } ! if (GAGE_QUERY_ITEM_TEST(pvl->query, tenGageQNormal)) { ! ELL_3V_SCALE(pvl->directAnswer[tenGageQNormal], 1.0/tmptmp, QgradAns); } ! if (GAGE_QUERY_ITEM_TEST(pvl->query, tenGageAniso)) { #if GAGE_TYPE_FLOAT ! tenAnisoCalc(pvl->directAnswer[tenGageAniso], evalAns); #else tenAnisoCalc(aniso, evalAnsF); for (ci=0; ci<=TEN_ANISO_MAX; ci++) { ! pvl->directAnswer[tenGageAniso][ci] = aniso[ci]; } #endif *************** *** 291,300 **** 1, 7, ! TEN_GAGE_MAX, ! tenGageAnsLength, ! tenGageAnsOffset, ! TEN_GAGE_TOTAL_ANS_LENGTH, ! _tenGageNeedDeriv, ! _tenGagePrereq, _tenGageIv3Print, _tenGageFilter, --- 220,225 ---- 1, 7, ! TEN_GAGE_ITEM_MAX, ! _tenGageTable, _tenGageIv3Print, _tenGageFilter, Index: tendGlyph.c =================================================================== RCS file: /cvsroot/teem/teem/src/ten/tendGlyph.c,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** tendGlyph.c 7 Jan 2004 15:34:31 -0000 1.22 --- tendGlyph.c 13 Feb 2004 23:00:09 -0000 1.23 *************** *** 45,50 **** char *outS; limnCamera *cam; ! limnObj *glyph; ! limnWin *win; echoScene *scene; echoRTParm *eparm; --- 45,50 ---- char *outS; limnCamera *cam; ! limnObject *glyph; ! limnWindow *win; echoScene *scene; echoRTParm *eparm; *************** *** 61,70 **** cam = limnCameraNew(); airMopAdd(mop, cam, (airMopper)limnCameraNix, airMopAlways); ! glyph = limnObjNew(512, AIR_TRUE); ! airMopAdd(mop, glyph, (airMopper)limnObjNix, airMopAlways); scene = echoSceneNew(); airMopAdd(mop, scene, (airMopper)echoSceneNix, airMopAlways); ! win = limnWinNew(limnDevicePS); ! airMopAdd(mop, win, (airMopper)limnWinNix, airMopAlways); gparm = tenGlyphParmNew(); airMopAdd(mop, gparm, (airMopper)tenGlyphParmNix, airMopAlways); --- 61,70 ---- cam = limnCameraNew(); airMopAdd(mop, cam, (airMopper)limnCameraNix, airMopAlways); ! glyph = limnObjectNew(512, AIR_TRUE); ! airMopAdd(mop, glyph, (airMopper)limnObjectNix, airMopAlways); scene = echoSceneNew(); airMopAdd(mop, scene, (airMopper)echoSceneNix, airMopAlways); ! win = limnWindowNew(limnDevicePS); ! airMopAdd(mop, win, (airMopper)limnWindowNix, airMopAlways); gparm = tenGlyphParmNew(); airMopAdd(mop, gparm, (airMopper)tenGlyphParmNix, airMopAlways); *************** *** 185,189 **** "resolution of polygonalization of glyphs (all glyphs " "other than the default box)"); ! hestOptAdd(&hopt, "wd", "3 widths", airTypeFloat, 3, 3, gparm->edgeWidth + 2, "0.8 0.4 0.0", "(* postscript only *) " "width of edges drawn for three kinds of glyph " --- 185,189 ---- "resolution of polygonalization of glyphs (all glyphs " "other than the default box)"); ! hestOptAdd(&hopt, "wd", "3 widths", airTypeFloat, 3, 3, gparm->edgeWidth, "0.8 0.4 0.0", "(* postscript only *) " "width of edges drawn for three kinds of glyph " *************** *** 276,288 **** cam->faar = 0.0000000001; cam->atRelative = AIR_TRUE; ! win->ps.edgeWidth[0] = gparm->edgeWidth[0]; ! win->ps.edgeWidth[1] = gparm->edgeWidth[1]; ! win->ps.edgeWidth[2] = gparm->edgeWidth[2]; ! win->ps.edgeWidth[3] = gparm->edgeWidth[3]; ! win->ps.edgeWidth[4] = gparm->edgeWidth[4]; win->ps.creaseAngle = 70; ELL_3V_COPY(win->ps.bg, bg); ! if (limnObjRender(glyph, cam, win) ! || limnObjPSDraw(glyph, cam, emap, win)) { airMopAdd(mop, err = biffGetDone(LIMN), airFree, airMopAlways); fprintf(stderr, "%s: trouble drawing glyphs:\n%s\n", me, err); --- 276,288 ---- cam->faar = 0.0000000001; cam->atRelative = AIR_TRUE; ! win->ps.lineWidth[limnEdgeTypeBackFacet] = 0; ! win->ps.lineWidth[limnEdgeTypeBackCrease] = 0; ! win->ps.lineWidth[limnEdgeTypeContour] = gparm->edgeWidth[0]; ! win->ps.lineWidth[limnEdgeTypeFrontCrease] = gparm->edgeWidth[1]; ! win->ps.lineWidth[limnEdgeTypeFrontFacet] = gparm->edgeWidth[2]; win->ps.creaseAngle = 70; ELL_3V_COPY(win->ps.bg, bg); ! if (limnObjectRender(glyph, cam, win) ! || limnObjectPSDraw(glyph, cam, emap, win)) { airMopAdd(mop, err = biffGetDone(LIMN), airFree, airMopAlways); fprintf(stderr, "%s: trouble drawing glyphs:\n%s\n", me, err); |