Skip to content
Snippets Groups Projects
Commit b2a85360 authored by slevy's avatar slevy
Browse files

OK, it's misleading to call it substitution, rename to PROJECT.

parent 82976ed9
No related branches found
No related tags found
No related merge requests found
......@@ -38,7 +38,7 @@ struct speckcache {
#define COORD_WORLD (-1)
#define COORD_OBJECT (-2)
typedef enum { DIFFROT, EXTRAPOLATE, SUBSTITUTE } warpstyle_t;
typedef enum { DIFFROT, EXTRAPOLATE, PROJECT } warpstyle_t;
struct svvec {
......@@ -77,8 +77,7 @@ struct warpstuff {
int degree;
int coef0; /* first fieldnumber of 3*degree terms: x',y',z', x'',y'',z'',... */
/* style == SUBSTITUTE ("-subst field0") */
/* Substitute some sequence of 3 attributes -> XYZ position */
/* style == PROJECT (from N dimensions to 3-D) */
struct svvec sref;
struct svvec sproj[3];
struct svvec sadd;
......@@ -201,7 +200,7 @@ struct cf *svvref( struct svvec *sv, int index )
return &sv->v[index];
}
static int substvec( struct warpstuff *ws, struct svvec *sv, int arg, int argc, char **argv )
static int projvec( struct warpstuff *ws, struct svvec *sv, int arg, int argc, char **argv )
{
int ix, ok, a;
char *cp, *ep;
......@@ -210,7 +209,7 @@ static int substvec( struct warpstuff *ws, struct svvec *sv, int arg, int argc,
int coef = 0;
svinit( sv );
ws->style = SUBSTITUTE;
ws->style = PROJECT;
sv->maxc = -1;
a = arg;
/*
......@@ -273,7 +272,7 @@ static int substvec( struct warpstuff *ws, struct svvec *sv, int arg, int argc,
return err ? argc+1 : a;
}
static void substadd( struct warpstuff *ws )
static void projadd( struct warpstuff *ws )
{
int i, k, r;
......@@ -311,13 +310,13 @@ struct warpstuff *warp_setup( struct stuff *st, struct warpstuff *oldws, int arg
for(i = 1; i < argc-1; i += 2) {
char *optarg = argv[i+1];
if(!strncmp(argv[i], "-w", 2) && argv[i][2] >= 'x' && argv[i][2] <= 'z') {
i = substvec( &tws, &tws.sproj[ argv[i][2] - 'x' ], i+1, argc, argv ) - 2;
i = projvec( &tws, &tws.sproj[ argv[i][2] - 'x' ], i+1, argc, argv ) - 2;
} else if(!strcmp(argv[i], "-ref")) {
i = substvec( &tws, &tws.sref, i+1, argc, argv ) - 2;
i = projvec( &tws, &tws.sref, i+1, argc, argv ) - 2;
} else if(!strcmp(argv[i], "-add")) {
i = substvec( &tws, &tws.sadd, i+1, argc, argv ) - 2;
i = projvec( &tws, &tws.sadd, i+1, argc, argv ) - 2;
if(tws.sadd.len != 3 || tws.sadd.v[0].c != 0 || tws.sadd.v[1].c != 1 || tws.sadd.v[2].c != 2) {
msg("warp -add: expected dx,dy,dz");
tws.sadd.len = 0;
......@@ -387,7 +386,7 @@ struct warpstuff *warp_setup( struct stuff *st, struct warpstuff *oldws, int arg
}
}
if(argc < 3) {
msg("Usage: %s [-extrap coef0[,degree]] [-subst field0] [-f fin,fout][-p period0[f|s]][-z zerotime][-R rot][-T o2d][-F d2o] [-r rcore[,transition][w]]] [-fix x,y,z[w]|radius[w]]", argv[0]);
msg("Usage: %s [-extrap coef0[,degree]] [-f fin,fout][-p period0[f|s]][-z zerotime][-R rot][-T o2d][-F d2o] [-r rcore[,transition][w]]] [-fix x,y,z[w]|radius[w]]", argv[0]);
msg("-r : core rad. w/optional width of transition region (fraction of rcore)");
msg(" : or (\"-\" separator) -r innercore-outercore");
msg("-R(or -rigidrot) : add rigid rotation by \"rot\" degrees to entire body.");
......@@ -400,8 +399,8 @@ struct warpstuff *warp_setup( struct stuff *st, struct warpstuff *oldws, int arg
return NULL;
}
if(tws.style == SUBSTITUTE)
substadd( &tws ); /* fill in sfadd[] terms: sum of sadd[] and sref dot sproj */
if(tws.style == PROJECT)
projadd( &tws ); /* fill in sfadd[] terms: sum of sadd[] and sref dot sproj */
ws = oldws ? oldws : NewN( struct warpstuff, 1 );
if(tws.tunit == 0)
......@@ -530,7 +529,7 @@ void warpspecks( struct warpstuff *ws,
}
break;
case SUBSTITUTE: {
case PROJECT: {
int k;
int maxval = SPECKMAXVAL(osl);
int maxcoef = ws->sproj[0].maxc > ws->sproj[1].maxc ? ws->sproj[0].maxc : ws->sproj[1].maxc;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment