[vtkusers] Java, SWT and SetInputConnection vs SetInput

Joachim Pouderoux joachim.pouderoux at kitware.com
Wed Dec 12 16:26:07 EST 2012


For your information, I will commit in the next days a set of new java
classes for vtk and one of them is a pure SWT rendering panel (no more awt
bridge needed).

Joachim

Le 12 déc. 2012 à 16:02, Gerrick Bivins <Gerrick.Bivins at halliburton.com> a
écrit :

  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*);



    }

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at:
http://www.vtk.org/Wiki/VTK_FAQ

Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20121212/b8e08f7d/attachment.htm>


More information about the vtkusers mailing list