]> SALOME platform Git repositories - modules/smesh.git/commitdiff
Salome HOME
0023337: [CEA 1942] When we modify a mesh hypothesis, the display in the 3D view... imn/23337
authorimn <imn@opencascade.com>
Wed, 21 Sep 2016 15:50:14 +0000 (18:50 +0300)
committerimn <imn@opencascade.com>
Wed, 21 Sep 2016 15:50:14 +0000 (18:50 +0300)
src/SMESHGUI/SMESHGUI_Hypotheses.cxx

index 9a5e014ff7fbcf5315838d6ae330d426c99baa97..103ffb4040c20c57036d9f7a044181b3883563aa 100644 (file)
@@ -29,6 +29,7 @@
 #include "SMESHGUI_HypothesesUtils.h"
 #include "SMESHGUI_Utils.h"
 #include "SMESHGUI_SpinBox.h"
+#include "SMESHGUI_VTKUtils.h"
 
 // SALOME KERNEL includes
 #include <SALOMEDSClient_Study.hxx>
 #include <SUIT_OverrideCursor.h>
 #include <SUIT_ResourceMgr.h>
 #include <SUIT_Session.h>
+#include <SVTK_ViewWindow.h>
 #include <SalomeApp_IntSpinBox.h>
 #include <SalomeApp_Tools.h>
 
+#include <SMESH_Actor.h>
+#include <VTKViewer_Algorithm.h>
+
+// VTK includes
+#include <vtkRenderer.h>
+
 // Qt includes
 #include <QFrame>
 #include <QLineEdit>
@@ -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 );
 }