]> SALOME platform Git repositories - modules/smesh.git/commitdiff
Salome HOME
Partial fix for '#16403 EDF 17034 - Hole during meshing visualization'
authorrnv <rnv@opencascade.com>
Thu, 19 Nov 2020 00:35:02 +0000 (03:35 +0300)
committerrnv <rnv@opencascade.com>
Thu, 19 Nov 2020 00:35:02 +0000 (03:35 +0300)
src/SMESHGUI/SMESHGUI_Displayer.cxx
src/SMESHGUI/SMESHGUI_Displayer.h
src/SMESHGUI/SMESHGUI_VTKUtils.cxx
src/SMESHGUI/SMESHGUI_VTKUtils.h

index adeb2d7363d1caa0f629f80add5b618957f8a2f2..53bb6c4dd305710dd8f2f80e9c54676aadd8ad40 100644 (file)
@@ -46,7 +46,8 @@
 
 SMESHGUI_Displayer::SMESHGUI_Displayer( SalomeApp_Application* app )
 : LightApp_Displayer(),
-  myApp( app )
+  myApp( app ),
+  isNeedFitAll(false)
 {
 }
 
@@ -71,6 +72,7 @@ SALOME_Prs* SMESHGUI_Displayer::buildPresentation( const QString& entry, SALOME_
         anActor = SMESH::CreateActor( entry.toUtf8().data(), true );
       if( anActor )
       {
+        isNeedFitAll = SMESH::NoSmeshActors();
         SMESH::DisplayActor( wnd, anActor );
         prs = LightApp_Displayer::buildPresentation( entry.toUtf8().data(), aViewFrame );
       }
@@ -113,3 +115,13 @@ bool SMESHGUI_Displayer::canBeDisplayed( const QString& entry, const QString& vi
   }
   return res;
 }
+
+void SMESHGUI_Displayer::Display( const QStringList& theList, const bool anUpdateViewer, SALOME_View* theView ) 
+{
+  LightApp_Displayer::Display( theList, anUpdateViewer, theView );
+  
+  if (isNeedFitAll) {
+    SMESH::FitAll();
+    isNeedFitAll = false;
+  }
+}
\ No newline at end of file
index 6a1fce51e556bb41433c814034c77cf5ac71218d..3777cfcad5d52338b63eb7ec85b3f741f3e6255b 100644 (file)
@@ -42,14 +42,16 @@ public:
   SMESHGUI_Displayer( SalomeApp_Application* );
   ~SMESHGUI_Displayer();
 
-  virtual SALOME_Prs*      buildPresentation( const QString&, SALOME_View* = 0 );
-  virtual bool             canBeDisplayed( const QString&, const QString& ) const;
+  virtual SALOME_Prs*      buildPresentation( const QString&, SALOME_View* = 0 ) override;
+  virtual bool             canBeDisplayed( const QString&, const QString& ) const override;
+  virtual void             Display( const QStringList&, const bool = true, SALOME_View* = 0) override;
 
 protected:
   SalomeApp_Study*         study() const;
 
 private:
   SalomeApp_Application*   myApp;
+  bool                     isNeedFitAll;
 };
 
 #endif // SMESHGUI_DISPLAYER_H
index b148effa1bf6aaad608bd929f3072287e3c5d174..f1ca735abcde0b973dc7721fc714a1c5bc4e43ef 100644 (file)
@@ -726,9 +726,10 @@ namespace SMESH
    */
   //================================================================================
 
-  bool noSmeshActors(SUIT_ViewWindow *theWnd)
+  bool NoSmeshActors(SUIT_ViewWindow *theWnd)
   {
-    if(SVTK_ViewWindow* aViewWindow = GetVtkViewWindow(theWnd)) {
+    SUIT_ViewWindow* aWnd = ( theWnd == nullptr ) ? GetActiveWindow() : theWnd;
+    if(SVTK_ViewWindow* aViewWindow = GetVtkViewWindow(aWnd)) {
       vtkRenderer *aRenderer = aViewWindow->getRenderer();
       VTK::ActorCollectionCopy aCopy(aRenderer->GetActors());
       vtkActorCollection *aCollection = aCopy.GetActors();
@@ -826,7 +827,7 @@ namespace SMESH
               if ( (aVisualObj = GetVisualObj(theEntry)) && aVisualObj->IsValid())
               {
                 if ((anActor = CreateActor(theEntry,true))) {
-                  bool needFitAll = noSmeshActors(theWnd); // fit for the first object only
+                  bool needFitAll = NoSmeshActors(theWnd); // fit for the first object only
                   DisplayActor(theWnd,anActor);
                   anActor->SetVisibility(true);
                   aStudy->setVisibilityState(theEntry, Qtx::ShownState);
index a88c697a67aee837883a0fba41b7fd5bf67430ec..b6673afcdcbadbe423ec6adbab24d8e25f0b4c31 100644 (file)
@@ -222,6 +222,10 @@ SMESHGUI_EXPORT
 
   SMESHGUI_EXPORT
   void UpdateActorsAfterUpdateStudy();
+
+  SMESHGUI_EXPORT
+  bool NoSmeshActors(SUIT_ViewWindow *theWnd=nullptr);
+
 };
 
 #endif // SMESHGUI_VTKUTILS_H