*crosspost to get more detailed info*

2008/7/16 Alan W. Irwin <[EMAIL PROTECTED]>:
> On 2008-07-16 11:11+0800 Paul Harris wrote:
>
>> Hi,
>>
>> I'm new to plplot.  I'd like to utilise plplot to generate charts in my
>> program.
>>
>> I would like to be able to plot points as circles, lines or whatever,
>> and then be able to click on those markers and display additional info
>> elsewhere in my application.
>>
>> Has anyone done this?
>>
>> I would be getting the mouse click from the GUI (QT) and then either
>> passing it to plplot, or use some other mechanism to be able to map
>> that mouse coord to a marker.
>>
>> I don't see anything obvious in the docs or the code... so I was
>> thinking about how I'd do it.
>>
>> One way would be to write a driver that goes through the motions of
>> pretending to draw a chart, but instead is able to match up a mouse
>> coord to the markers that it is told to draw...
>>
>> so, has anyone done something like this?
>
> The core of PLplot supports interactive capability for those drivers
> that have it implemented.
>
> Our xwin device has interactive capability where you can display
> cross-hairs, move them around, and when a key is clicked, deliver the
> position of the crosshairs and the identity of the key which was clicked.
> To see this capability in action try the -locate option for C example 1 with
> -dev xwin.  -dev wxwidgets has similar capability, although I could only get
> the return key to work at this time.  I think there is a plan to implement
> at
> least the level of xwin capability in the xcairo device.  For example, you
> get some hits when you grep for "cross" in the cairo code.  However, I
> couldn't get it to work (no crosshairs were displayed with example 1 when
> the -locate option was used.)
>
> Anyhow, you could use these interactive capabilities for a start for
> doing something more interesting.  You may want to work with -dev wxwidgets
> or -dev xcairo since both have modern font capabilities while xwin does
> not.
>


Thanks Alan, I gave that a try, but its not going to give me the key
information that I'm interested in.

So I'll expand my question for the devel list, hopefully someone has
the know-how...

Is there some way of being able to tell what element of a plot was
clicked, given a coordinate of a click   (it could be a data, window
or global coordinate - whatever is required to get the job done)

Use-case would be a plot of a dozen points as circles, or squares, or
some other marker... user clicks mouse on a circle... plplot is able
to work out that user clicked on pixels belonging to that circle and
tell me what that point is (identification could be ID, dataset + row,
whatever)

cheers
Paul

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel

Reply via email to