]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
[Bug NPAL15278] EDF 347 : ScalarMaponDeformedShape
authorapo <apo@opencascade.com>
Thu, 10 May 2007 11:46:11 +0000 (11:46 +0000)
committerapo <apo@opencascade.com>
Thu, 10 May 2007 11:46:11 +0000 (11:46 +0000)
 - Now Scalaras are displayed acoording to where their come from (cells or points)

src/PIPELINE/VISU_ScalarMapOnDeformedShapePL.cxx

index c8a3948597e925da430a2bdd46cbd590d4a55d54..1ad109f3669a01273e39da45a99e51fe380f3277 100644 (file)
@@ -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);
 }