[vtk-developers] vtkCellArray::GetCell(vtkIdType loc, is public!?

Will Schroeder will.schroeder at kitware.com
Tue Jul 8 13:00:58 EDT 2003


Hi Tim-

It is public because a couple of other classes (e.g., 
vtkUnstructuredGrid,vtkPolyData) use it and we weren't too keen on using 
C++ friend methods way back when. There are (too) many functions similar to 
this in VTK---if you want to take the time to do the friend thing I can't 
think of a reason why not.

Will

At 05:31 PM 7/8/2003 +0100, Tim Hutton wrote:
>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.
>
>
>_______________________________________________
>vtk-developers mailing list
>vtk-developers at vtk.org
>http://www.vtk.org/mailman/listinfo/vtk-developers






More information about the vtk-developers mailing list