[vtkusers] how to speed up vtkPolyData->GetCell(index) ?

sebastien MARAUX maraux at ondim.fr
Mon Dec 23 07:42:57 EST 2002


yes, I meant getNumberOfcells(), I wrote a pseudo - 
snip of my code a bit too fast, sorry

Any Idea, other than reading vtkPolyData, that I almost
know from A o Z?

----- Original Message ----- 
From: "Jeremy Winston" <winston at cat.rpi.edu>
To: "sebastien MARAUX" <maraux at ondim.fr>
Cc: "vtkusers" <vtkusers at public.kitware.com>
Sent: Monday, December 23, 2002 1:40 PM
Subject: Re: [vtkusers] how to speed up vtkPolyData->GetCell(index) ?


> sebastien MARAUX wrote:
> > 
> > I need to speed up a getCell operation [...]:
> > 
> > vtkCell *cell;
> > for (i=0;i<nb;i++) {
> >     for (j=0;j<PolyData->GetCell(i);j++) {
>                ^^^^^^^^^^^^^^^^^^^^^^
> GetCell() returns a pointer, not an int.
> 
> >         cell = PolyData->GetCell(i);
>                                    ^
> ITYM j here, no?
> 
> But more to the point, you should read
> http://www.vtk.org/doc/nightly/html/classvtkPolyData.html#_details
> 
>   "[...]
>    One important feature of vtkPolyData objects is that special traversal
>    and data manipulation methods are available to process data. These
>    methods are generally more efficient than vtkDataSet methods and
>    should be used whenever possible. For example, traversing the cells in
>    a dataset we would use GetCell(). To traverse cells with vtkPolyData
>    we would retrieve the cell array object representing polygons (for
>    example) and then use vtkCellArray's InitTraversal() and GetNextCell()
>    methods."
> 
> HTH,
> -Jeremy
> 




More information about the vtkusers mailing list