From: Alan W. I. <ir...@be...> - 2002-02-27 02:53:53
|
On Tue, 26 Feb 2002, Geoffrey Furnish wrote: > Alan W. Irwin writes: > > Also, Geoffrey, despite the current flurry of PLplot activity, I especially > > hope you will contribute to the discussion of the python/plgetpos choice I > > face. I don't want to implement one way, only to find out you prefer the > > other choice. > > Sorry, I realize I'm slipping into the half comatose, half wildly > active external appearance thing again. It just comes down to job > pressure. > > I did read your note fully once, but would have to do so at least once > or twice more to formulate an opinion worth articulating. Do I > correctly surmise that the central issue is the codification of an API > for inverse coordinate mapping, from pixel coords on a display to > world coords associated with a defined viewport? > > If so, you should also check to see how this is currently done in > other places. I think there's an example of this in x01c, associated > with the locator demo, and there's also a demo of this somewhere in > the Tk stuff, I think. I know Maurice and I have a Tk app which does > this reverse coordinate translation stuff, triggered by Tk mouse > motion and button click event bindings, but I think one of us also > shoe-horned that into one of the Tk demos, N years ago. > > So, if this is correct, then we should look for a way to make all the > bindings compatible, and at least consider any current usage as a > model for such implementation. > > Alternatively, if I've missed the point of your missive, please spell > it out for me again. I'll reread again for the details, but could you > just state the purpose clearly in one or two sentences? It is definitely a coordinate transformation, but it is not my code, and the various coordinate systems in PLplot are poorly documented so that is why I quoted the code the pyqt guys think they need rather than making a poor attempt to explain it. I will have to dig somewhat deeper to understand what is going on with the coordinate system transformations. Maurice's further message was most encouraging, but I don't know whether that cursor transformation does quite the same thing at this stage. One complication is the cursor transformation uses different data for the transformation, i.e., "relative" (dxmi, etc.) and world (wxmi, etc.) window coordinates from a PLWindow struct. plgetpos uses "normalized" (vpwxmi) and world (vpwxmi, etc.) viewport coordinates from a PLStream struct. Right now I don't know whether "relative" and "normalized" mean the same thing or how/when the PLWindow struct coordinate data is generated. Another complication is the pyqt code multiplies the "normalized" viewport coordinates by the current width and height of the window as available from pyqt. Now that multiplied coordinate may be equivalent to the "absolute" device coordinates within the PLWindow struct, but I just don't know at this stage. It would be a big help if one of you could give me a definition of absolute, relative, and normalized coordinates. Perhaps for completeness you should also include world coordinates, but I think I understand what those are. TIA, Alan |