[vtk-developers] vtkCellArray::GetCell(vtkIdType loc, is public!?
Tim Hutton
T.Hutton at eastman.ucl.ac.uk
Tue Jul 8 12:31:41 EDT 2003
Is there a good reason why this member is declared as public?
vtkCellArray::GetCell(vtkIdType loc, vtkIdType &npts, vtkIdType *&pts)
It claims to be for internal use but is fully exposed.
Consider the following common usage:
int n_pts,*pts;
for(i=0;i<polydata->GetNumberOfCells();i++)
polydata->GetCell(i,n_pts,pts);
versus
int n_pts,*pts;
for(i=0;i<polydata->GetNumberOfCells();i++)
polydata->GetPolys()->GetCell(i,n_pts,pts);
The second of these is catastrophic! Innocent users beware.
Tim.
More information about the vtk-developers
mailing list