[vtk-developers] vtkDoubleArray::GetTuple(vtkIdType) returns float * but not doubl e * ??

Amy Henderson amy.henderson at kitware.com
Mon Nov 10 15:27:02 EST 2003


Hi Andy,

At 01:10 PM 11/10/2003 -0700, Wilson, Andrew T wrote:
>Is there a reason why vtkDoubleArray::GetTuple(vtkIdType i) can return a
>pointer to floats but not to doubles?  This seems wrong, or at least a
>breach of completeness: if there's a version that returns a float array,
>shouldn't there be a version that returns a double array as well?

You're right that it should return doubles.  This particular method doesn't 
because the pure virtual method in the superclass returns an array of 
floats.  Changing VTK to have proper double support is on the list for VTK 
5.0.  Here's the thread for the discussion of this:
http://public.kitware.com/pipermail/vtk-developers/2003-October/002613.html

>Yes, you can accomplish something similar with one of the other GetTuple
>functions, but it seems quite awkward to have different calling conventions
>based on what precision you want.
>
>Is there a reason not to implement a version that will return double * and
>add it to the class?  Barring negative feedback, I'll write that later this
>week, test it, then check it in.

The signature for a method to return double * would need to differ in more 
than the return type from the one that returns float *, so I'm not sure 
what the advantage would be to adding a new method over using the existing 
one that returns doubles.  Am I missing something?

- Amy

>-- Andy
>
>_______________________________________________
>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