From fd9b835cf3a6b3a414ef3d00a76c70034e5e070a Mon Sep 17 00:00:00 2001 From: vsr Date: Tue, 16 Jun 2009 04:57:18 +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 | 3 +++ src/PIPELINE/VISU_DeformedShapeAndScalarMapPL.cxx | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/PIPELINE/VISU_ColoredPL.cxx b/src/PIPELINE/VISU_ColoredPL.cxx index bc9bcd34..c7027903 100644 --- a/src/PIPELINE/VISU_ColoredPL.cxx +++ b/src/PIPELINE/VISU_ColoredPL.cxx @@ -170,6 +170,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; diff --git a/src/PIPELINE/VISU_DeformedShapeAndScalarMapPL.cxx b/src/PIPELINE/VISU_DeformedShapeAndScalarMapPL.cxx index 194ff20b..2da76c09 100644 --- a/src/PIPELINE/VISU_DeformedShapeAndScalarMapPL.cxx +++ b/src/PIPELINE/VISU_DeformedShapeAndScalarMapPL.cxx @@ -435,7 +435,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; -- 2.39.2