<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body class='hmmessage'>
Hi!<br>Thx a lot, I get now a DataArray using <br>getArr = scaldat -&gt;GetArray(0); //I just have one array in my point data<br><br>But still the downcast to vtkDoubleArray fails, here is the code I used:<br><br>scaldat = input -&gt; GetPointData();<br>vtkDataArray *getArr = vtkDataArray::CreateDataArray(VTK_DOUBLE);<br>getArr = scaldat -&gt; GetArray(0);<br><br>&nbsp;vtkDoubleArray *scalars = vtkDoubleArray::New();<br>scalars = vtkDoubleArray::SafeDownCast(getArr); //this downcast fails, i.e at runtime I get that warning below<br>&nbsp;if(!scalars) vtkErrorMacro("SafeDownCast to vtkDoubleArray failed");<br><br><br>With the member function "IsTypeOf(char *classname)" I tried to find out if getArr is an array of a subclass of vtkDataArray, but this does not seem to be the case. getArr is just a vtkDataArray. But I need to access the values in it!!!<br><br>thx, <br>NH<br><br><br><br>&gt; Date: Sun, 21 Sep 2008 11:49:00 -0400<br>&gt; From: burlen.loring@kitware.com<br>&gt; To: nataliehapp@hotmail.com<br>&gt; CC: paraview@paraview.org<br>&gt; Subject: Re: [Paraview] SafeDownCast to vtkDoubleArray fails<br>&gt; <br>&gt; Natalie Happenhofer wrote:<br>&gt; &gt; Hi!<br>&gt; &gt; I need to cast my Point Data to a vtkDoubleArray, but it fails:<br>&gt; &gt;<br>&gt; &gt; vtkPointData *scaldat = input -&gt; GetPointData();<br>&gt; &gt; vtkDoubleArray *scalars = vtkDoubleArray::New();<br>&gt; &gt; scalars = vtkDoubleArray::SafeDownCast(scaldat);<br>&gt; &gt; if(!scalars) vtkErrorMacro("SafeDownCast to vtkDoubleArray failed");<br>&gt; PointData is not an array, it's a container of arrays. To get one of its <br>&gt; arrays see the GetArray methods.<br>&gt; http://www.vtk.org/doc/nightly/html/classvtkFieldData.html#888a6492210426d4ba4d358b87ab198f<br>&gt; <br>&gt; To find this in the documentation you would have to use the inheritance <br>&gt; diagrams. PointData "is a" DataSetAttibutes "is a" FieldData and so on.<br>&gt; <br>&gt; &gt;<br>&gt; &gt; and everytime I run the program I get that vtkErrorMacro.<br>&gt; &gt; as far as I know from the input files, the PointData should be float, <br>&gt; &gt; but casting to vtkFloatArray fails as well. Why? and what can I do <br>&gt; &gt; about it?<br>&gt; &gt;<br>&gt; &gt; thx a lot,<br>&gt; &gt; NH<br>&gt; &gt;<br>&gt; &gt; ------------------------------------------------------------------------<br>&gt; &gt; Express yourself instantly with MSN Messenger! MSN Messenger <br>&gt; &gt; &lt;http://clk.atdmt.com/AVE/go/onm00200471ave/direct/01/&gt;<br>&gt; &gt; ------------------------------------------------------------------------<br>&gt; &gt;<br>&gt; &gt; _______________________________________________<br>&gt; &gt; ParaView mailing list<br>&gt; &gt; ParaView@paraview.org<br>&gt; &gt; http://www.paraview.org/mailman/listinfo/paraview<br>&gt; &gt;   <br>&gt; <br>&gt; <br>&gt; -- <br>&gt; Burlen Loring<br>&gt; Kitware, Inc.<br>&gt; R&amp;D Engineer<br>&gt; 28 Corporate Drive<br>&gt; Clifton Park, NY 12065-8662<br>&gt; Phone: 518-371-3971 x137<br>&gt; <br><br /><hr />Express yourself instantly with MSN Messenger! <a href='http://clk.atdmt.com/AVE/go/onm00200471ave/direct/01/' target='_new'>MSN Messenger</a></body>
</html>