[vtkusers] vtkPointData::NullPoint

Jim Peterson jimcp at cox.net
Mon Oct 11 20:31:46 EDT 2010


David Doria wrote:

> I noticed a NullPoint(id) function of vtkPointData. I tried to use it like this:
>
> // See the current points
>   for(vtkIdType i = 0; i < 10; i++)
>     {
>     double p[3];
>     polydata->GetPoint(i,p);
>     std::cout << "Point " << i << " : " << p[0] << " " << p[1] << " "
> << p[2] << std::endl;
>     }
>
> // Set one point to NULL
>   polydata->GetPointData()->NullPoint(4);
>   polydata->Modified();
>
> // See the modified points
>   for(vtkIdType i = 0; i < 10; i++)
>     {
>     double p[3];
>     polydata->GetPoint(i,p);
>     std::cout << "Point " << i << " : " << p[0] << " " << p[1] << " "
> << p[2] << std::endl;
>     }

David,
vtkPolyData has GetPoints() returns a pointer to vtkPoints,  and 
GetPointData() returns a pointer to vtkPointData, so I would not expect 
the point coordinates to be affected by vtkPointData.NullPoint(n) I 
would expect  maybe it would affect Scalars or Normals, something that 
might be considered the data associated with the point.

Jim



More information about the vtkusers mailing list