[vtkusers] vtk and Java
Bob Palank
bob at stlcc.org
Tue Aug 20 17:14:19 EDT 2002
Running in Borland JBuilder 60 - Java under XP Pro
1. I Rebuild the project and the build succeeds.
2. Project runs fine when the lines below are commented out.
// vtkConeSource cone = new vtkConeSource();
// cone.SetHeight( 3.0 );
// cone.SetRadius( 1.0 );
// cone.SetResolution( 10 );
3. when // vtkConeSource cone = new vtkConeSource(); is uncommented, the
build fails with the following error.
"cone02.java": Error #: 300 : class vtkConeSource not found in class
cone02.cone02 at line 27, column 6
4. I thought the import vtk.*; and System.loadLibrary() should get me beyond
this point, but I must be missing something!
TIA
Bob Palank
Fortunately, I had this running before I did a system rebuild!
The tutorial code follows.
=============================================================
Java Code follows:
// Source vtk Tutorial Step 1.
//
// This example creates a polygonal model of a cone, and then rendered it to
// the screen. It willrotate the cone 360 degrees and then exit. The basic
// setup of source -> mapper -> actor -> renderer -> renderwindow is
// typical of most VTK programs.
//
package cone02;
import vtk.*; // be sure to add a Path to d:\windows\system32 for vtk.jar
public class cone02 {
static {
System.loadLibrary("vtkCommonJava");
System.loadLibrary("vtkFilteringJava");
System.loadLibrary("vtkIOJava");
System.loadLibrary("vtkImagingJava");
System.loadLibrary("vtkGraphicsJava");
System.loadLibrary("vtkRenderingJava");
/* ======================================================
======================================================= */
}
public static void main(String[] args) {
// vtkConeSource cone = new vtkConeSource();
// cone.SetHeight( 3.0 );
// cone.SetRadius( 1.0 );
// cone.SetResolution( 10 );
System.out.println("20Aug02 Pass 05");
}
}
More information about the vtkusers
mailing list