]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
[Bug NPAL15278] EDF 347 : ScalarMaponDeformedShape
authorapo <apo@opencascade.com>
Thu, 10 May 2007 11:44:58 +0000 (11:44 +0000)
committerapo <apo@opencascade.com>
Thu, 10 May 2007 11:44:58 +0000 (11:44 +0000)
 - 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

index f8d0940d29b2df24770b86b37755371c22d61e2a..598c1e0506167c78b7e9f3499a77d2d26bea1b49 100644 (file)
@@ -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);
 }