[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

*Subject*: Re: Selecting objects and PickData problem*From*: Pavel Romashkin <promashkin(at)cmdl.noaa.gov>*Date*: Thu, 10 Aug 2000 16:11:18 -0600*Newsgroups*: comp.lang.idl-pvwave*Organization*: NOAA-CMDL-CIRES*References*: <8mv31s$cgr$1@canopus.cc.umanitoba.ca> <MPG.13fcc7c62dfa37fd989bb8@news.frii.com>*Reply-To*: promashkin(at)cmdl.noaa.gov*Xref*: news.doit.wisc.edu comp.lang.idl-pvwave:20777

I have used PickData in a very similar fashion as Richard wants to use it. I did not modify the point value but used point's exact location to go back to the process that created that particular point. I was unable to directly use the output of PickData method. Instead, I had to locate the point in my Plot data that was closest to the location returned by PickData: x_loc_hi = (where(plot_data[0, *] ge return_XY[0]))[0] x_loc_lo = (reverse(where(plot_data[0, *] le return_XY[0])))[0] if abs(x_loc_hi - return_XY[0]) le abs(x_loc_lo - return_XY[0]) then $ x_loc = x_loc_hi else x_loc = x_loc_lo In my case, data were sorted and no Y search was necessary. More general approach would repeat this for the Y dimension, and Z too, I guess. This way, I was able to extract the point I needed. >From here, it would be very simple to make that point "follow" the cursor (by turning ON drag events until mouse release and changing the value of the found plot point). However, given the fact that mousing on the plot area never seemed to hit the exact point I tried to hit, I am not sure I'd like to set my data points using this method, unless for some sort of initial guess. I have a feeling that this uncertainty originates from PickData using input device coordinates to figure out if a click hit a plot. Then, if you happen to hit within some neighborhood of the plot object, PickData will return TRUE, although from the display device (which uses pixels) it can't tell what Plot value did you hit. Then PickData will return a value, probably corresponding to the center of that neighborhood, which is close to the value of Plot data point. As you can tell, it is all pure speculation. But I used the workaround and it worked for me. Cheers, Pavel

**References**:**Selecting objects and PickData problem***From:*Richard Tyc

**Re: Selecting objects and PickData problem***From:*David Fanning

- Prev by Date:
**Re: Selecting objects and PickData problem** - Next by Date:
**Dynamic menus on base widget using MBAR** - Prev by thread:
**Re: Selecting objects and PickData problem** - Next by thread:
**Dynamic menus on base widget using MBAR** - Index(es):