[vtkusers] Re: writing several scalars in one file (py and C)...
David C Thompson
dcthomp at sandia.gov
Thu Apr 5 13:30:30 EDT 2007
On Thu, 2007-04-05 at 12:50 +0200, fred wrote:
> Dominik Szczerba a écrit :
> > preallocate the array and write to its buffer.
> Sorry I don't understand.
> I have allocated it with Allocate(int), ok.
> But then, which method do I have to use to write to its buffer
> without for loops ?
If you use Allocate (or SetNumberOfTuples), then you should use SetValue
or SetTuple instead of InsertNextValue or InsertNextTuple. The routines
that begin with InsertNext perform bounds checks on each insert which
can slow things down.
David
More information about the vtkusers
mailing list