[vtkusers] Combine vtkChart with QVTKWidget

Marcus D. Hanwell marcus.hanwell at kitware.com
Fri May 3 10:32:55 EDT 2013


Hi,

On Fri, May 3, 2013 at 8:55 AM, curator <curator at gmx.de> wrote:
> Hi all,
>
> I am working with a QVTKWidget to display my geometry. Therefore each
> "object" has a own vtkActor and and I add these vtkActors to the renderer of
> QVTKWidget. So far, so good.
>
> To start with vtkCharts, I found the following example (see below). With
> this code, I am able to open a new vtkwindow which presents two plots.
> However, I dont want to open the chart in a new window, but insert it in the
> existing QVTKWidget IN ADDITION to the former scene. Actually, I want to
> have somethi g like in
> http://www.na-mic.org/Wiki/images/1/18/NA-MIC-VTK-Charts-2011.pdf on page
> 19. So, I though of inheriting another object which has a vtkActor and can
> be added and removed from my scene. Inside this class i would like to
> implement, as a starting point, the curves from the example, but I have no
> idea how to connect the vtkchart stuff with a vtkActor. Maybe this it a
> totally wrong approach.
>
I wrote those slides, and you can do that by adding a vtkContextActor
to the renderer, and we have a test demonstrating this,

https://github.com/Kitware/VTK/blob/master/Charts/Core/Testing/Cxx/TestChartsOn3D.cxx

The problem is that the chart will not receive interactive events, but
it can be shown as an overlay.

Hope that helps.

Marcus



More information about the vtkusers mailing list