[vtkusers] vtk 5.10.1, vtkCanvas, SWT/AWT : app hangs when vtkorientationmarkerwidget/vtkaxesactor added and/or gradient background enabled

Gerrick Bivins Gerrick.Bivins at halliburton.com
Wed Jun 12 12:21:20 EDT 2013


Hi All,
I have an application that embeds an AWT canvas, vtkCanvas, in an SWT Composite using the SWT_AWT bridge.
The issue I'm having has only shown itself on one machine but the symptoms are really strange.
Basically, if I follow all the rules about creating actors, modifying the pipeline etc as described here:
http://www.vtk.org/Wiki/VTK/Java_Wrapping#Threading_Sample_Code_.28from_VTK.2FWrapping.2FJava.2Fvtk.2Fsample.2FDemo.java.29

it's all gravy.

However, on a particular machine I have two issues:

1)      if I turn on a gradient background as described here:

http://www.vtk.org/Wiki/VTK/Examples/Cxx/Visualization/BackgroundGradient

the app locks up. I enable it by calling vtkRenderer.GradientBackgroundOn()  so I'm not sure if I can

make this call in a java application and where it's valid to do so because the native code is

doing more than just setting the "GradientBackground" variable.

2)      Similar but different, if I add a vtkAxesActor to the renderer, it cannot be enabled until some time later. Ambiguous, I know!!!

Basically, if I set up the code similar to this example:

http://www.vtk.org/Wiki/VTK/Examples/Cxx/Visualization/DisplayCoordinateAxes

the calls to widget.SetEnabled(1) causes the application to hang. If I set it to widget.SetEnabled(0)
               and then sometime later (not sure the condition here for what is "later")toggle it on. It works as expected.

Everything is setup to check for the EDT and execute properly on the EDT or invokeLater on the EDT so it doesn't seem like that's the issue.
As I've stated earlier, this setup works on most machines but we ran into a case where, it fails.
What I've noticed when it hangs is that there are two AWT Event threads(0 and 1) and it looks like a window pops up external to the SWT composite.
Then it tries to pull (or create another one) and put it in the composite. On the 4 or 5 machines we internally tested on
it wasn't noticeable and succeeded but on the failing machine, it was more obvious and seem to freeze here.

Long post, but if anyone has any advice here, it would be greatly appreciated. One confusing thing is that I don't know when the
vtkRenderwindowinteractor methods are triggered (Start,Initialize) .It's "state" at any time is confusing to me when going through the vtkCanvas/vtkPanel
Java layer.

Gerrick



----------------------------------------------------------------------
This e-mail, including any attached files, may contain confidential and privileged information for the sole use of the intended recipient.  Any review, use, distribution, or disclosure by others is strictly prohibited.  If you are not the intended recipient (or authorized to receive information for the intended recipient), please contact the sender by reply e-mail and delete all copies of this message.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20130612/19fce533/attachment.htm>


More information about the vtkusers mailing list