()
| 39 | |
| 40 | // ----------------------------------------------------------------- |
| 41 | public SimpleVTK() { |
| 42 | super(new BorderLayout()); |
| 43 | |
| 44 | // build VTK Pipeline |
| 45 | vtkConeSource cone = new vtkConeSource(); |
| 46 | cone.SetResolution(8); |
| 47 | |
| 48 | vtkPolyDataMapper coneMapper = new vtkPolyDataMapper(); |
| 49 | coneMapper.SetInputConnection(cone.GetOutputPort()); |
| 50 | |
| 51 | vtkActor coneActor = new vtkActor(); |
| 52 | coneActor.SetMapper(coneMapper); |
| 53 | |
| 54 | renWin = new vtkPanel(); |
| 55 | renWin.GetRenderer().AddActor(coneActor); |
| 56 | |
| 57 | // Add Java UI components |
| 58 | exitButton = new JButton("Exit"); |
| 59 | exitButton.addActionListener(this); |
| 60 | |
| 61 | add(renWin, BorderLayout.CENTER); |
| 62 | add(exitButton, BorderLayout.SOUTH); |
| 63 | } |
| 64 | |
| 65 | /** An ActionListener that listens to the button. */ |
| 66 | public void actionPerformed(ActionEvent e) { |
nothing calls this directly
no test coverage detected