[vtkusers] Problem with vtkDataArrayTemplate Resize?

Utkarsh Ayachit utkarsh.ayachit at kitware.com
Fri Sep 5 15:51:06 EDT 2008


Use SetNumberOfTuples() if you want to change the number of tuples as 
well. Resize updates the number of tuples count only if the request is 
to resize to a smaller size.

Utkarsh

Sam Preston wrote:
> Hi all,
> 
> I've been trying to Resize() a vtkDoubleArray, but after resizing it
> still shows the original number of tuples when I call
> GetNumberOfTuples().  Looking at the code, calling Resize(...) does
> indeed allocate the correct memory, but it does not set MaxId, which
> is used by GetNumberOfTuples when reporting the number of tuples in
> the array.  Is this a bug, or expected behavior?  If this is expected,
> is there a better way to resize an array?
> 
> Thanks,
> 
> -Sam
> 



More information about the vtkusers mailing list