()
| 28 | public static void main(String[] args) { |
| 29 | SwingUtilities.invokeLater(new Runnable() { |
| 30 | public void run() { |
| 31 | // build VTK Pipeline |
| 32 | vtkConeSource cone = new vtkConeSource(); |
| 33 | cone.SetResolution(8); |
| 34 | |
| 35 | vtkPolyDataMapper coneMapper = new vtkPolyDataMapper(); |
| 36 | coneMapper.SetInputConnection(cone.GetOutputPort()); |
| 37 | |
| 38 | vtkActor coneActor = new vtkActor(); |
| 39 | coneActor.SetMapper(coneMapper); |
| 40 | |
| 41 | // VTK rendering part |
| 42 | vtkAwtComponent awtWidget = new vtkAwtComponent(); |
| 43 | awtWidget.getRenderer().AddActor(coneActor); |
| 44 | |
| 45 | // UI part |
| 46 | JFrame frame = new JFrame("SimpleVTK"); |
| 47 | frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); |
| 48 | frame.getContentPane().setLayout(new BorderLayout()); |
| 49 | frame.getContentPane().add(awtWidget.getComponent(), |
| 50 | BorderLayout.CENTER); |
| 51 | frame.setSize(400, 400); |
| 52 | frame.setLocationRelativeTo(null); |
| 53 | frame.setVisible(true); |
| 54 | } |
| 55 | }); |
| 56 | } |
| 57 | } |
nothing calls this directly
no test coverage detected