[vtkusers] Problem with vtkPointPicker

William E Lucarell welucarell at equityeng.com
Tue Apr 8 13:47:54 EDT 2008


I've noticed the problem when I pick on a text actor (i.e. the label
corresponding to the point). It will give me a different node and that
node's corresponding scalar.

 

From: vtkusers-bounces at vtk.org [mailto:vtkusers-bounces at vtk.org] On Behalf
Of William E Lucarell
Sent: Tuesday, April 08, 2008 11:22 AM
To: 'VTK_question'
Subject: [vtkusers] Problem with vtkPointPicker

 

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


More information about the vtkusers mailing list