Bug 115970 - Datamode doesn't work on images.
Summary: Datamode doesn't work on images.
Status: RESOLVED FIXED
Alias: None
Product: kst
Classification: Applications
Component: general (show other bugs)
Version: 1.x
Platform: unspecified Linux
: NOR wishlist
Target Milestone: ---
Assignee: kst
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-11-09 01:15 UTC by Matthew Truch
Modified: 2005-12-01 23:06 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matthew Truch 2005-11-09 01:15:14 UTC
Version:           1.2.0_svn_478969 (using KDE KDE 3.4.1)
OS:                Linux

When you have an image in a plot and are in non-data mode, the x and y coordinates are displayed in the status bar.  If you turn on datamode, nothing is displayed in the status bar.  One should be able to see the x, y, and z values for the image(s) in the status bar when in datamode.
Comment 1 George Staikos 2005-11-09 01:52:33 UTC
On Tuesday 08 November 2005 19:15, Matthew Truch wrote:
> When you have an image in a plot and are in non-data mode, the x and y
> coordinates are displayed in the status bar.  If you turn on datamode,
> nothing is displayed in the status bar.  One should be able to see the x,
> y, and z values for the image(s) in the status bar when in datamode.


  What do we do in a case where there are vcurves and images in the plot?  Do 
we find the closest vcurve, or use the image?
Comment 2 Netterfield 2005-11-09 02:04:37 UTC
Non data mode:
	whether or not curves exist:
		Not over image: 
			x,y of the cursor
		Over image: 
			x,y,z of image under the cursor.

Data mode:
	If curves exist: 
		If over image:
			x,y of nearby curve, z of image under that point.
		if not over image:
			x,y of nearby curve
	If curves do not exist
		Same as non-data mode
Comment 3 Matthew Truch 2005-11-09 02:13:02 UTC
On Wed, Nov 09, 2005 at 01:04:38AM -0000, netterfield@astro.utoronto.ca wrote:
> Non data mode:
> 	whether or not curves exist:
> 		Not over image: 
> 			x,y of the cursor
> 		Over image: 
> 			x,y,z of image under the cursor.
> 
> Data mode:
> 	If curves exist: 
> 		If over image:
> 			x,y of nearby curve, z of image under that point.
> 		if not over image:
> 			x,y of nearby curve
> 	If curves do not exist
> 		Same as non-data mode


For the case of: Data mode -> curves don't exist, I think it's important
that instead of x,y,z of image under the cursor, it needs to be nearest
x,y,z that is data in the underlying matrix, with the appropriate
'datamode marker' indicating where that is.  

But this conflicts with the behavior of: data mode -> curves exist ->
over an image, as if the x,y of the nearby curve are shown, there's no
reason that it would coorespond with an x,y of the image's data.  The
point of datamode is that you can see actual values that coorespond to
actual data, not an interpolation thereof.  
Comment 4 Ted Kisner 2005-11-09 02:27:33 UTC
It seems like we need to come up with a general solution for when there are 
multiple basecurves on the current plot.  For example, we could have a bunch 
of vcurves, one image displayed as a colormap, another image (with different 
matrix) displayed as contour map, etc.

Perhaps kstbasecurve should have generic member functions to return "nearest 
data point for a given coordinate pair".  Then each basecurve (vcurve, image, 
etc) can decide how it wants to do this.  The vcurves would return the 
nearest vector point and the image would return the nearest matrix element.

Then each 2DPlot will query *all* basecurves for the closest data point to a 
current location.  The closest datapoint among all basecurves "wins" and this 
is where we draw the marker.

Any thoughts?

-Ted


On Tuesday 08 November 2005 17:12, Matthew D Truch wrote:
> For the case of: Data mode -> curves don't exist, I think it's important
> that instead of x,y,z of image under the cursor, it needs to be nearest
> x,y,z that is data in the underlying matrix, with the appropriate
> 'datamode marker' indicating where that is.
>
> But this conflicts with the behavior of: data mode -> curves exist ->
> over an image, as if the x,y of the nearby curve are shown, there's no
> reason that it would coorespond with an x,y of the image's data.  The
> point of datamode is that you can see actual values that coorespond to
> actual data, not an interpolation thereof.

Comment 5 George Staikos 2005-11-09 02:35:15 UTC
 Yes it's just a matter of pushing that function up to the base class from 
KstVCurve and updating the data mode code to iterate on the right subset of 
objects.  The problem is that images will virtually always win I think.
Comment 6 Andrew Walker 2005-12-01 23:06:42 UTC
SVN commit 484776 by arwalker:

BUG:115970 Restore data mode for images. This provides the nearest data point for both the nearest curve and the topmost image.

 M  +120 -83   kst2dplot.cpp  
 M  +2 -1      kst2dplot.h