@@ -0,0 +1,1639 @@
+import vtk.vtkNativeLibrary;%0Aimport vtk.vtkStructuredGrid;%0Aimport vtk.vtkPoints;%0Aimport vtk.vtkXMLStructuredGridWriter;%0A%0A%0Apublic class XMLStructuredGridWriter%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    %0A    //parse command line arguments%0A    if (args.length != 1) %0A    %7B%0A      System.err.println(%22Usage: java -classpath ... Filename(.vts) e.g output.vts%22);%0A      return;%0A    %7D%0A    String Filename = args%5B0%5D;%0A    %0A    // Create a grid%0A    vtkStructuredGrid structuredGrid = new vtkStructuredGrid();%0A    %0A    vtkPoints points = new vtkPoints();%0A    points.InsertNextPoint(0, 0, 0);%0A    points.InsertNextPoint(1, 0, 0);%0A    points.InsertNextPoint(0, 1, 0);%0A    points.InsertNextPoint(1, 1, 0);%0A    points.InsertNextPoint(0, 2, 0);%0A    points.InsertNextPoint(1, 2, 1);%0A    %0A    // Specify the dimensions of the grid%0A    structuredGrid.SetDimensions(2,3,1);%0A    structuredGrid.SetPoints(points);%0A    %0A    // Write file%0A    vtkXMLStructuredGridWriter writer = new vtkXMLStructuredGridWriter();%0A    writer.SetFileName(Filename);%0A    writer.SetInputData(structuredGrid);%0A    writer.Write();%0A%0A  %7D%0A%7D%0A

Create XMLStructuredGridWriter.java