X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSHAPERGUI%2FSHAPERGUI_SalomeViewer.cpp;h=8762f187958186de535e52879e3302b4e4f07810;hb=9a3d914571afc7318df989643dca720889fcc50b;hp=92113150bb02d245513679bcefcc0fee1a2b103b;hpb=010db3efe2e727c4f2cc2e99073e036c5ac07f46;p=modules%2Fshaper.git diff --git a/src/SHAPERGUI/SHAPERGUI_SalomeViewer.cpp b/src/SHAPERGUI/SHAPERGUI_SalomeViewer.cpp index 92113150b..8762f1879 100644 --- a/src/SHAPERGUI/SHAPERGUI_SalomeViewer.cpp +++ b/src/SHAPERGUI/SHAPERGUI_SalomeViewer.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2014-2019 CEA/DEN, EDF R&D +// Copyright (C) 2014-2021 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 @@ -28,12 +28,16 @@ #include #include +#include #include #include #include +#include -#define SALOME_PATCH_FOR_CTRL_WHEEL +#if OCC_VERSION_HEX < 0x070400 + #define SALOME_PATCH_FOR_CTRL_WHEEL +#endif SHAPERGUI_SalomeView::SHAPERGUI_SalomeView(OCCViewer_Viewer* theViewer) : ModuleBase_IViewWindow(), myCurrentView(0) @@ -277,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) { @@ -405,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(); } @@ -582,19 +594,13 @@ void SHAPERGUI_SalomeViewer::setFitter(OCCViewer_Fitter* theFitter) mySelector->viewer()->setFitter(theFitter); } -OCCViewer_Fitter* SHAPERGUI_SalomeViewer::currentFitter() const +OCCViewer_Fitter* SHAPERGUI_SalomeViewer::fitter() const { if (mySelector) - return mySelector->viewer()->currentFitter(); + return mySelector->viewer()->fitter(); return 0; } -void SHAPERGUI_SalomeViewer::unsetFitter() -{ - if (mySelector) - mySelector->viewer()->unsetFitter(); -} - //void SHAPERGUI_SalomeViewer::Zfitall() //{