std::string aFieldName = VISU::GenerateFieldName(theField, theValForTime);
vtkDataSetAttributes* aDataSetAttributes;
- switch(theEntity){
+ switch ( theEntity ) {
case VISU::NODE_ENTITY :
aDataSetAttributes = theSource->GetPointData();
break;
typedef typename TL::TEnum2VTKArrayType<EDataType>::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 );
true);
INITMSG(MYDEBUG,"InitTimeStampOnProfile - aFullDataArray->SetVoidArray()"<<std::endl);
if ( aNbComp == 1 ) {
- aSelectedDataArray->SetVoidArray(aMeshValue->GetPointer(),
- aMeshValue->size(),
- true);
+ aSelectedDataArray->SetVoidArray( aMeshValue->GetPointer(),
+ aMeshValue->size(),
+ true );
INITMSG(MYDEBUG,"InitTimeStampOnProfile - aSelectedDataArray->SetVoidArray()"<<std::endl);
}else{
PDataArrayHolder aDataArrayHolder(new TTDataArrayHolder(aSelectedDataArray));