@@ -0,0 +1,1664 @@
+import vtk.vtkNativeLibrary;%0Aimport vtk.vtkPoints;%0Aimport vtk.vtkTriangle;%0Aimport vtk.vtkCellArray;%0Aimport vtk.vtkPolyData;%0A%0Apublic class AddCell%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 triangle%0A    vtkPoints points = new vtkPoints();%0A    points.InsertNextPoint ( 1.0, 0.0, 0.0 );%0A    points.InsertNextPoint ( 0.0, 0.0, 0.0 );%0A    points.InsertNextPoint ( 0.0, 1.0, 0.0 );%0A%0A    vtkTriangle triangle = new vtkTriangle();%0A    triangle.GetPointIds().SetId ( 0, 0 );%0A    triangle.GetPointIds().SetId ( 1, 1 );%0A    triangle.GetPointIds().SetId ( 2, 2 );%0A    %0A    vtkCellArray triangles = new vtkCellArray();%0A    triangles.InsertNextCell ( triangle );%0A%0A    // Create a polydata object%0A    vtkPolyData polyData = new vtkPolyData();%0A%0A    // Add the geometry and topology to the polydata%0A    polyData.SetPoints ( points );%0A    polyData.SetPolys ( triangles );%0A        %0A    System.out.println(%22There are %22 + %22 %22 + polyData.GetNumberOfCells() + %22 %22 + %22cells.%22);%0A    polyData.GetPolys().InsertNextCell(triangle);%0A    System.out.println(%22There are %22 + %22 %22 + polyData.GetNumberOfCells() + %22 %22 + %22cells.%22);%0A%0A  %7D%0A%7D%0A

Create AddCell.java