]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/SHAPERGUI/SHAPERGUI_SalomeViewer.cpp
Salome HOME
Copyright update 2022
[modules/shaper.git] / src / SHAPERGUI / SHAPERGUI_SalomeViewer.cpp
index 2ccfd34227122563d91a9b953f77388193f12547..1f4fb0712b7e1a0fef205b67682f866c7d1c6d76 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2022  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 #include <QtxActionToolMgr.h>
 #include <SALOME_AISShape.hxx>
 
+#include <Standard_Version.hxx>
 #include <SelectMgr_ListIteratorOfListOfFilter.hxx>
 
 #include <QMouseEvent>
 #include <QContextMenuEvent>
+#include <QTimer>
 
 #if OCC_VERSION_HEX < 0x070400
   #define SALOME_PATCH_FOR_CTRL_WHEEL
@@ -279,11 +281,19 @@ void SHAPERGUI_SalomeViewer::onViewCreated(SUIT_ViewWindow* theView)
   myWindowScale.insert(aView->getViewPort()->getView(),
                        aView->getViewPort()->getView()->Camera()->Scale());
 
-  emit viewCreated(myView);
+  QTimer::singleShot(10, this, SLOT(onAfterViewCreated()));
 
+  emit viewCreated(myView);
+}
 
+//**********************************************
+void SHAPERGUI_SalomeViewer::onAfterViewCreated()
+{
+  // Update trihedron and dimension arrows
+  emit onViewTransformed(OCCViewer_ViewWindow::ZOOMVIEW);
 }
 
+
 //**********************************************
 void SHAPERGUI_SalomeViewer::onActivated(SUIT_ViewManager* theMgr)
 {
@@ -407,7 +417,7 @@ void SHAPERGUI_SalomeViewer::setViewProjection(double theX, double theY,
       aView3d->SetProj(theX, theY, theZ);
       aView3d->SetTwist( theTwist );
       aView3d->FitAll(0.01, false);
-      aView3d->SetZSize(0.);
+      //aView3d->SetZSize(0.);
       if (aView3d->Depth() < 0.1)
         aView3d->DepthFitAll();
     }