From: apo Date: Fri, 23 May 2008 07:17:32 +0000 (+0000) Subject: To fix some regressions which have come with implementation of ELNO improvement X-Git-Tag: TG_ELNO_visualization_28May2008~3 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=146067a7a9a555380331e9e821fc30ab255dd633;p=modules%2Fvisu.git To fix some regressions which have come with implementation of ELNO improvement --- diff --git a/src/CONVERTOR/VISU_MeshValue.cxx b/src/CONVERTOR/VISU_MeshValue.cxx index 51b4a72d..b4b265ed 100644 --- a/src/CONVERTOR/VISU_MeshValue.cxx +++ b/src/CONVERTOR/VISU_MeshValue.cxx @@ -280,7 +280,7 @@ namespace VISU std::string aFieldName = VISU::GenerateFieldName(theField, theValForTime); vtkDataSetAttributes* aDataSetAttributes; - switch(theEntity){ + switch ( theEntity ) { case VISU::NODE_ENTITY : aDataSetAttributes = theSource->GetPointData(); break; @@ -291,10 +291,18 @@ namespace VISU typedef typename TL::TEnum2VTKArrayType::TResult TVTKDataArray; TVTKDataArray *aSelectedDataArray = TVTKDataArray::New(); vtkIdType aNbComp = theField->myNbComp; - aSelectedDataArray->SetNumberOfComponents( 3 ); + + switch ( aNbComp ) { + case 1: + aSelectedDataArray->SetNumberOfComponents( 1 ); + aDataSetAttributes->SetScalars( aSelectedDataArray ); + break; + default: + aSelectedDataArray->SetNumberOfComponents( 3 ); + aDataSetAttributes->SetVectors( aSelectedDataArray ); + } aSelectedDataArray->SetNumberOfTuples( aNbTuples ); aSelectedDataArray->SetName( aFieldName.c_str() ); - aDataSetAttributes->SetVectors( aSelectedDataArray ); TVTKDataArray *aFullDataArray = TVTKDataArray::New(); aFullDataArray->SetNumberOfComponents( aNbComp ); @@ -325,9 +333,9 @@ namespace VISU true); INITMSG(MYDEBUG,"InitTimeStampOnProfile - aFullDataArray->SetVoidArray()"<SetVoidArray(aMeshValue->GetPointer(), - aMeshValue->size(), - true); + aSelectedDataArray->SetVoidArray( aMeshValue->GetPointer(), + aMeshValue->size(), + true ); INITMSG(MYDEBUG,"InitTimeStampOnProfile - aSelectedDataArray->SetVoidArray()"<