From: Gordon K. <kin...@us...> - 2005-04-09 22:44:39
|
Update of /cvsroot/teem/teem/src/push In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3444 Modified Files: action.c push.h Log Message: added pre-drag and tunable spring constant Index: push.h =================================================================== RCS file: /cvsroot/teem/teem/src/push/push.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** push.h 8 Apr 2005 08:29:24 -0000 1.7 --- push.h 9 Apr 2005 22:44:30 -0000 1.8 *************** *** 83,89 **** --- 83,92 ---- Nrrd *nin; /* image of 2D or 3D masked tensors */ double drag, /* to slow fast things down */ + preDrag, /* different drag pre-min-iter */ step, /* time step in integration */ mass, /* mass of particles */ scale, /* scaling from tensor to glyph size */ + stiff, /* spring constant on glyph surface */ + preStiff, /* different stiff pre-min-iter */ nudge, /* scaling of nudging towards center */ margin, /* space allowed around [-1,1]^3 for pnts */ Index: action.c =================================================================== RCS file: /cvsroot/teem/teem/src/push/action.c,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** action.c 8 Apr 2005 12:16:51 -0000 1.13 --- action.c 9 Apr 2005 22:44:30 -0000 1.14 *************** *** 520,524 **** ff = AIR_MAX(0, 2*scale - lenV); - ff = ff*ff; ELL_3V_SCALE(force, ff, nV); } --- 520,523 ---- *************** *** 566,572 **** void _pushRepel(pushTask *task, int bin, double parm[PUSH_STAGE_PARM_MAX]) { ! push_t *attr, *velAcc, *attrI, *attrJ, force[3], sumForce[3], dist, dir[3]; int *neiPidx, *myPidx, nei[27], ni, numNei, jj, ii, pidxJ, pidxI, myPidxArrLen, neiPidxArrLen; attr = (push_t *)task->pctx->nPointAttr->data; --- 565,573 ---- void _pushRepel(pushTask *task, int bin, double parm[PUSH_STAGE_PARM_MAX]) { ! push_t *attr, *velAcc, *attrI, *attrJ, force[3], sumForce[3], ! dist, dir[3], drag; int *neiPidx, *myPidx, nei[27], ni, numNei, jj, ii, pidxJ, pidxI, myPidxArrLen, neiPidxArrLen; + /* push_t mid[3]; */ attr = (push_t *)task->pctx->nPointAttr->data; *************** *** 596,610 **** attrJ + PUSH_POS, attrJ + PUSH_TEN); /* ! if (ELL_3V_LEN(force)) { fprintf(stderr, "!%s: %d <---> %d : %g\n", "_pushRepel", pidxI, pidxJ, ELL_3V_LEN(force)); } */ ! ELL_3V_INCR(sumForce, force); } } /* drag */ ! ELL_3V_SCALE_INCR(sumForce, -task->pctx->drag, attrI + PUSH_VEL); /* nudging towards image center */ --- 597,630 ---- attrJ + PUSH_POS, attrJ + PUSH_TEN); /* ! ELL_3V_SCALE_ADD2(mid, 0.5, attrI + PUSH_POS, 0.5, attrJ + PUSH_POS); ! if (ELL_3V_LEN(force) ! && AIR_IN_OP(-0.26, mid[0], -0.24) ! && AIR_IN_OP(0.08, mid[1], 0.10)) { ! fprintf(stderr, "!%s: @(%g,%g) : %d <--- %d : (%f,%f) %30.15f\n", ! "_pushRepel", ! mid[0], mid[1], ! pidxI, pidxJ, force[0], force[1], ! ELL_3V_LEN(force)); ! } ! */ ! /* ! if (ELL_3V_LEN(force)) { fprintf(stderr, "!%s: %d <---> %d : %g\n", "_pushRepel", pidxI, pidxJ, ELL_3V_LEN(force)); } */ ! ELL_3V_SCALE_INCR(sumForce, task->pctx->stiff, force); } } /* drag */ ! if (task->pctx->minIter ! && task->pctx->iter < task->pctx->minIter) { ! drag = AIR_AFFINE(0, task->pctx->iter, task->pctx->minIter, ! task->pctx->preDrag, task->pctx->drag); ! } else { ! drag = task->pctx->drag; ! } ! ELL_3V_SCALE_INCR(sumForce, -drag, attrI + PUSH_VEL); /* nudging towards image center */ |