From: vsr Date: Mon, 18 Nov 2019 11:12:24 +0000 (+0300) Subject: #18319 [CEA 18318] Display of a field with negative value X-Git-Tag: V9_4_0rc2^0 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=6f0f4ed5d1d983c228a7ccd5645ebab1d748320e;p=modules%2Fgeom.git #18319 [CEA 18318] Display of a field with negative value --- diff --git a/src/GEOMGUI/GEOM_Displayer.cxx b/src/GEOMGUI/GEOM_Displayer.cxx index 050f2d968..545a2639f 100644 --- a/src/GEOMGUI/GEOM_Displayer.cxx +++ b/src/GEOMGUI/GEOM_Displayer.cxx @@ -2900,7 +2900,10 @@ QList GEOM_Displayer::groupFieldData( const QList& theFieldS aValue = double( aVariant.toLongLong() ); else if( aVariant.type() == QVariant::Double ) aValue = aVariant.toDouble(); - aNorm += aValue * aValue; + if ( theFieldNbComponents > 1 ) + aNorm += aValue * aValue; + else + aNorm += aValue; } } } @@ -2911,7 +2914,7 @@ QList GEOM_Displayer::groupFieldData( const QList& theFieldS { if( anIsBoolean ) aNorm /= theFieldNbComponents; - else + else if ( theFieldNbComponents > 1 ) aNorm = pow( aNorm, 0.5 ); if( aGroupedList.isEmpty() )