[vtkusers] AddArray problems

Maple Raymond C LtCol AFIT/ENY Raymond.Maple at afit.edu
Thu Feb 17 11:45:52 EST 2005


> Hello,
>     We are having some problems adding arrays of scalars to an
> unstructured grid.  We are doing the following:
> 
> mygrid = <appendfilter>->GetOutput()
> vtkDoubleArray *data = vtkDoubleArray::New();
> (set num tuples, components, allocate, fill data, set name, etc)
> mygrid->GetCellData()->AddArray( data );
> data->Delete()
> ...
> 
> At this point, if we write the grid to an xml file, the file contains
> an array section with the correct name in the cell data section, but
> the data values themselves are missing.  If we run the grid through a
> vtkExtractUnstructuredGrid filter before we write the xml file, then
> all the data is there as expected.  We have verified that the array
> dimensions match the number of cells in the grid.  We have tried with
> versions 4.2 and 4.4.2, and get the same results with both.
> 
> The one clue I found in the archives was a statement that you can't
> change an object in the middle of a pipeline, and that something like
> a vtkMergeDataObjectFilter must be used.  If that is the case, why
> does everything work correctly if I go though a filter before writing
> the grid?  What am I missing?  
> 
> Thank you,
> 
> RAYMOND C. MAPLE, Lt Col USAF
> Deputy Head, Department of Aeronautics and Astronautics
> Air Force Institute of Technology
> 
> 
> RAYMOND C. MAPLE, Lt Col USAF
> Deputy Head, Department of Aeronautics and Astronautics
> Air Force Institute of Technology
> 
> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20050217/630ac9c8/attachment.htm>


More information about the vtkusers mailing list