@@ -0,0 +1,2690 @@
+import vtk.vtkActor;%0Aimport vtk.vtkSphereSource;%0Aimport vtk.vtkNativeLibrary;%0Aimport vtk.vtkPolyDataMapper;%0Aimport vtk.vtkRenderWindow;%0Aimport vtk.vtkRenderWindowInteractor;%0Aimport vtk.vtkRenderer;%0Aimport vtk.vtkNamedColors;%0Aimport vtk.vtkCursor2D;%0A%0Apublic class Cursor2D%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%09%0A  public static void main(String s%5B%5D) %0A  %7B%09%09%09%09%09%0A    vtkNamedColors colors = new vtkNamedColors();%0A%0A    //For Actor Color%0A    double actorColor%5B%5D = new double%5B4%5D;%0A    //For Cursor Actor Color%0A    double CursorActorColor%5B%5D = new double%5B4%5D;%0A    //Renderer Background Color%0A    double Bgcolor%5B%5D = new double%5B4%5D;%0A%0A    colors.GetColor(%22Crimson%22, actorColor);%0A    colors.GetColor(%22White%22, CursorActorColor);%0A    colors.GetColor(%22CadetBlue%22, Bgcolor);%0A%0A    //Create a Sphere%0A    vtkSphereSource Sphere = new vtkSphereSource();%0A    Sphere.SetCenter(0.0,0.0,0.0);%0A    Sphere.SetRadius(5.0);%0A    Sphere.Update();%0A%0A    //Create a Mapper and Actor%0A    vtkPolyDataMapper Mapper = new vtkPolyDataMapper();%0A    Mapper.SetInputConnection(Sphere.GetOutputPort());%0A%0A    vtkActor Actor = new vtkActor();%0A    Actor.SetMapper(Mapper);%0A    Actor.GetProperty().SetColor(actorColor);%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    // Visualise the Actor%0A    ren.AddActor(Actor);%0A    ren.SetBackground(Bgcolor);%0A    %0A    //Setup 2D cursor representation%0A    vtkCursor2D Cursor = new vtkCursor2D();%0A    Cursor.SetModelBounds(-10, 10, -10, 10, 0, 0);%0A    Cursor.AllOn();%0A    Cursor.SetFocalPoint(5.0, 5.0, 5.0);%0A    Cursor.OutlineOn();%0A    Cursor.Update();%0A    %0A    //Mapper for Cursor%0A    vtkPolyDataMapper CursorMapper = new vtkPolyDataMapper();%0A    CursorMapper.SetInputConnection(Cursor.GetOutputPort());%0A    %0A    //Cursor Actor%0A    vtkActor CursorActor = new vtkActor();%0A    CursorActor.SetMapper(CursorMapper);%0A    CursorActor.GetProperty().SetColor(CursorActorColor);%0A    ren.AddActor(CursorActor);%0A%0A    ren.ResetCamera();%0A    iren.Start();%0A%09%0A  %7D%09%09  %0A%7D%0A

Create Cursor2D.java