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

Eric E. Monson emonson at cs.duke.edu
Fri Aug 20 10:44:13 EDT 2010


Hey Marcus,

Thanks for getting back to me on this. For now I'm basically doing what you suggested and calling Render on the other view. I think you're right, though, that it would be better if I could figure out how to set up an event/observer to make it cleaner. I just wanted to make sure I wasn't missing a way in the public API to find the scene's view or the correct painter to call.

Talk to you later,
-Eric


On Aug 20, 2010, at 10:01 AM, Marcus D. Hanwell wrote:

> 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/4639645c/attachment.html>


More information about the vtk-developers mailing list