From 14b97f3c93dffb209083341c4b618eb0e2dd9400 Mon Sep 17 00:00:00 2001 From: vsr Date: Tue, 16 Jun 2009 05:24:41 +0000 Subject: [PATCH] 0020064: EDF 877 VISU : NaN in scalar bar Print "NAN values in the presentation" error message to the terminal window in case of NAN values detection. --- src/PIPELINE/VISU_ColoredPL.cxx | 5 ++++- src/PIPELINE/VISU_DeformedShapeAndScalarMapPL.cxx | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/PIPELINE/VISU_ColoredPL.cxx b/src/PIPELINE/VISU_ColoredPL.cxx index 79ec127c..3d587d88 100644 --- a/src/PIPELINE/VISU_ColoredPL.cxx +++ b/src/PIPELINE/VISU_ColoredPL.cxx @@ -148,6 +148,9 @@ void VISU_ColoredPL ::SetScalarRange(vtkFloatingPointType theRange[2]) { + if (isnan(theRange[0]) || isnan(theRange[1])) + throw std::runtime_error("NAN values in the presentation"); + if(theRange[0] > theRange[1]) return; @@ -344,7 +347,7 @@ VISU_ColoredPL myExtractor->GetOutput()->GetScalarRange(theRange); if (isnan(theRange[0]) || isnan(theRange[1])) - throw std::runtime_error("Arithmetic exception detected"); + throw std::runtime_error("NAN values in the presentation"); } void diff --git a/src/PIPELINE/VISU_DeformedShapeAndScalarMapPL.cxx b/src/PIPELINE/VISU_DeformedShapeAndScalarMapPL.cxx index 55e0c78a..750db5b1 100644 --- a/src/PIPELINE/VISU_DeformedShapeAndScalarMapPL.cxx +++ b/src/PIPELINE/VISU_DeformedShapeAndScalarMapPL.cxx @@ -414,7 +414,7 @@ VISU_DeformedShapeAndScalarMapPL ::SetScalarRange(vtkFloatingPointType theRange[2]) { if (isnan(theRange[0]) || isnan(theRange[1])) - throw std::runtime_error("Arithmetic exception detected"); + throw std::runtime_error("NAN values in the presentation"); if(VISU::CheckIsSameRange(theRange, GetScalarRange())) return; @@ -448,5 +448,5 @@ VISU_DeformedShapeAndScalarMapPL myScalarsExtractor->GetUnstructuredGridOutput()->GetScalarRange(theRange); if (isnan(theRange[0]) || isnan(theRange[1])) - throw std::runtime_error("Arithmetic exception detected"); + throw std::runtime_error("NAN values in the presentation"); } -- 2.39.2