[vtkusers] Java, SWT and SetInputConnection vs SetInput

Gerrick Bivins Gerrick.Bivins at halliburton.com
Wed Dec 12 09:01:06 EST 2012


Hello,
I'm in the process of evaluating vtk in an Eclipse RCP application.
I've successfully used vtk in NetBeans RCP applications so I'm hoping for a similarly successful out come!
Anyway, while experimenting with SWT, I've run into an issue where my SWT component that embeds a vtkPanel
brings the entire application down if I setup my pipeline using SetInputConnection. If I switch it to SetInput, it works fine.

I've seen similar behavoir with Swing and it had to do with threading. I'm new to SWT so it's not clear to me,
if I want to use SetInputConnection/GetOutputPort for my pipeline setup, where is it "safe" to make these calls?


@Override
    protected void createViewContent(Composite parent) {
        // TODO Auto-generated method stub
        Composite composite = new Composite(parent, SWT.EMBEDDED);
        parent.setLayout(new FillLayout());
        Frame frame = SWT_AWT.new_Frame(composite);
        panel = new vtk.vtkPanel();
        final vtkConeSource cone = new vtkConeSource();

        cone.SetResolution(16);

        vtkPolyDataMapper coneMapper = new vtkPolyDataMapper();
        coneMapper.SetInput(cone.GetOutput());//works

       //THIS crashes in the jvm and exits the application!!!
       // coneMapper.SetInputConnection(cone.GetOutputPort());

        vtkActor coneActor = new vtkActor();

        coneActor.SetMapper(coneMapper);
        panel.GetRenderer().AddActor(coneActor);


        frame.add(panel);
        frame.setBackground(Color.BLUE);

    }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20121212/04c7c12b/attachment.htm>


More information about the vtkusers mailing list