]> SALOME platform Git repositories - tools/paravisaddons_common.git/commitdiff
Salome HOME
[EDF23941] : Fix problem of visualization with SurfaceWithEdge in PV590.
authorAnthony Geay <anthony.geay@edf.fr>
Tue, 21 Sep 2021 05:26:10 +0000 (07:26 +0200)
committerAnthony Geay <anthony.geay@edf.fr>
Tue, 21 Sep 2021 05:26:10 +0000 (07:26 +0200)
src/RosetteCIH/plugin/RosetteCIHFilters/vtkRosetteCIH.cxx

index ac060ce612aa8f4d8b4f04b6fa7f6dfcfbf6116a..f35664b0afa4153e363a30765a493f02bc5c95cb 100644 (file)
@@ -41,6 +41,7 @@
 #include <vtkUnstructuredGrid.h>
 #include <vtkVariant.h>
 #include <vtkVariantArray.h>
+#include <vtkWarpVector.h>
 
 //-----------------------------------------------------------------------------
 void vtkRosetteCIH::ExtractInfo(
@@ -408,7 +409,7 @@ void vtkRosetteCIH::PostTraitementOnlyOneCompo(vtkUnstructuredGrid* usgIn,
 
   vtkNew<vtkPolyDataNormals> normals;
   normals->ComputeCellNormalsOn();
-  normals->ComputePointNormalsOff();
+  normals->ComputePointNormalsOn();
   normals->SplittingOff();
   normals->SetInputConnection(surface->GetOutputPort());
   normals->Update();
@@ -423,8 +424,14 @@ void vtkRosetteCIH::PostTraitementOnlyOneCompo(vtkUnstructuredGrid* usgIn,
 
   normals->GetOutput()->GetCellData()->AddArray(savedNormalsArray);
 
+  vtkNew<vtkWarpVector> warp;
+  warp->SetInputConnection(normals->GetOutputPort());
+  warp->SetInputArrayToProcess(0, 0, 0, vtkDataObject::FIELD_ASSOCIATION_POINTS, "Normals");
+  warp->SetScaleFactor(normals->GetOutput()->GetLength()/1000);
+  warp->Update();
+
   vtkNew<vtkPVGlyphFilter> glyph;
-  glyph->SetInputConnection(normals->GetOutputPort());
+  glyph->SetInputConnection(warp->GetOutputPort());
   glyph->SetGlyphMode(0);       // vtkPVGlyphFilter::ALL_POINTS
   glyph->SetVectorScaleMode(0); // vtkPVGlyphFilter::SCALE_BY_MAGNITUDE
   glyph->SetSourceConnection(arrow->GetOutputPort());