[vtkusers] Getting a float OR double array
Darshan Pai
darshanpai at gmail.com
Sun Aug 22 13:43:44 EDT 2010
I don't know why GetTuple is pure virtual in vtkDataArray . Though yeah I
agree it should theoretically work the same way .
Darshan
On Sun, Aug 22, 2010 at 1:32 PM, David Doria
<daviddoria+vtk at gmail.com<daviddoria%2Bvtk at gmail.com>
> wrote:
> 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/490a38d6/attachment.htm>
More information about the vtkusers
mailing list