[vtkusers] How to get point positions of a Polyline (vtkCell?)

michał strzelecki nexgen at poczta.onet.pl
Tue Jul 22 18:11:28 EDT 2003


>hello,

>I'm trying to get the positions of a Polyline to follow a camera picked
>polyline, but I don't know what vtkclass will give me the pointpositions
>(vtkCell, vtkCellArray, vtkCellLinks, vtkIdFilter?)

To get point position if we have a polyline in vtkPolyData we do:

in c++

vtkPolyData *p = vtkPolyData::New();

// i is an index of cell which is a polyline we want
vtkCell *c = p->GetCell(i);
// n >= 0 and  n < c->GetPoints()->GetNumberOfPoints()
float point[3];
c->GetPoints()->GetPoint(n, point);
//or
float *point;
point = c->GetPoints()->GetPoint(n);

michał




More information about the vtkusers mailing list