From 4e3ea38fe08c1668e236a53591b1f8ddb5b04f49 Mon Sep 17 00:00:00 2001 From: enk Date: Mon, 26 Jun 2006 12:27:29 +0000 Subject: [PATCH] Fix for Bug PAL12693 EDF : VISU : ScalarMap on Deformed Shape doesn't work --- .../VISU_ScalarMapOnDeformedShapePL.cxx | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) 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(); } -- 2.39.2