[vtkusers] Cast doubt on method vtkFloatArray::GetTuple
Francois Bertel
francois.bertel at kitware.com
Tue Apr 15 10:49:30 EDT 2008
GetTuple() is defined in the superclass vtkDataArray. If you already safedowncast to a float array, you can use extra methods specific to float array, like GetTupleValue, SetTupleValue,GetValue,SetValue,InsertValue,
InsertNextValue:
vtkFloatArray
http://www.vtk.org/doc/nightly/html/classvtkFloatArray.html
superclass vtkDataArray
http://www.vtk.org/doc/nightly/html/classvtkDataArray.html
Renato N. Elias wrote:
>
> Just a minor doubt (or curiosity):
>
> Since vtkFloatArray is a float type, why (or how) does the GetTuple
> method return a double?
>
> I'm using a vtkFloatArray to point to the output of a normals generation
> filter. In this case, I had to performe a "SafeDownCast" from the output
> of the normals filter to the vtkFloatArray. After that, when I was
> getting the tuples from vtkFloatArray I noticed that the method returns
> a double (again). Well, although not being a C++ programmer, it seemed a
> bit weird. Is it safe (or even common in C++)?
>
> Thanks for any clarification
>
> Renato.
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
--
François Bertel, PhD | Kitware Inc. Suite 204
1 (518) 371 3971 x113 | 28 Corporate Drive
| Clifton Park NY 12065, USA
More information about the vtkusers
mailing list