[vtkusers] Re: writing several scalars in one file (py and C)...

fred fredmfp at gmail.com
Wed Apr 4 15:15:16 EDT 2007


fred a écrit :
> Hi all,
>
> I wonder how can I write several scalars in one file, in C and python.
>
> In C, I tried something like this:
>
> car2[1] = 'v';
> vtkXMLWriterC_SetPointData(writer, car2, VTK_DATA_TYPE, 
> vtk_tab_scal_v, nbpoints, 1, "SCALARS");
> car2[1] = 'x';
> vtkXMLWriterC_SetPointData(writer, car2, VTK_DATA_TYPE, 
> vtk_tab_scal_x, nbpoints, 1, "SCALARS");
> car2[1] = 'y';
> vtkXMLWriterC_SetPointData(writer, car2, VTK_DATA_TYPE, 
> vtk_tab_scal_y, nbpoints, 1, "SCALARS");
> car2[1] = 'z';
> vtkXMLWriterC_SetPointData(writer, car2, VTK_DATA_TYPE, 
> vtk_tab_scal_z, nbpoints, 1, "SCALARS");
>
> vtkXMLWriterC_SetFileName(writer, filename);
> vtkXMLWriterC_Write(writer);
> vtkXMLWriterC_Delete(writer);
>
> In python, I tried something like this:
Ok, fixed for python using AddArray().
But not yet for C version :-(

By the way, filling array with InsertNextValue() in for loops
is very time consuming for large arrays.
For 571x876x288 cells, it is endless :-(

Any suggestion ?

Cheers,

-- 
/FP




More information about the vtkusers mailing list