[vtk-developers] reproducible vtkImagePlaneWidget(?) bug

Charl P. Botha c.p.botha at its.tudelft.nl
Sat May 10 08:41:15 EDT 2003


Hi there Dean,

On Fri, May 09, 2003 at 10:08:28PM -0400, dean.inglis at on.aibn.com wrote:
> here is what I get, without hanging on Windows 2000 Pro, 
> built with Cmake 1.6.6, Borland bcc32 compiler, MinSizeRel build: 
> a .cxx incarnation (I also ran a tcl version without pb's but
> I could not catch the error popup so I made the cxx vers with 
> vtkFileOutputWindow).

Evil evil evil! :)  I get the bug with MSVC++ 6.0 sp5 if I compile with the
Release, MinRelSize and RelWithDebInfo targets.  I don't get it if I compile
with the Debug target.  I've played with the switches, and it seems that /O1
(optimise for size) and /O2 (optimise for speed) are the culprits.  As
mentioned previously, I don't see the problem on Linux with g++ 2.95.

Whatever the case may be, don't you think those lines padding the texture
sizes up to a power of two should get some kind of sanity check in anycase?
Something like this:

int extentX = 1;
while (extentX < planeSizeX/spacingX && extentX < 16384)
{
   extentX = extentX << 1;
}

Will prevent extentX (and extentY) from reaching ludicrous sizes but should
also prevent weird things from happening if planeSizeX is abnormally big or
spacingX is abnormally small.

Your thoughts?

Best regards,
Charl

-- 
charl p. botha http://cpbotha.net/ http://visualisation.tudelft.nl/



More information about the vtk-developers mailing list