[vtk-developers] 2D API: Force chart to paint from another view?

Marcus D. Hanwell marcus.hanwell at kitware.com
Fri Aug 20 10:01:20 EDT 2010


On Wed, Aug 18, 2010 at 2:43 PM, Eric E. Monson <emonson at cs.duke.edu> wrote:

> Hey Marcus,
>
> I have been trying to develop a vtkContextItem which controls what data is
> plotted in an XY chart. If I give this control item a pointer to the chart I
> can change the input data, but if the control item is in a separate
> vtkContextView in another part of a GUI, I can't figure out if there's a way
> to force the chart to Paint with a call from this control item (without
> waiting until the user mouses-over the chart's window)?
>
> For now I'm getting around it by also handing the control item a pointer to
> the chart's context view so I can call Render, but it's just one more thing
> to remember to "wire up" when I'm setting up the control item. So, I was
> wondering whether there's a way of finding out from the chart either the
> vtkContext2D to use as an argument in a Paint call or what view the chart is
> in so I can force a Render?
>
> Hi Eric,

You could call render on the vtkContextView. The context item would only
know about its own scene, and so you would probably have to store a pointer
to the other view. This is possibly a place where adding an event/observer
would work well without causing everything to get too tightly coupled.

Marcus
--
Marcus D. Hanwell, Ph.D.
R&D Engineer, Kitware Inc.
(518) 881-4937
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20100820/33174719/attachment.html>


More information about the vtk-developers mailing list