From: enk Date: Mon, 26 Jun 2006 12:27:29 +0000 (+0000) Subject: Fix for Bug PAL12693 X-Git-Tag: T3_2_1_pre~9 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=4e3ea38fe08c1668e236a53591b1f8ddb5b04f49;p=modules%2Fvisu.git Fix for Bug PAL12693 EDF : VISU : ScalarMap on Deformed Shape doesn't work --- diff --git a/src/PIPELINE/VISU_ScalarMapOnDeformedShapePL.cxx b/src/PIPELINE/VISU_ScalarMapOnDeformedShapePL.cxx index 14412af8..b8c9f864 100644 --- a/src/PIPELINE/VISU_ScalarMapOnDeformedShapePL.cxx +++ b/src/PIPELINE/VISU_ScalarMapOnDeformedShapePL.cxx @@ -120,6 +120,7 @@ VISU_ScalarMapOnDeformedShapePL // Sets geometry for merge filter myMergeFilter->SetGeometry(myDeformVectors->GetOutput()); + myMergeFilter->SetScalars(myExtractorScalars->GetOutput()); // Sets data to mapper myMapper->SetInput(myMergeFilter->GetOutput()); } @@ -158,11 +159,7 @@ void VISU_ScalarMapOnDeformedShapePL ::UpdateScalars() { - if(myScalars->GetCellData()->GetVectors() != NULL || - myScalars->GetPointData()->GetVectors() != NULL) - myMergeFilter->SetScalars(myExtractorScalars->GetOutput()); - else - myMergeFilter->SetScalars(GetScalars()); + myExtractorScalars->Update(); } /*! @@ -194,7 +191,19 @@ VISU_ScalarMapOnDeformedShapePL { myScalars = theScalars; vtkUnstructuredGrid* aScalars = GetScalars(); - myExtractorScalars->SetInput(aScalars); + + if(aScalars->GetPointData()->GetScalars()) + myExtractorScalars->SetInput(aScalars); + else if(aScalars->GetCellData()->GetScalars()){ + //Approximate cell data values to point data by vtkCellDataToPointData filter. + vtkCellDataToPointData* aCellDataToPointData = vtkCellDataToPointData::New(); + aCellDataToPointData->SetInput(aScalars); + aCellDataToPointData->Update(); + myExtractorScalars->SetInput(aCellDataToPointData->GetUnstructuredGridOutput()); + aCellDataToPointData->Delete(); + } else { + myExtractorScalars->SetInput(aScalars); + } Modified(); }