From 92e9aabcfea4b08b1cac879f0b346c56d729b06d Mon Sep 17 00:00:00 2001 From: apo Date: Thu, 10 May 2007 11:46:11 +0000 Subject: [PATCH] [Bug NPAL15278] EDF 347 : ScalarMaponDeformedShape - Now Scalaras are displayed acoording to where their come from (cells or points) --- .../VISU_ScalarMapOnDeformedShapePL.cxx | 23 ++++++------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/src/PIPELINE/VISU_ScalarMapOnDeformedShapePL.cxx b/src/PIPELINE/VISU_ScalarMapOnDeformedShapePL.cxx index c8a39485..1ad109f3 100644 --- a/src/PIPELINE/VISU_ScalarMapOnDeformedShapePL.cxx +++ b/src/PIPELINE/VISU_ScalarMapOnDeformedShapePL.cxx @@ -114,21 +114,12 @@ VISU_ScalarMapOnDeformedShapePL ::UpdateScalars() { vtkPointSet* aScalars = GetScalars(); - vtkCellData *aInCellData = GetInput()->GetCellData(); - - if(aScalars->GetPointData()->GetScalars()) - myExtractorScalars->SetInput(aScalars); - else if(aScalars->GetCellData()->GetScalars() && - !aInCellData->GetAttribute(vtkDataSetAttributes::VECTORS)){ - //Approximate cell data values to point data by VISU_CellDataToPointData filter. - VISU_CellDataToPointData* aCellDataToPointData = VISU_CellDataToPointData::New(); - aCellDataToPointData->SetInput(aScalars); - aCellDataToPointData->Update(); - myExtractorScalars->SetInput(aCellDataToPointData->GetUnstructuredGridOutput()); - aCellDataToPointData->Delete(); - } else { - myExtractorScalars->SetInput(aScalars); - } + myExtractorScalars->SetInput(aScalars); + + if(VISU::IsDataOnCells(aScalars)) + myMapper->SetScalarModeToUseCellData(); + else + myMapper->SetScalarModeToUsePointData(); } @@ -290,5 +281,5 @@ VISU_ScalarMapOnDeformedShapePL ::GetSourceRange(vtkFloatingPointType theRange[2]) { myExtractorScalars->Update(); - myExtractorScalars->GetUnstructuredGridOutput()->GetScalarRange(theRange); + myExtractorScalars->GetOutput()->GetScalarRange(theRange); } -- 2.39.2