]> SALOME platform Git repositories - tools/paravisaddons_common.git/commitdiff
Salome HOME
[EDF22802] : Rosette filter improvement
authorAnthony Geay <anthony.geay@edf.fr>
Tue, 2 Mar 2021 20:15:59 +0000 (21:15 +0100)
committerAnthony Geay <anthony.geay@edf.fr>
Tue, 2 Mar 2021 20:37:29 +0000 (21:37 +0100)
src/RosetteCIH/plugin/RosetteCIHFilters/vtkRosetteCIH.cxx

index 8f38c11a4a7c7d8cf110d604e52c3e9ab839f32a..ac060ce612aa8f4d8b4f04b6fa7f6dfcfbf6116a 100644 (file)
@@ -176,8 +176,23 @@ void vtkRosetteCIH::PostTraitementT1etT2(
   vtkSmartPointer<vtkDataSet> gl2 =
     this->GenerateGlyphLinesFor(usgIn, "T2", COMPRESS_TRACTION);
   //
+  vtkNew<vtkDataSetSurfaceFilter> surface;
+  surface->SetNonlinearSubdivisionLevel(0);
+  surface->SetInputData(usgIn);
+  surface->Update();
+  vtkNew<vtkPolyData> surfaceCpy;
+  surfaceCpy->ShallowCopy(surface->GetOutput());
+  vtkNew<vtkDoubleArray> compressionOrTraction;
+  auto nbOfTuples(surface->GetOutput()->GetNumberOfPoints());
+  compressionOrTraction->SetNumberOfComponents(1);
+  compressionOrTraction->SetNumberOfTuples(nbOfTuples);
+  compressionOrTraction->SetName(COMPRESS_TRACTION);
+  compressionOrTraction->Fill(NAN);
+  surfaceCpy->GetPointData()->AddArray(compressionOrTraction);
+  //
   vtkNew<vtkMultiBlockDataGroupFilter> mb;
   vtkNew<vtkCompositeDataToUnstructuredGridFilter> cd;
+  mb->AddInputData(surfaceCpy);
   mb->AddInputData(gl1);
   mb->AddInputData(gl2);
   cd->SetInputConnection(mb->GetOutputPort());
@@ -449,13 +464,8 @@ void vtkRosetteCIH::PostTraitementOnlyOneCompo(vtkUnstructuredGrid* usgIn,
   compressionOrTractionNaN->Fill(NAN);
   fieldData->AddArray(compressionOrTractionNaN);
 
-  vtkNew<vtkTessellatorFilter> tesselator;
-  tesselator->SetOutputDimension(1);
-  tesselator->SetInputData(usgInCpy);
-  tesselator->Update();
-
   vtkNew<vtkMultiBlockDataGroupFilter> mb;
-  mb->AddInputData(tesselator->GetOutput());
+  mb->AddInputData(usgInCpy);
   mb->AddInputData(ret);
 
   vtkNew<vtkCompositeDataToUnstructuredGridFilter> cd;