[vtkusers] 3d SphereSource Picking and Get the Point ID

Giuseppe Marco Randazzo gmrandazzo at gmail.com
Fri Jan 25 10:40:40 EST 2013


Hello,

I need to get the point id by picking a multiple spehere source 3D plot..


For example i've 400 vtkPoints   rendered by the Glyph3D with 
SphereSource....

so:


polydata->SetPoints(vtkpoints)

   sphereSource->SetRadius(radiusssss);
glyph3D()->SetSourceConnection(sphereSource->GetOutputPort());
   glyph3D()->SetInput(polydata);
   glyph3D()->Update();

So also i got from the wiki these examples:

http://www.vtk.org/Wiki/VTK/Examples/Cxx/Interaction/PointPicker
http://www.vtk.org/Wiki/VTK/Examples/Cxx/Interaction/WorldPointPicker

that get me the poin coordinate... but in the world picker is specified:

"This example demonstrates how to get the position of the point in 3D 
that is exactly behind the mouse click. This point is not likely a point 
that exists in the data set - i.e. it can be a point on the interior of 
a cell. "

So my question is how can i get the point in the data set that was picked?

Also i seen this example: 
http://www.vtk.org/Wiki/VTK/Examples/Cxx/Interaction/MoveAVertex

and tried to use PointPicker->GetPointId()

But i do not get the point id that correspond to the id in the vtkpoint 
table.... i get the point id that is one of the selected spheresource.

How is possible so get the real point id?

Thanks.

Marco



More information about the vtkusers mailing list