From d9dcd91a868b4f5d2974b1cba65aeae31d9b8b47 Mon Sep 17 00:00:00 2001 From: apo Date: Thu, 10 May 2007 11:44:58 +0000 Subject: [PATCH] [Bug NPAL15278] EDF 347 : ScalarMaponDeformedShape - Now Scalaras are generated independetly for both CellData & PointData. - All other data fields are passed by usage of vtkDataSetAttributes::PassData method --- src/PIPELINE/VISU_Extractor.cxx | 50 +++++++++++++-------------------- 1 file changed, 19 insertions(+), 31 deletions(-) diff --git a/src/PIPELINE/VISU_Extractor.cxx b/src/PIPELINE/VISU_Extractor.cxx index f8d0940d..598c1e05 100644 --- a/src/PIPELINE/VISU_Extractor.cxx +++ b/src/PIPELINE/VISU_Extractor.cxx @@ -94,37 +94,25 @@ execute(int theNbElems, void VISU_Extractor::Execute() { - vtkDataSet *input = this->GetInput(), *output = this->GetOutput(); - output->CopyStructure(input); - if(VISU::IsDataOnPoints(input)){ - output->GetPointData()->CopyVectorsOn(); - output->GetPointData()->CopyScalarsOff(); + vtkDataSet *anInput = this->GetInput(); + vtkDataSet *anOutput = this->GetOutput(); + anOutput->CopyStructure(anInput); - int aNbElems = input->GetNumberOfPoints(); - vtkPointData *inData = input->GetPointData(), *outData = output->GetPointData(); - if(!inData->GetAttribute(vtkDataSetAttributes::SCALARS)) - execute(aNbElems,myScalarMode,inData,outData); - else - output->GetPointData()->CopyScalarsOn(); - outData->PassData(inData); - outData->AddArray(inData->GetArray("VISU_FIELD")); - }else{ - output->GetCellData()->CopyVectorsOn(); - output->GetCellData()->CopyScalarsOff(); - - int aNbElems = input->GetNumberOfCells(); - vtkCellData *inData = input->GetCellData(), *outData = output->GetCellData(); - if(inData->GetAttribute(vtkDataSetAttributes::VECTORS)) - execute(aNbElems,myScalarMode,inData,outData); - else - output->GetCellData()->CopyScalarsOn(); - outData->PassData(inData); - outData->AddArray(inData->GetArray("VISU_FIELD")); + vtkPointData *anInputPointData = anInput->GetPointData(); + vtkPointData *anOutputPointData = anOutput->GetPointData(); + anOutputPointData->PassData(anInputPointData); + if(VISU::IsDataOnPoints(anInput)){ + int aNbElems = anInput->GetNumberOfPoints(); + if(anInputPointData->GetAttribute(vtkDataSetAttributes::VECTORS)) + execute(aNbElems, myScalarMode, anInputPointData, anOutputPointData); + } + + vtkCellData *anInputCellData = anInput->GetCellData(); + vtkCellData *anOutputCellData = anOutput->GetCellData(); + anOutputCellData->PassData(anInputCellData); + if(VISU::IsDataOnCells(anInput)){ + int aNbElems = anInput->GetNumberOfCells(); + if(anInputCellData->GetAttribute(vtkDataSetAttributes::VECTORS)) + execute(aNbElems, myScalarMode, anInputCellData, anOutputCellData); } - - if(vtkDataArray *aDataArray = input->GetCellData()->GetArray("VISU_CELLS_MAPPER")) - output->GetCellData()->AddArray(aDataArray); - - if(vtkDataArray *aDataArray = input->GetPointData()->GetArray("VISU_POINTS_MAPPER")) - output->GetPointData()->AddArray(aDataArray); } -- 2.39.2