<div dir="ltr">Hi Ric,<div><br></div><div style>you are correct those wiki example seems to be out of date specially since the modularization of VTK where all the libraries have been renamed and shift around. </div><div style>
<br></div><div style>The best place to look for up-to-date examples is in the vtk.jar itself which should contains a set of sample code with the proper usage of rendering and GC classes as well as the loading of the libraries. </div>
<div style><br></div><div style>And Gerrick just beat me... ;-)</div><div style><br></div><div style>Good luck,</div><div style><br></div><div style>Seb</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">
On Mon, Aug 5, 2013 at 8:02 AM, Ric Wright <span dir="ltr"><<a href="mailto:rkwright@geofx.com" target="_blank">rkwright@geofx.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word;font-size:14px"><div><div style="font-family:Verdana,sans-serif">I recently pulled down VTK 6.0.0 and installed it. Getting it running provided to be a little more fun than I anticipated but I got there (<a href="http://blogs.geofx.com/" target="_blank">http://blogs.geofx.com/</a>).</div>
<div style="font-family:Verdana,sans-serif"><br></div><div style="font-family:Verdana,sans-serif">However, part of my confusion arose from what I believe is out of date tutorials. In the first Java tutorial, the first part pf the example has a "load library" method:</div>
<div style="font-family:Verdana,sans-serif"><br></div><blockquote style="margin:0px 0px 0px 40px;padding:0px;border:none"><div><font face="Consolas">// In the static contructor we load in the native code.</font></div><div>
<font face="Consolas">// The libraries must be in your path to work.</font></div><div><font face="Consolas">static {</font></div><div><font face="Consolas"> System.loadLibrary("vtkCommonJava");</font></div><div>
<font face="Consolas"> System.loadLibrary("vtkFilteringJava");</font></div><div><font face="Consolas"> System.loadLibrary("vtkIOJava");</font></div><div><font face="Consolas"> System.loadLibrary("vtkImagingJava");</font></div>
<div><font face="Consolas"> System.loadLibrary("vtkGraphicsJava");</font></div><div><font face="Consolas"> System.loadLibrary("vtkRenderingJava");</font></div><div><font face="Consolas">}</font></div>
</blockquote><div style="font-family:Verdana,sans-serif"><br></div><div style="font-family:Verdana,sans-serif"> This doesn't work with VTK 6.0.0. Instead, one gets an exception</div><div style="font-family:Verdana,sans-serif">
<br></div><div><span style="font-family:Verdana,sans-serif"> </span><font face="Consolas" color="#ff0000">java.lang.UnsatisfiedLinkError: no vtkCommonJava in java.library.path</font></div><div style="font-family:Verdana,sans-serif">
<br></div><div style="font-family:Verdana,sans-serif"> This turns out to be reasonable as there is no vtkCommonJava library in the lib folder.</div><div style="font-family:Verdana,sans-serif"><br></div><div style="font-family:Verdana,sans-serif">
In the example Cone2.java, the loading of libraries is significantly different:</div><div style="font-family:Verdana,sans-serif"><br></div><div style><font face="Consolas"> // Load VTK library and print which library was not properly loaded</font></div>
<div style><font face="Consolas"> static</font></div><div style><font face="Consolas"> {</font></div><div style><font face="Consolas"><span style="white-space:pre-wrap">        </span>if (!vtkNativeLibrary.LoadAllNativeLibraries())</font></div>
<div style><font face="Consolas"><span style="white-space:pre-wrap">                </span>{</font></div><div style><font face="Consolas"><span style="white-space:pre-wrap">                        </span>for (vtkNativeLibrary lib : vtkNativeLibrary.values())</font></div>
<div style><font face="Consolas"><span style="white-space:pre-wrap">                        </span>{</font></div><div style><font face="Consolas"><span style="white-space:pre-wrap">                                </span>if (!lib.IsLoaded())</font></div><div style><font face="Consolas"><span style="white-space:pre-wrap">                                </span>{</font></div>
<div style><font face="Consolas"><span style="white-space:pre-wrap">                                        </span>System.out.println(lib.GetLibraryName() + " not loaded");</font></div><div style><font face="Consolas"><span style="white-space:pre-wrap">                                </span>}</font></div>
<div style><font face="Consolas"><span style="white-space:pre-wrap">                        </span>}</font></div><div style><font face="Consolas"><span style="white-space:pre-wrap">                </span>}</font></div><div style><font face="Consolas"><span style="white-space:pre-wrap">                </span>vtkNativeLibrary.DisableOutputWindow(null);</font></div>
<div style><font face="Consolas"><span style="white-space:pre-wrap">        </span>}</font></div><div style="font-family:Verdana,sans-serif"><br></div><div style="font-family:Verdana,sans-serif">This works fine. As it turns out, only the example Cone2.java uses the "correct" method for loading the libraries. Am I correct in assuming that Cone 1 and Cone3-5 are simply out-of-date with respect to VTK 6.0.0? Or am I missing something?</div>
<div style="font-family:Verdana,sans-serif"><br></div><div style="font-family:Verdana,sans-serif">I also note that only the simple "Sample" folder with its Cone examples even has Java implementations. I guess I am on my own to convert the examples to Java myself (which is fine, that will be a good learning exercise) or will that be a Quixotic effort on my part, tilting at an incomplete Java windmill?</div>
<div style="font-family:Verdana,sans-serif"><br></div><div style="font-family:Verdana,sans-serif">TIA,</div><div style="font-family:Verdana,sans-serif">Ric</div></div><div style="font-family:Verdana,sans-serif"><br></div>
</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>