[vtkusers] vtkChartXY point selection with mouse button and qvtkWidget renderview problem on qt MDI area

Eric E. Monson emonson at cs.duke.edu
Fri Jun 3 15:05:44 EDT 2011


Hello,

The Charts (like vtkChartXY) don't use the normal VTK interactors for handling mouse events, so I'm afraid the example you found won't help you much with this. Also, how the Charts are implemented will depend on which version of VTK you are using: 5.6 had a much earlier version of the 2D Charts API, and there has been a lot of work since then in the development version (which you can get from the Git repository). Hopefully there will be a 5.8 release soon, but for now if you are using the Charts I'd recommend working from the development head rather than 5.6 so you can take advantage of some of the improvements.

Hopefully Marcus will chime in if I get any of this wrong, but currently the only type of selection that is handled in the XY Charts is a rubber-band type selection of a point or group of points. You can set which mouse button is used for Pan, Zoom or Select, but how the selections are done is hard-coded in the vtkChartXY mouse event handlers. So, right now there isn't any support built in for single click selections, or for adding to or subtracting from selection (by pressing Shift, or something). So, as things stand now (and I don't know whether there is any work going on currently to change this), you would have to subclass vtkChartXY and override the mouse event handlers, among other things, to change how selections are done. 

Also, right now tooltips are only shown for a single point you are hovering over, not for multiple selected points, and I don't think there is support built in for point labels. You would have to add this behavior in to your new chart subclass.

Sorry I don't have any idea about the overlapping windows problem. Hopefully someone else has used the Qt MDIArea and might have some ideas.

Talk to you later,
-Eric

· · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · ·
Eric E Monson
Duke Visualization Technology Group


On Jun 3, 2011, at 12:34 PM, Giuseppe Marco Randazzo wrote:

> Hi, 
> i'm new in vtk. i read about some example for learning how to use vtk api and 
> these are pretty good.  But now i've a problem: i need to handle the mouse 
> buttons for:
> - set one of these 3 button for select some points on a vtkChartXY
> - set an other for select one by one the point on this vtkChartXY and show the 
> label o the picked point.
> 
> By searching on the vtk example i found only this that explain how to handle 
> the mouse button:
> 
> http://www.vtk.org/Wiki/VTK/Examples/Cxx/Interaction/MouseEvents
> 
> 
> The second problem is this on the renderview of a qvtkWidget inside a qt 
> MDIArea. Here is an image for show you what happens:
> 
> http://imageshack.us/photo/my-images/18/screenshot1uj.png/
> 
> It's possible solve this problem of overlap between window? how?
> 
> Thanks
> 
> zeld
> 
> _______________________________________________
> Powered by www.kitware.com
> 
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
> 
> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
> 
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers




More information about the vtkusers mailing list