[vtkusers] vtkCellPickers and vtkPointPickers in a vtkPanel

William E Lucarell welucarell at equityeng.com
Fri Apr 4 09:51:14 EDT 2008


I have a vtkPolyData mesh with scalar data and a
vtkBandedPolyDataContourFilter.  I am trying to use pickers to get the
scalar data at a point.  It works with a vtkCanvas, but not with a vtkPanel.
Here is the code I use in the addWindowSetObserver method to make the picker
work.  I want it to work with a vtkPointPicker and with a vtkPanel.  The
problem is that vtkPanels do not have a getIren() method like the vtkCanvas.

 

    // Delay creation and setup of picker till the VTK window is ready

    renWin.addWindowSetObserver(new Observer() {

      public void update(Observable o, Object arg) {

        // Create a cell picker.

        picker = new vtkCellPicker();

        // Now at the end of the pick event call the above function.

        picker.AddObserver("EndPickEvent", AnnotatePick.this,
"annotatePick");

        renWin.getIren().SetPicker(picker);

        // Initially pick the cell at this location.

        picker.Pick(85, 126, 0, renWin.GetRenderer());

      }

    });

 

I tried creating a vtkRenderWindowInteractor and setting the render window
to renWin.GetRenderWindow().  However, the picker doesn't work when I do
this; it only works with the vtkCanvas.  Is there any way you can implement
pickers with the vtkPanel, or can it only be done with a vtkCanvas?

 

Thanks in advance!

 

Bill Lucarell

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20080404/0045766e/attachment.htm>


More information about the vtkusers mailing list