Java AWT component that encapsulate vtkRenderWindow, vtkRenderer, vtkCamera, vtkLight. If a vtkInteractor is needed, use vtkCanvas instead. This is necessary when Widget and Picker are used. @author Kitware
| 23 | * @author Kitware |
| 24 | */ |
| 25 | public class vtkPanel |
| 26 | extends Canvas implements MouseListener, MouseMotionListener, MouseWheelListener, KeyListener |
| 27 | { |
| 28 | private static final long serialVersionUID = 1L; |
| 29 | protected vtkRenderWindow rw = new vtkOpenGLRenderWindow(); |
| 30 | protected vtkRenderer ren = new vtkRenderer(); |
| 31 | protected vtkCamera cam = null; |
| 32 | protected vtkLight lgt = new vtkLight(); |
| 33 | protected int lastX; |
| 34 | protected int lastY; |
| 35 | protected int windowset = 0; |
| 36 | protected int lightingset = 0; |
| 37 | protected int LightFollowCamera = 1; |
| 38 | protected int InteractionMode = 1; |
| 39 | protected boolean rendering = false; |
| 40 | |
| 41 | // Allow access to display lock() and unlock(). |
| 42 | // Call these whenever you call something that causes |
| 43 | // a Render(). |
| 44 | // e.g. |
| 45 | // panel.lock(); |
| 46 | // // Code that causes a render |
| 47 | // panel.unlock(); |
| 48 | public void lock() { Lock(); } |
| 49 | |
| 50 | public void unlock() { UnLock(); } |
| 51 | |
| 52 | public void Delete() |
| 53 | { |
| 54 | if (rendering) |
| 55 | { |
| 56 | return; |
| 57 | } |
| 58 | rendering = true; |
| 59 | // We prevent any further rendering |
| 60 | |
| 61 | if (this.getParent() != null) |
| 62 | { |
| 63 | this.getParent().remove(this); |
| 64 | } |
| 65 | // Free internal VTK objects |
| 66 | ren = null; |
| 67 | cam = null; |
| 68 | lgt = null; |
| 69 | // On linux we prefer to have a memory leak instead of a crash |
| 70 | if (!rw.GetClassName().equals("vtkXOpenGLRenderWindow")) |
| 71 | { |
| 72 | rw = null; |
| 73 | } |
| 74 | else |
| 75 | { |
| 76 | System.out.println("The renderwindow has been kept around to prevent a crash"); |
| 77 | } |
| 78 | } |
| 79 | |
| 80 | protected native int RenderCreate(vtkRenderWindow id0); |
| 81 | |
| 82 | protected native int Lock(); |
nothing calls this directly
no outgoing calls
no test coverage detected