From 6dcf89485e39c51becf22c541557864e0f143011 Mon Sep 17 00:00:00 2001 From: ouv Date: Tue, 24 Jun 2008 07:49:04 +0000 Subject: [PATCH] Bug VISU200819999 - SIGFPE on Sweep functionality --- src/PIPELINE/VISU_DeformedShapePL.cxx | 2 +- src/PIPELINE/VISU_XYPlotActor.cxx | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/PIPELINE/VISU_DeformedShapePL.cxx b/src/PIPELINE/VISU_DeformedShapePL.cxx index d1e8d6f3..816c474b 100644 --- a/src/PIPELINE/VISU_DeformedShapePL.cxx +++ b/src/PIPELINE/VISU_DeformedShapePL.cxx @@ -109,7 +109,7 @@ VISU_DeformedShapePL aVolume *= aVol; } } - if( fabs(idim) < 1.0 / VTK_LARGE_FLOAT ) + if( aNbElem == 0 || fabs(idim) < 1.0 / VTK_LARGE_FLOAT ) return 0.0; // to avoid division by zero aVolume /= aNbElem; return pow(aVolume, vtkFloatingPointType(1.0/idim)); diff --git a/src/PIPELINE/VISU_XYPlotActor.cxx b/src/PIPELINE/VISU_XYPlotActor.cxx index e7f912a3..c4818b41 100644 --- a/src/PIPELINE/VISU_XYPlotActor.cxx +++ b/src/PIPELINE/VISU_XYPlotActor.cxx @@ -1493,9 +1493,9 @@ void VISU_XYPlotActor::CreatePlotData(int *pos, int *pos2Extern, double xRange[2 } numLinePts++; - xyz[0] = pos[0] + + xyz[0] = fabs( xRange[1] - xRange[0] ) < 1.0 / VTK_LARGE_FLOAT ? pos[0] : pos[0] + (xyz[0]-xRange[0])/(xRange[1]-xRange[0])*(pos2[0]-pos[0]); - xyz[1] = pos[1] + + xyz[1] = fabs( yRange[1] - yRange[0] ) < 1.0 / VTK_LARGE_FLOAT ? pos[1] : pos[1] + (xyz[1]-yRange[0])/(yRange[1]-yRange[0])*(pos2[1]-pos[1]); id = pts->InsertNextPoint(xyz); lines->InsertCellPoint(id); @@ -1511,9 +1511,9 @@ void VISU_XYPlotActor::CreatePlotData(int *pos, int *pos2Extern, double xRange[2 } numLinePts++; - xyz[0] = pos[0] + + xyz[0] = fabs( xRange[1] - xRange[0] ) < 1.0 / VTK_LARGE_FLOAT ? pos[0] : pos[0] + (xyz[0]-xRange[0])/(xRange[1]-xRange[0])*(pos2[0]-pos[0]); - xyz[1] = pos[1] + + xyz[1] = fabs( yRange[1] - yRange[0] ) < 1.0 / VTK_LARGE_FLOAT ? pos[1] : pos[1] + (xyz[1]-yRange[0])/(yRange[1]-yRange[0])*(pos2[1]-pos[1]); id = pts->InsertNextPoint(xyz); lines->InsertCellPoint(id); @@ -1608,9 +1608,9 @@ void VISU_XYPlotActor::CreatePlotData(int *pos, int *pos2Extern, double xRange[2 clippingRequired = 1; } numLinePts++; - xyz[0] = pos[0] + + xyz[0] = fabs( xRange[1] - xRange[0] ) < 1.0 / VTK_LARGE_FLOAT ? pos[0] : pos[0] + (xyz[0]-xRange[0])/(xRange[1]-xRange[0])*(pos2[0]-pos[0]); - xyz[1] = pos[1] + + xyz[1] = fabs( yRange[1] - yRange[0] ) < 1.0 / VTK_LARGE_FLOAT ? pos[1] : pos[1] + (xyz[1]-yRange[0])/(yRange[1]-yRange[0])*(pos2[1]-pos[1]); id = pts->InsertNextPoint(xyz); lines->InsertCellPoint(id); @@ -1625,9 +1625,9 @@ void VISU_XYPlotActor::CreatePlotData(int *pos, int *pos2Extern, double xRange[2 clippingRequired = 1; } numLinePts++; - xyz[0] = pos[0] + + xyz[0] = fabs( xRange[1] - xRange[0] ) < 1.0 / VTK_LARGE_FLOAT ? pos[0] : pos[0] + (xyz[0]-xRange[0])/(xRange[1]-xRange[0])*(pos2[0]-pos[0]); - xyz[1] = pos[1] + + xyz[1] = fabs( yRange[1] - yRange[0] ) < 1.0 / VTK_LARGE_FLOAT ? pos[1] : pos[1] + (xyz[1]-yRange[0])/(yRange[1]-yRange[0])*(pos2[1]-pos[1]); id = pts->InsertNextPoint(xyz); lines->InsertCellPoint(id); -- 2.39.2