@@ -0,0 +1,2279 @@
+import vtk.vtkActor;%0Aimport vtk.vtkNamedColors;%0Aimport vtk.vtkNativeLibrary;%0Aimport vtk.vtkPolyDataMapper;%0Aimport vtk.vtkRenderWindow;%0Aimport vtk.vtkRenderWindowInteractor;%0Aimport vtk.vtkRenderer;%0Aimport vtk.vtkSphereSource;%0A%0Apublic class MultipleViewports %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 s%5B%5D) %0A  %7B%0A    vtkNamedColors colors = new vtkNamedColors();%0A%0A    //For Actor Color%0A    double actorColor%5B%5D = new double%5B4%5D;%0A    //Renderer Background Color%0A    double Bgcolor%5B%5D = new double%5B4%5D;%0A%0A    colors.GetColor(%22Tomato%22, actorColor);%0A    colors.GetColor(%22DarkSeaGreen%22, Bgcolor);%0A    %0A    //  Define viewport ranges%0A    double xmins%5B%5D = new double%5B%5D %7B0,.5,0,.5%7D;%0A    double xmaxs%5B%5D = new double%5B%5D %7B0.5,1,0.5,1%7D;%0A    double ymins%5B%5D = new double%5B%5D %7B0,0,.5,.5%7D;%0A    double ymaxs%5B%5D = new double%5B%5D %7B0.5,0.5,1,1%7D;%0A%0A    vtkRenderWindow renWin = new vtkRenderWindow();%0A    vtkRenderWindowInteractor iren = new vtkRenderWindowInteractor();%0A    iren.SetRenderWindow(renWin);%0A    %0A    for(int i = 0; i %3C 4; i++)%0A    %7B%0A     vtkRenderer ren = new vtkRenderer();%0A     renWin.AddRenderer(ren);%0A     ren.SetViewport(xmins%5Bi%5D,ymins%5Bi%5D,xmaxs%5Bi%5D,ymaxs%5Bi%5D);%0A     %0A     // Create a sphere%0A     vtkSphereSource sphereSource = new vtkSphereSource();%0A     sphereSource.SetCenter(0.0, 0.0, 0.0);%0A     phereSource.SetRadius(5);%0A     sphereSource.Update();%0A     %0A     // Create a mapper and actor%0A     vtkPolyDataMapper mapper = new vtkPolyDataMapper();%0A     mapper.SetInputConnection(sphereSource.GetOutputPort());%0A     vtkActor actor = new vtkActor();%0A     actor.SetMapper(mapper);%0A     ren.AddActor(actor);%0A     ren.ResetCamera();%0A     %0A     renWin.Render();%0A     renWin.SetWindowName(%22Multiple ViewPorts%22);%0A    %7D    %0A%0A    iren.Initialize();%0A    iren.Start();%0A  %7D%0A%7D%0A

Create MultipleViewports.java