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

Ashley Sher tany0029 at ntu.edu.sg
Wed Apr 26 05:46:04 EDT 2006


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.




More information about the vtkusers mailing list