[vtkusers] Re: Java vtkPanel translate problem
Jeff Lee
jeff at cdnorthamerica.com
Fri Feb 21 07:40:59 EST 2003
I tried vtkCanvas too and it seems to be behaving as expected, although
I am running on linux. I'll follow up with someone else who has a win32
build. Do the tcl/c++ examples have the same problem? The vtkCanvas
test is using vtkGenericRenderWindowInteractor with a default interactor
style. Try hitting 't' in the window and that will switch to trackball
mode - does the problem still occur? What jdk are you using?
-Jeff
Brandon Douthit-Wood wrote:
>Jeff,
>It appears that the vtkCanvas may be the culprit. If you try to run
>this sample program that came with my download of VTK, it exhibits the
>same behavior when you try doing a translate.
>
>/////////////////////////////////
>
>import java.awt.*;
>import java.awt.event.*;
>import javax.swing.*;
>import vtk.*;
>
>public class TestVTKCanvas extends JPanel {
>
> public TestVTKCanvas() {
> setLayout(new BorderLayout());
> // Create the buttons.
> vtkCanvas renWin = new vtkCanvas();
> add(renWin, BorderLayout.CENTER);
> vtkConeSource cone = new vtkConeSource();
> cone.SetResolution(8);
> vtkPolyDataMapper coneMapper = new vtkPolyDataMapper();
> coneMapper.SetInput(cone.GetOutput());
>
> vtkActor coneActor = new vtkActor();
> coneActor.SetMapper(coneMapper);
>
> renWin.GetRenderer().AddActor(coneActor);
> AxesActor aa = new AxesActor(renWin.GetRenderer());
> renWin.GetRenderer().AddActor(aa);
> }
>
>
> public static void main(String s[])
> {
> TestVTKCanvas panel = new TestVTKCanvas();
> TestVTKCanvas panel2 = new TestVTKCanvas();
>
> JFrame frame = new JFrame("VTK Canvas Test");
> frame.getContentPane().setLayout(new GridLayout(2,1));
> frame.addWindowListener(new WindowAdapter()
> {
> public void windowClosing(WindowEvent e) {System.exit(0);}
> });
> frame.getContentPane().add(panel);
> frame.getContentPane().add(panel2);
> frame.pack();
> frame.setVisible(true);
> }
>}
>
>/////////////////////////////////////////
>
>Thanks again,
>
>--
>Brandon Douthit
>
>
>_______________________________________________
>This is the private VTK discussion list.
>Please keep messages on-topic. Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
>Follow this link to subscribe/unsubscribe:
>http://public.kitware.com/mailman/listinfo/vtkusers
>
>
>
>
>
More information about the vtkusers
mailing list