[vtkusers] Problem with vtkPoint::GetPoint(vtk IdType)

Amy Squillacote amy.squillacote at kitware.com
Wed Apr 26 08:16:58 EDT 2006


Hi Ashley,

What is m_Points supposed to contain?  You didn't include the code 
showing where the values in this instance of vtkPoints comes 
from.  Also, what are you getting back from your call to GetPoint?  I 
see that you're calling GetPoint(1); remember that VTK numbers from 
0, so if you're trying to compare against the first point in 
m_Points, you should call GetPoint(0).

- Amy

At 05:46 AM 4/26/2006, Ashley Sher wrote:

>Hi all,
>
>I tried to use GetPoint to retreive the coordinates of defined point,
>however, it's not working. It is not returning the actual point coordinate.
>
>Anyone met with this problem before?
>
>vtkPoints *pts = vtkPoints::New();
>pts->InsertPoint (0, 0, 3, 0);
>pts->InsertPoint (1, 1, 2, 0);
>pts->InsertPoint (2, 0, 2, 1);
>pts->InsertPoint (3, -1, 2, 0);
>pts->InsertPoint (4, 0, 2, -1);
>
>vtkPolyData *pd = vtkPolyData::New();
>pd->SetPoints(pts);
>
>vtkSphereSource *sphere = vtkSphereSource::New();
>vtkGlyph3D *spheres = vtkGlyph3D::New();
>spheres->SetInput(pd);
>spheres->SetSource(sphere->GetOutput());
>vtkPolyDataMapper *sphereMapper= vtkPolyDataMapper::New();
>sphereMapper->SetInputConnection(spheres->GetOutputPort());
>vtkActor *sphereActor = vtkActor::New();
>sphereActor->SetMapper(sphereMapper);
>
>iren->GetEventPosition(x, y);
>vtkPropPicker *picker = vtkPropPicker::New();
>picker->Pick(x,y,0,this->renderer);
>vtkActor *pickedActor = picker->GetActor();
>
>if (picker->GetPickPosition() == m_Points->GetPoint(1)) {
>                                             :
>                                             :
>}
>--
>View this message in context: 
>http://www.nabble.com/Problem-with-vtkPoint%3A%3AGetPoint%28vtk-IdType%29-t1510830.html#a4098328
>Sent from the VTK - Users forum at Nabble.com.
>
>_______________________________________________
>This is the private VTK discussion list.
>Please keep messages on-topic. Check the FAQ at: 
>http://www.vtk.org/Wiki/VTK_FAQ
>Follow this link to subscribe/unsubscribe:
>http://www.vtk.org/mailman/listinfo/vtkusers





More information about the vtkusers mailing list