[vtkusers] Java, SWT and SetInputConnection vs SetInput

Gerrick Bivins Gerrick.Bivins at halliburton.com
Wed Dec 12 09:43:07 EST 2012


After a cup of coffee, I realized the problem.
I had a version mismatch...the version of VTK used to generate the vtk.jar in my bundle was 5.7 and the dll's in my fragment were 5.10...
Resolved that issue and things work as expected!
;)


From: vtkusers-bounces at vtk.org [mailto:vtkusers-bounces at vtk.org] On Behalf Of Gerrick Bivins
Sent: Wednesday, December 12, 2012 8:01 AM
To: vtkusers at vtk.org
Subject: [vtkusers] Java, SWT and SetInputConnection vs SetInput

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/92fb6c17/attachment.htm>


More information about the vtkusers mailing list