[vtkusers] Need Help: Serious Bug in vtkVolumeRayCastMapper.cxx
burkhardt.dorn at berlin.de
burkhardt.dorn at berlin.de
Mon Nov 19 02:49:31 EST 2001
Hello,
The following vtk3.2 code contains >= comparisions causing zero-division errors when two volumeRayDirection[i] are negative and the third is 0. We had this problem on WindowsNT-systems with a CompositeRayCastMapper on a volume in Fence-Mode, where the xmax=xmin+1 and the same for ymax and zmax. The limits where inside the volume. When rotating the volume with the mouse, the application crashed constantly...
/*=========================================================================
Program: Visualization Toolkit
Module: $RCSfile: vtkVolumeRayCastMapper.cxx,v $
Language: C++
Date: $Date: 2000/12/10 20:08:59 $
Version: $Revision: 1.59 $
Copyright (c) 1993-2001 Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither name of Ken Martin, Will Schroeder, or Bill Lorensen nor the names
of any contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
* Modified source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
=========================================================================*/
void vtkVolumeRayCastMapper::CastViewRay( VTKRayCastRayInfo *rayInfo,
VTKRayCastVolumeInfo *volumeInfo )
{
Some lines....
for ( i = 0; i < 3; i++ )
{
if ( volumeRayDirection[i] >= volumeRayDirection[(i+1)%3] && // critical code
volumeRayDirection[i] >= volumeRayDirection[(i+2)%3] ) // critical code
{
distanceArray[arrayCount] =
(volumeRayStart[i] -
savedRayStart[i]) / volumeRayDirection[i];
break;
}
}
Some lines
}
It seems to us that this function is anyhow wrong. We would have expected the comparision of absolute values to get the maximum, but in this case it is not quite clear whether one should divide (volumeRayStart[i] - savedRayStart[i]) by volumeRayDirection[i] or by its absolute value.
Could you please tell us as soon as possible whether this a known bug and whether it is fixed or will be fixed? We have serious trouble about that and have vital interest in its solution.
Thank you very much...
Dipl.-Math. Burkhardt Dorn
Software Department
Soft Imaging System Münster
Germany
mailto::bd at soft-imaging.de
--
berlin.de - meine stadt im netz. Jetzt eigene eMail-adresse @berlin.de sichern!
http://www.berlin.de/home/MeineStadt/Anmeldung
More information about the vtkusers
mailing list