From: apo Date: Thu, 10 May 2007 11:46:11 +0000 (+0000) Subject: [Bug NPAL15278] EDF 347 : ScalarMaponDeformedShape X-Git-Tag: T_EDF_15278~8 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=92e9aabcfea4b08b1cac879f0b346c56d729b06d;p=modules%2Fvisu.git [Bug NPAL15278] EDF 347 : ScalarMaponDeformedShape - Now Scalaras are displayed acoording to where their come from (cells or points) --- 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); }