[vtkusers] Problem with vtkPointPicker
William E Lucarell
welucarell at equityeng.com
Tue Apr 8 11:22:16 EDT 2008
I have a 2D mesh with my vtkPointPicker and sometimes the point showing up
doesn't correspond to a point on/near where my mouse is when I hit "p".
Below is my code:
renWin.addWindowSetObserver(new Observer() {
@Override
public void update(Observable o, Object arg) {
// Create a point picker
pickerPoint = new vtkPointPicker();
// Now at the end of the pick event call the above function.
pickerPoint.AddObserver("EndPickEvent", MeshCreator.this,
"annotatePick");
renWin.getIren().SetPicker(pickerPoint);
// Initially pick the cell at this location.
pickerPoint.Pick(0, 0, 0, renWin.GetRenderer());
}
});
public void annotatePick() {
if (pickerPoint.GetPointId() < 0) { }
else {
pickerInfo.setText(format.format(TestMesh.GetPointData().GetScalars().GetTup
le1(pickerPoint.GetPointId())));
nodeInfo.setText(Integer.toString(pickerPoint.GetPointId()));
}
}
I get another node or sometimes a node that doesn't even exist. Is there a
bug in the vtkPointPicker?
Thanks!
Bill Lucarell
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20080408/27d74e52/attachment.htm>
More information about the vtkusers
mailing list