[vtkusers] vtkPanel.addWindowSetObserver – where did it go?
Sebastien Jourdain
sebastien.jourdain at kitware.com
Tue Nov 29 00:02:53 EST 2011
Hi Jarek,
I did remove this observer thing because I didn't know it was useful.
First, to set the size on the vtkPanel/vtkCanvas, you should use the
setSize() method, which should now work properly by setting the
correct size to the interactor as well once the window is ready. If
not we need a test that illustrate such issue. In fact, this should
now work properly without writing any extra code as we use to need.
Second, for your picking example, you can simply set the picker right
away, although I agree you can not pick a cell by default as you don't
know if the panel is properly initialized. So if you can not live
without that then you should add a bug for requesting an API on
vtkPanel/vtkCanvas to get notified once the renderer get properly
initialized.
Although you have a method that let you know if the window is set or
not (isWindowSet()). This let you set a timer in the EDT that loop
until the window is set so you can do your operation of
initialization, especially the picking. (picker.Pick(85, 126, 0,
renWin.GetRenderer());)
Sorry about that change but I did it to clean up some legacy code,
Seb
On Mon, Nov 28, 2011 at 5:52 PM, Jarek Sacha
<jsacha at users.sourceforge.net> wrote:
> Before version 5.8 vtkPanel (Java Wrapper) had a method called
> addWindowSetObserver. It was used to notify the when a renderer (rendering
> window) was ready for performing operations like setting window size, adding
> pickers, and so on. This was critical to properly interact with a Java GUI.
>
> Is there a replacement for addWindowSetObserver?
>
> How to properly set a vtkPanel size? Typically it has to be done before it
> is rendered. Till 5.8 it was done using addWindowSetObserver to set a
> callback for call to set size when the rendering is happening for the first
> time.
>
> What about pickers? Like in AnnotatePick example, like 73:
>
> http://ij-plugins.svn.sourceforge.net/viewvc/ij-plugins/trunk/VTK-Examples/Examples/Annotation/Java/AnnotatePick.java?revision=917&view=markup
>
>
>
> Thanks,
>
>
>
> Jarek
>
> _______________________________________________
> 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