From c3869b4805c5953f09070b18d014ee23bb078ad3 Mon Sep 17 00:00:00 2001 From: imn Date: Wed, 21 Sep 2016 18:50:14 +0300 Subject: [PATCH] 0023337: [CEA 1942] When we modify a mesh hypothesis, the display in the 3D view is not deleted immediatly --- src/SMESHGUI/SMESHGUI_Hypotheses.cxx | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/SMESHGUI/SMESHGUI_Hypotheses.cxx b/src/SMESHGUI/SMESHGUI_Hypotheses.cxx index 9a5e014ff..103ffb404 100644 --- a/src/SMESHGUI/SMESHGUI_Hypotheses.cxx +++ b/src/SMESHGUI/SMESHGUI_Hypotheses.cxx @@ -29,6 +29,7 @@ #include "SMESHGUI_HypothesesUtils.h" #include "SMESHGUI_Utils.h" #include "SMESHGUI_SpinBox.h" +#include "SMESHGUI_VTKUtils.h" // SALOME KERNEL includes #include @@ -40,9 +41,16 @@ #include #include #include +#include #include #include +#include +#include + +// VTK includes +#include + // Qt includes #include #include @@ -324,6 +332,23 @@ void SMESHGUI_GenericHypothesisCreator::onDialogFinished( int result ) myDlg->close(); //delete myDlg; since WA_DeleteOnClose==true myDlg = 0; + //imn: to fix the bug 23357. Workaround for fixed problem with repaint in VTK_viewer object. + if (SVTK_ViewWindow* vf = SMESH::GetCurrentVtkView()) { + VTK::ActorCollectionCopy aCopy( vf->getRenderer()->GetActors() ); + vtkActorCollection* anAllActors = aCopy.GetActors(); + if( anAllActors ) { + anAllActors->InitTraversal(); + while( vtkActor* aVTKActor = anAllActors->GetNextActor() ) { + if( SMESH_Actor* anActor = SMESH_Actor::SafeDownCast( aVTKActor ) ) { + if( anActor->GetVisibility() && anActor->GetMapper() ) { + anActor->Highlight( true ); + anActor->Highlight( false ); + } + } + } + } + vf->Repaint( false ); + } emit finished( result ); } -- 2.39.2