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);
}