]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
To fix some regressions which have come with implementation of ELNO improvement
authorapo <apo@opencascade.com>
Fri, 23 May 2008 07:17:32 +0000 (07:17 +0000)
committerapo <apo@opencascade.com>
Fri, 23 May 2008 07:17:32 +0000 (07:17 +0000)
src/CONVERTOR/VISU_MeshValue.cxx

index 51b4a72d78d4f6bc779ce577c1856006dac07d5e..b4b265ed640f429cbbf4d4554f9d8870fb97e06a 100644 (file)
@@ -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<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 );
@@ -325,9 +333,9 @@ namespace VISU
                                   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));