Salome HOME
Fix compilation problems under windows.
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_Displayer.cxx
index adeb2d7363d1caa0f629f80add5b618957f8a2f2..05fea2e6a8a249a8fc323355dd83e3711133e316 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2020  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2021  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@ -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