From 146067a7a9a555380331e9e821fc30ab255dd633 Mon Sep 17 00:00:00 2001 From: apo Date: Fri, 23 May 2008 07:17:32 +0000 Subject: [PATCH] To fix some regressions which have come with implementation of ELNO improvement --- src/CONVERTOR/VISU_MeshValue.cxx | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) 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()"<