@@ -0,0 +1,2272 @@
+import vtk.vtkActor;%0Aimport vtk.vtkNativeLibrary;%0Aimport vtk.vtkRenderWindow;%0Aimport vtk.vtkRenderWindowInteractor;%0Aimport vtk.vtkRenderer;%0Aimport vtk.vtkRectilinearGrid;%0Aimport vtk.vtkDoubleArray;%0Aimport vtk.vtkShrinkFilter;%0Aimport vtk.vtkDataSetMapper;%0A%0Apublic class VisualizeRectilinearGrid %0A%7B%0A  // -----------------------------------------------------------------%0A  // Load VTK library and print which library was not properly loaded%0A  static %0A  %7B%0A    if (!vtkNativeLibrary.LoadAllNativeLibraries()) %0A    %7B%0A      for (vtkNativeLibrary lib : vtkNativeLibrary.values()) %0A      %7B%0A        if (!lib.IsLoaded()) %0A        %7B%0A          System.out.println(lib.GetLibraryName() + %22 not loaded%22);%0A        %7D%0A      %7D%0A    %7D%0A    vtkNativeLibrary.DisableOutputWindow(null);%0A  %7D%0A  // -----------------------------------------------------------------%0A%0A  public static void main(String args%5B%5D) %0A  %7B%0A    // Create a grid%0A    vtkRectilinearGrid grid = new vtkRectilinearGrid();%0A%0A    grid.SetDimensions(2,3,2);%0A%0A    vtkDoubleArray xArray = new vtkDoubleArray();%0A    xArray.InsertNextValue(0.0);%0A    xArray.InsertNextValue(2.0);%0A%0A    vtkDoubleArray yArray = new vtkDoubleArray();%0A    yArray.InsertNextValue(0.0);%0A    yArray.InsertNextValue(1.0);%0A    yArray.InsertNextValue(2.0);%0A%0A    vtkDoubleArray zArray = new vtkDoubleArray();%0A    zArray.InsertNextValue(0.0);%0A    zArray.InsertNextValue(5.0);%0A%0A    grid.SetXCoordinates(xArray);%0A    grid.SetYCoordinates(yArray);%0A    grid.SetZCoordinates(zArray);%0A%0A    vtkShrinkFilter shrinkFilter = new vtkShrinkFilter();%0A    shrinkFilter.SetInputData(grid);%0A    shrinkFilter.SetShrinkFactor(.8);%0A%0A    // Create a mapper and actor%0A    vtkDataSetMapper mapper = new vtkDataSetMapper();%0A    mapper.SetInputConnection(shrinkFilter.GetOutputPort());%0A%0A    vtkActor actor = new vtkActor();%0A    %0A    actor.SetMapper(mapper);%0A    %0A    // Create the renderer, render window and interactor.%0A    vtkRenderer ren = new vtkRenderer();%0A    vtkRenderWindow renWin = new vtkRenderWindow();%0A    renWin.AddRenderer(ren);%0A    vtkRenderWindowInteractor iren = new vtkRenderWindowInteractor();%0A    iren.SetRenderWindow(renWin);%0A    %0A    // Visualize%0A    ren.AddActor(actor);%0A%09%0A    renWin.SetSize(300, 300);%0A    renWin.Render();%0A%09%0A    iren.Initialize();%0A    iren.Start();%0A  %7D%0A%7D%0A

Create VisualizeRectilinearGrid.java