@@ -0,0 +1,1607 @@
+import vtk.vtkNativeLibrary;%0Aimport vtk.vtkPoints;%0Aimport vtk.vtkPolyData;%0Aimport vtk.vtkOctreePointLocator;%0Apublic class BuildOctree %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    //  Setup point coordinates%0A    double x%5B%5D = new double%5B%5D %7B1.0, 0.0, 0.0%7D;%0A    double y%5B%5D = new double%5B%5D %7B0.0, 1.0, 0.0%7D;%0A    double z%5B%5D = new double%5B%5D %7B0.0, 0.0, 1.0%7D;%0A%0A    vtkPoints points = new vtkPoints();%0A%0A    for(int i = 0; i %3C 3; ++i)%0A    %7B%0A      points.InsertNextPoint ( x%5Bi%5D, y%5Bi%5D, z%5Bi%5D );%0A    %7D%0A    %0A    System.out.println(%22There are %22 + %22 %22 + points.GetNumberOfPoints() + %22 %22 + %22points.%22);%0A%0A    vtkPolyData polydata = new vtkPolyData();%0A    polydata.SetPoints(points);%0A%0A    //Create the tree%0A    vtkOctreePointLocator octree = new vtkOctreePointLocator();%0A    octree.SetDataSet(polydata);%0A    octree.BuildLocator();%0A    System.out.println(%22Number of points in tree: %22 + %22 %22 + octree.GetDataSet().GetNumberOfPoints());%0A    %0A    double p%5B%5D = new double%5B3%5D;%0A    octree.GetDataSet().GetPoint(0,p);%0A    System.out.println(%22p: %22 + %22 %22 + p%5B0%5D + %22 %22 + p%5B1%5D + %22 %22 +p%5B2%5D);%0A  %7D%0A%7D%0A

Create BuildOctree.java