[Paraview] SafeDownCast to vtkDoubleArray fails
Burlen Loring
burlen.loring at kitware.com
Sun Sep 21 11:49:00 EDT 2008
Natalie Happenhofer wrote:
> Hi!
> I need to cast my Point Data to a vtkDoubleArray, but it fails:
>
> vtkPointData *scaldat = input -> GetPointData();
> vtkDoubleArray *scalars = vtkDoubleArray::New();
> scalars = vtkDoubleArray::SafeDownCast(scaldat);
> if(!scalars) vtkErrorMacro("SafeDownCast to vtkDoubleArray failed");
PointData is not an array, it's a container of arrays. To get one of its
arrays see the GetArray methods.
http://www.vtk.org/doc/nightly/html/classvtkFieldData.html#888a6492210426d4ba4d358b87ab198f
To find this in the documentation you would have to use the inheritance
diagrams. PointData "is a" DataSetAttibutes "is a" FieldData and so on.
>
> and everytime I run the program I get that vtkErrorMacro.
> as far as I know from the input files, the PointData should be float,
> but casting to vtkFloatArray fails as well. Why? and what can I do
> about it?
>
> thx a lot,
> NH
>
> ------------------------------------------------------------------------
> Express yourself instantly with MSN Messenger! MSN Messenger
> <http://clk.atdmt.com/AVE/go/onm00200471ave/direct/01/>
> ------------------------------------------------------------------------
>
> _______________________________________________
> ParaView mailing list
> ParaView at paraview.org
> http://www.paraview.org/mailman/listinfo/paraview
>
--
Burlen Loring
Kitware, Inc.
R&D Engineer
28 Corporate Drive
Clifton Park, NY 12065-8662
Phone: 518-371-3971 x137
More information about the ParaView
mailing list