[vtkusers] Question on vtkDataArray::GetRange() and doubles...

Amy Henderson amy.henderson at kitware.com
Tue Aug 24 17:30:10 EDT 2004


What version of VTK are you using? For the VTK 4.4 release, a lot of work 
was done to move from doing most computations in float to doing them with 
doubles (precisely for the reason you mentioned -- too much precision being 
lost). The GetRange method of vtkDataArray is an example of this change 
being exposed in the VTK API.

- Amy

At 05:24 PM 8/24/2004, Charles Boivin wrote:
>Hello all!
>
>Still playing with my own data reader, and I have yet another question
>for you gurus. I have tried to see if this had been discussed before on
>this mailing list, but could not find a relevant question when reading
>through search results.
>
>I want to know what the range of the values that I have just read is.
>To do this, I use something like:
>
>pArray = pPointData->GetArray(iArrayNumber);
>
>(where pPointData is vtkPolyData::GetOutput()->GetPointData() ... )
>
>and then using:
>
>float afRange[2];
>pArray->GetRange(afRange, iComponentNumber);
>
>I can get the range in afRange[]. This works fine.
>
>My question has to do with the different data types... The array that I
>have stored in vtkPolyData is actually a double array (vtkDoubleArray).
>Yet, there does not seem to be a way to get the range returned as
>doubles. Am I missing something, or is the loss of accuracy not too
>important there when it comes to the range of scalar values?
>
>Thank you in advance for your answers...
>
>Charles Boivin
>_______________________________________________
>This is the private VTK discussion list.
>Please keep messages on-topic. Check the FAQ at: 
><http://public.kitware.com/cgi-bin/vtkfaq>
>Follow this link to subscribe/unsubscribe:
>http://www.vtk.org/mailman/listinfo/vtkusers






More information about the vtkusers mailing list