[vtk-developers] Bug in vtkColorTransferFunction
David Cole
david.cole at kitware.com
Wed Dec 7 09:36:45 EST 2005
This was checked in to the VTK-5-0 branch on Dec. 5. Randall, could you
update and verify that it's fixed...?
Thanks,
David
Randall Hand wrote:
> I've spent the last week beating my head against the wall trying to
> figure out why my colormap didn't work in my application, but smaller
> test cases would work. I finally figured it out just now. (Filed as
> bug 2546)
>
> When using a vtkColorTransferFunction, and adding a large number of
> points (Over 100) in an out-of-order fashion (In my case, I'm reading
> them from a file and the X's are fairly random, not simply
> incrementing), it will destroy the colormap. The problem comes when
> you add the 100'th point and it tries to resize the colormap. In this
> case, it uses a memcpy to copy the colormap into the newly allocated
> (and large) array. If that 100th's point is not the highest point in
> the list, it uses 2 memcpy's, one shifted by one entry to create a
> "hole" for the newly added entry in the middle. Unfortunately, it
> indexes wrong! So the net result: Blue becomes red, green becomes
> blue, red becomes the next entry's X, and in general it's just all
> b0rked.
>
> Attached to the bug (
> http://www.vtk.org/Bug/bug.php?op=show&bugid=2546&pos=3
> <http://www.vtk.org/Bug/bug.php?op=show&bugid=2546&pos=3> ) you'll
> find a test-case that uses a Mandelbrot fractal source to illustrate
> the problem.
>
> --
> Randall Hand
> Visualization Scientist,
> ERDC-MSRC Vicksburg, MS
> Homepage: http://www.yeraze.com
>
>------------------------------------------------------------------------
>
>_______________________________________________
>vtk-developers mailing list
>vtk-developers at vtk.org
>http://www.vtk.org/mailman/listinfo/vtk-developers
>
>
More information about the vtk-developers
mailing list