MCPcopy Create free account
hub / github.com/Kitware/VTK / main

Method main

Wrapping/Java/vtk/sample/rendering/SwtConeRendering.java:28–71  ·  view source on GitHub ↗
(String[] args)

Source from the content-addressed store, hash-verified

26 }
27
28 public static void main(String[] args) {
29
30 Display display = new Display();
31 Shell shell = new Shell(display);
32
33 // build VTK Pipeline
34 vtkConeSource cone = new vtkConeSource();
35 cone.SetResolution(8);
36
37 vtkPolyDataMapper coneMapper = new vtkPolyDataMapper();
38 coneMapper.SetInputConnection(cone.GetOutputPort());
39
40 vtkActor coneActor = new vtkActor();
41 coneActor.SetMapper(coneMapper);
42
43 // VTK rendering part
44 final vtkSwtComponent swtWidget = new vtkSwtComponent(shell);
45 swtWidget.getRenderer().AddActor(coneActor);
46
47 shell.addControlListener(new ControlListener() {
48
49 @Override
50 public void controlResized(ControlEvent e) {
51 if (e.widget instanceof Shell) {
52 Shell s = (Shell) e.widget;
53 swtWidget.setSize(s.getClientArea().width, s.getClientArea().height);
54 }
55 }
56
57 @Override
58 public void controlMoved(ControlEvent e) {
59 // TODO Auto-generated method stub
60
61 }
62 });
63
64 shell.pack();
65 shell.open();
66 while (!shell.isDisposed()) {
67 if (!display.readAndDispatch())
68 display.sleep();
69 }
70 display.dispose();
71 }
72}

Callers

nothing calls this directly

Calls 9

packMethod · 0.80
getRendererMethod · 0.65
SetResolutionMethod · 0.45
SetInputConnectionMethod · 0.45
GetOutputPortMethod · 0.45
SetMapperMethod · 0.45
AddActorMethod · 0.45
openMethod · 0.45
disposeMethod · 0.45

Tested by

no test coverage detected