[vtkusers] Problems with vtkDoubleArray

David Doria daviddoria at gmail.com
Mon Jan 13 08:23:57 EST 2014


On Mon, Jan 13, 2014 at 5:26 AM, Susanne Schmalkalt <
Susanne.Schmalkalt at gmx.de> wrote:

> Hallo everybody,
>
> I have a question regarding vtkDoubleArray.
>
> I want to save doubles in an array which I then add to a PolyDataObject.
> But when I add the variable and then call it again, the correct value
> dissapears.
> Does someone have an idea why? what am I doing wrong?
>
>
>         Instantiate(measurements,vtkDoubleArray);
>         measurements->SetNumberOfComponents(1);
>         measurements->SetNumberOfTuples(numberOfGridpoints);
>         measurements->SetName(name);
>         for(int i = 0; i < numberOfGridpoints; i++){
>             double temp[1];
>             temp[0] = static_cast<double>(measurementArray[i][t]);
>             cout << " temp: " << temp[0];
>             measurements->InsertNextTupleValue(temp);
>             vtkIdType id = (vtkIdType)i;
>             double check[1];
>             measurements->GetTupleValue(id,check);
>             cout << " check: " << check[0];
>         }
>         meshPolyData->GetPointData()->AddArray(measurements);
>
> Thank you for your help!
> Susi
>

Can you please post the smallest, compilable, self-contained example that
demonstrates your problem?

Thanks,

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20140113/bab9a914/attachment.html>


More information about the vtkusers mailing list