[vtkusers] Efficiency in setting scalars to points...?

Victor B. Putz vputz at nyx.net
Thu Dec 22 17:24:50 EST 2005


Basically, I'm modeling something with a fair number of cylinders, and as
an animation progresses, I want to color the different cylinders different
colors.  Currently I'm doing this by creating one big VtkFloatArray and
calling InsertValue once for each point in the VtkStructuredArray
representing my object.

This is slow.  Slow enough to be workable, but still slow (about 0.24
sec/frame, and I'd like it to be much much faster).

I tried using SetNumberOfValues and then SetValue, figuring I would avoid
the overhead of reallocation, but this not only gave me the wrong result,
but also was actually slower (about 0.28 sec/frame).

I feel I must be missing something fundamental.  What is the most
efficient way to set values on a volume of points?

-->VPutz




More information about the vtkusers mailing list