|
From: Ethan M. <merritt@u.washington.edu> - 2009-06-02 18:04:40
|
On Tuesday 02 June 2009 06:26:47 Dean Foster wrote: > If all calls to points go through the function AXIS_MAP and > AXIS_UNMAP, then it does seem that we are pretty close to being able > to do a late change of axis. They are currently macros, not functions. I do think that in order to pursue this we will have to change them to be functions. Yes, my earlier email with sample code equivalent to xx = (FIRST_X_AXIS.transform) ? (FIRST_X_AXIS.transform)(pos->x) : pos->x; *x = AXIS_MAP(FIRST_X_AXIS, xx); would be further simplified by placing the test for a transform inside AXIS_MAP() itself. > I didn't know how to check that these > functions were always used. (I'm mostly a C++ programmer--so my only > tricks of making things private to find who peeks at data doesn't work > here. But I'm sure someone else knows if these functions are always > used as go-betweens.) I can try using them for my transformation and > see if it seems to work. I grepped for use of ->term_scale as a convenient indicator, and found only two other place in the core code that would be affected. One is the tic placement code, which we've already agreed is a special case but maybe not impossible to clean up. The other is graphics.c: map_position_r() As already mentioned, the mousing code in various terminals would need to revised also, but that will have to be done on a case by case basis. A few places test for the _sign_ of (axis)->term_scale, but so long as the transform is monotonic that should be OK. If it isn't monotonic, then we have other problems starting with there being no 1-to-1 inverse transform. I'm going to have to think about that, however. Is it possible that allowing non-monotonic axis transforms would be another way of generating parametric plots? -- Ethan A Merritt |