<div dir="ltr">Hi Gerrick,<div><br></div><div style>I don't know which version of VTK you are using, but if you are using the latest release (still in RC),</div><div style>you have a proper SWT renderering component that may work slightly better.</div>
<div style><br></div><div style>Although, one thing that could be the issue here is that some of the methods that you call (the one that dead lock) internally generate the render window while that one is not visible in the Java/SWT context.</div>
<div style>What I'm saying is you may need to do your setup in 2 steps. First step, setup the UI container and then 'later', once the graphical component is visible, intialize the VTK renderer the way you want.</div>
<div style><br></div><div style>Seb</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Jun 12, 2013 at 12:21 PM, Gerrick Bivins <span dir="ltr"><<a href="mailto:Gerrick.Bivins@halliburton.com" target="_blank">Gerrick.Bivins@halliburton.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div lang="EN-US" link="blue" vlink="purple">
<div>
<p class="MsoNormal">Hi All,<u></u><u></u></p>
<p class="MsoNormal">I have an application that embeds an AWT canvas, vtkCanvas, in an SWT Composite using the SWT_AWT bridge.
<u></u><u></u></p>
<p class="MsoNormal">The issue I’m having has only shown itself on one machine but the symptoms are really strange.<u></u><u></u></p>
<p class="MsoNormal">Basically, if I follow all the rules about creating actors, modifying the pipeline etc as described here:<u></u><u></u></p>
<p class="MsoNormal"><a href="http://www.vtk.org/Wiki/VTK/Java_Wrapping#Threading_Sample_Code_.28from_VTK.2FWrapping.2FJava.2Fvtk.2Fsample.2FDemo.java.29" target="_blank">http://www.vtk.org/Wiki/VTK/Java_Wrapping#Threading_Sample_Code_.28from_VTK.2FWrapping.2FJava.2Fvtk.2Fsample.2FDemo.java.29</a><u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">it’s all gravy.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">However, on a particular machine I have two issues:<u></u><u></u></p>
<p><u></u><span>1)<span style="font:7.0pt "Times New Roman"">
</span></span><u></u>if I turn on a gradient background as described here:<u></u><u></u></p>
<p><a href="http://www.vtk.org/Wiki/VTK/Examples/Cxx/Visualization/BackgroundGradient" target="_blank">http://www.vtk.org/Wiki/VTK/Examples/Cxx/Visualization/BackgroundGradient</a><u></u><u></u></p>
<p>the app locks up. I enable it by calling vtkRenderer.GradientBackgroundOn() so I’m not sure if I can<u></u><u></u></p>
<p>make this call in a java application and where it’s valid to do so because the native code is<u></u><u></u></p>
<p>doing more than just setting the “GradientBackground” variable.
<u></u><u></u></p>
<p><u></u><span>2)<span style="font:7.0pt "Times New Roman"">
</span></span><u></u>Similar but different, if I add a vtkAxesActor to the renderer, it cannot be enabled until some time later. Ambiguous, I know!!!<u></u><u></u></p>
<p>Basically, if I set up the code similar to this example:<u></u><u></u></p>
<p><a href="http://www.vtk.org/Wiki/VTK/Examples/Cxx/Visualization/DisplayCoordinateAxes" target="_blank">http://www.vtk.org/Wiki/VTK/Examples/Cxx/Visualization/DisplayCoordinateAxes</a><u></u><u></u></p>
<p>the calls to widget.SetEnabled(1) causes the application to hang. If I set it to widget.SetEnabled(0)<u></u><u></u></p>
<p class="MsoNormal"> and then sometime later (not sure the condition here for what is “later”)toggle it on. It works as expected.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">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.<u></u><u></u></p>
<p class="MsoNormal">As I’ve stated earlier, this setup works on most machines but we ran into a case where, it fails.
<u></u><u></u></p>
<p class="MsoNormal">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.<u></u><u></u></p>
<p class="MsoNormal">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<u></u><u></u></p>
<p class="MsoNormal">it wasn’t noticeable and succeeded but on the failing machine, it was more obvious and seem to freeze here.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">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<u></u><u></u></p>
<p class="MsoNormal">vtkRenderwindowinteractor methods are triggered (Start,Initialize) .It’s “state” at any time is confusing to me when going through the vtkCanvas/vtkPanel<u></u><u></u></p>
<p class="MsoNormal">Java layer.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Gerrick<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<hr>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.<br>
</div>
<br>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
<br></blockquote></div><br></div>