[vtkusers] Mantain VTK interactor functionalities in Java (with Swing)

arturex arturo_caissut at tiscali.it
Fri Apr 22 06:50:45 EDT 2011


Hi Sebastien,

still nothing. If I use a vtkPanel I get an interactor, but it's behaviour
it's not the one I want despite of the style I assign to it. If I use a
vtkCanvas I don't get any interaction at all.

Here's some code, can you see any flaw?


JPanel javaPanel = new JPanel();
vtkPanel vPanel = new vtkPanel();
vtkRenderWindowInteractor iren = new vtkRenderWindowInteractor();
iren.SetInteractorStyle(new vtkInteractorStyleImage());

plane.SetCurrentRenderer(vPanel.GetRenderer()); //plane is a
vtkImagePlaneWidget object
vPanel.GetRenderWindow().SetInteractor(iren);
plane.SetInteractor(iren);
plane.On();

javaPanel.add(vPanel);  //I cannot directly add my vtkPanel to the JFrame
due to design needs
javaframe.add(javaPanel);
javaFrame.setVisible(true);

--
View this message in context: http://vtk.1045678.n5.nabble.com/Mantain-VTK-interactor-functionalities-in-Java-with-Swing-tp4313483p4332752.html
Sent from the VTK - Users mailing list archive at Nabble.com.



More information about the vtkusers mailing list