[vtkusers] VTK6 and Java Examples

Gerrick Bivins Gerrick.Bivins at halliburton.com
Mon Aug 5 08:40:45 EDT 2013


HA!
Yes, those are out of date BUT I believe you'll have more luck looking here:
{VTK_SOURCE_HOME}\VTK6.0.0\Wrapping\Java\vtk\sample

And here:
http://www.vtk.org/Wiki/VTK/Java_Wrapping


Gerrick
From: vtkusers-bounces at vtk.org [mailto:vtkusers-bounces at vtk.org] On Behalf Of Ric Wright
Sent: Monday, August 05, 2013 7:02 AM
To: vtkusers at vtk.org
Subject: [vtkusers] VTK6 and Java Examples

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 (http://blogs.geofx.com/).

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:

// In the static contructor we load in the native code.
// The libraries must be in your path to work.
static {
   System.loadLibrary("vtkCommonJava");
   System.loadLibrary("vtkFilteringJava");
   System.loadLibrary("vtkIOJava");
   System.loadLibrary("vtkImagingJava");
   System.loadLibrary("vtkGraphicsJava");
   System.loadLibrary("vtkRenderingJava");
}

  This doesn't work with VTK 6.0.0.  Instead, one gets an exception

  java.lang.UnsatisfiedLinkError: no vtkCommonJava in java.library.path

  This turns out to be reasonable as there is no vtkCommonJava library in the lib folder.

  In the example Cone2.java, the loading of libraries is significantly different:

       // Load VTK library and print which library was not properly loaded
       static
       {
      if (!vtkNativeLibrary.LoadAllNativeLibraries())
            {
                  for (vtkNativeLibrary lib : vtkNativeLibrary.values())
                  {
                        if (!lib.IsLoaded())
                        {
                              System.out.println(lib.GetLibraryName() + " not loaded");
                        }
                  }
            }
            vtkNativeLibrary.DisableOutputWindow(null);
      }

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?

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?

TIA,
Ric

----------------------------------------------------------------------
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/20130805/a6d0b96c/attachment.htm>


More information about the vtkusers mailing list