[vtkusers] Getting a float OR double array

David Doria daviddoria+vtk at gmail.com
Sun Aug 22 13:32:09 EDT 2010


On Sun, Aug 22, 2010 at 1:24 PM, Darshan Pai <darshanpai at gmail.com> wrote:

> David,
>
> if you are using dataNormals then you can use GetComponent() function to
> retrieve the normals . This always returns double so you dont really need to
> know the type . But in case you want to make the class depending on type, I
> think you can switch using the GetDataTypeAsString function.
>
> Darshan
>
>
Ah cool, GetComponent should do the trick. Is there a reason that there is
not a function like

void vtkDataArray::GetTuple(int i, double[3]) ?

It is the same idea of always returning a double, but returning the casted
values as an array. The components=3 specialization seems reasonable since
vtkDoubleArray and vtkFloatArray both alread support it.

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100822/9d37da51/attachment.htm>


More information about the vtkusers mailing list