From 99b17772d0f9e284a65d756638e96932172de17e Mon Sep 17 00:00:00 2001 From: vsv Date: Fri, 30 Dec 2016 16:40:03 +0300 Subject: [PATCH] Remove ZFitAll --- src/ModuleBase/ModuleBase_IViewer.h | 2 +- src/SHAPERGUI/SHAPERGUI_SalomeViewer.cpp | 36 ++++++++++++------------ src/SHAPERGUI/SHAPERGUI_SalomeViewer.h | 2 +- src/XGUI/XGUI_Displayer.cpp | 2 +- src/XGUI/XGUI_ViewerProxy.cpp | 30 ++++++++++---------- src/XGUI/XGUI_ViewerProxy.h | 2 +- 6 files changed, 37 insertions(+), 37 deletions(-) diff --git a/src/ModuleBase/ModuleBase_IViewer.h b/src/ModuleBase/ModuleBase_IViewer.h index c2f46ed9c..5331ba020 100644 --- a/src/ModuleBase/ModuleBase_IViewer.h +++ b/src/ModuleBase/ModuleBase_IViewer.h @@ -109,7 +109,7 @@ Q_OBJECT virtual bool canDragByMouse() const { return true; } /// Fit all along Z (perpendicular to display) - virtual void Zfitall() = 0; + //virtual void Zfitall() = 0; signals: /// Signal emited when last view window is closed diff --git a/src/SHAPERGUI/SHAPERGUI_SalomeViewer.cpp b/src/SHAPERGUI/SHAPERGUI_SalomeViewer.cpp index 4d978aeb8..c341e0f1a 100644 --- a/src/SHAPERGUI/SHAPERGUI_SalomeViewer.cpp +++ b/src/SHAPERGUI/SHAPERGUI_SalomeViewer.cpp @@ -463,21 +463,21 @@ void SHAPERGUI_SalomeViewer::activateViewer(bool toActivate) } } -void SHAPERGUI_SalomeViewer::Zfitall() -{ - if (!mySelector || !mySelector->viewer()) - return; - SUIT_ViewManager* aMgr = mySelector->viewer()->getViewManager(); - /// WORKAROUND for issue #1798. SUIT_ViewManager::closeAllViews() should nullify myActiveView - /// As a result, we need to check views count in manager - if (aMgr->getViews().size() > 0) { - OCCViewer_ViewFrame* aView = dynamic_cast(aMgr->getActiveView()); - if (aView) { - OCCViewer_ViewWindow* aWnd = aView->getView(OCCViewer_ViewFrame::MAIN_VIEW); - Handle(V3d_View) aView3d = aWnd->getViewPort()->getView(); - aView3d->ZFitAll(); - if (aView3d->Depth() < 0.1) - aView3d->DepthFitAll(); - } - } -} \ No newline at end of file +//void SHAPERGUI_SalomeViewer::Zfitall() +//{ +// if (!mySelector || !mySelector->viewer()) +// return; +// SUIT_ViewManager* aMgr = mySelector->viewer()->getViewManager(); +// /// WORKAROUND for issue #1798. SUIT_ViewManager::closeAllViews() should nullify myActiveView +// /// As a result, we need to check views count in manager +// if (aMgr->getViews().size() > 0) { +// OCCViewer_ViewFrame* aView = dynamic_cast(aMgr->getActiveView()); +// if (aView) { +// OCCViewer_ViewWindow* aWnd = aView->getView(OCCViewer_ViewFrame::MAIN_VIEW); +// Handle(V3d_View) aView3d = aWnd->getViewPort()->getView(); +// aView3d->ZFitAll(); +// if (aView3d->Depth() < 0.1) +// aView3d->DepthFitAll(); +// } +// } +//} \ No newline at end of file diff --git a/src/SHAPERGUI/SHAPERGUI_SalomeViewer.h b/src/SHAPERGUI/SHAPERGUI_SalomeViewer.h index 1deee5167..7e02278a1 100644 --- a/src/SHAPERGUI/SHAPERGUI_SalomeViewer.h +++ b/src/SHAPERGUI/SHAPERGUI_SalomeViewer.h @@ -150,7 +150,7 @@ Q_OBJECT void activateViewer(bool toActivate); // Fit all along Z (perpendicular to display) - virtual void Zfitall(); + //virtual void Zfitall(); private slots: void onMousePress(SUIT_ViewWindow*, QMouseEvent*); diff --git a/src/XGUI/XGUI_Displayer.cpp b/src/XGUI/XGUI_Displayer.cpp index c807f222e..fc9b169df 100644 --- a/src/XGUI/XGUI_Displayer.cpp +++ b/src/XGUI/XGUI_Displayer.cpp @@ -961,7 +961,7 @@ void XGUI_Displayer::updateViewer() const { Handle(AIS_InteractiveContext) aContext = AISContext(); if (!aContext.IsNull() && isUpdateEnabled()) { - myWorkshop->viewer()->Zfitall(); + //myWorkshop->viewer()->Zfitall(); aContext->UpdateCurrentViewer(); } else { myNeedUpdate = true; diff --git a/src/XGUI/XGUI_ViewerProxy.cpp b/src/XGUI/XGUI_ViewerProxy.cpp index 1b9e3fb0e..e31fe57ea 100644 --- a/src/XGUI/XGUI_ViewerProxy.cpp +++ b/src/XGUI/XGUI_ViewerProxy.cpp @@ -373,18 +373,18 @@ bool XGUI_ViewerProxy::canDragByMouse() const //*************************************** -void XGUI_ViewerProxy::Zfitall() -{ -#ifdef HAVE_SALOME - myWorkshop->salomeConnector()->viewer()->Zfitall(); -#else - AppElements_Viewer* aViewer = myWorkshop->mainWindow()->viewer(); - AppElements_ViewWindow* aView = aViewer->activeViewWindow(); - if (aView) { - Handle(V3d_View) aView3d = aView->v3dView(); - aView3d->ZFitAll(); - if (aView3d->Depth() < 0.1) - aView3d->DepthFitAll(); - } -#endif -} \ No newline at end of file +//void XGUI_ViewerProxy::Zfitall() +//{ +//#ifdef HAVE_SALOME +// myWorkshop->salomeConnector()->viewer()->Zfitall(); +//#else +// AppElements_Viewer* aViewer = myWorkshop->mainWindow()->viewer(); +// AppElements_ViewWindow* aView = aViewer->activeViewWindow(); +// if (aView) { +// Handle(V3d_View) aView3d = aView->v3dView(); +// aView3d->ZFitAll(); +// if (aView3d->Depth() < 0.1) +// aView3d->DepthFitAll(); +// } +//#endif +//} \ No newline at end of file diff --git a/src/XGUI/XGUI_ViewerProxy.h b/src/XGUI/XGUI_ViewerProxy.h index 9969ae9e4..24b945ddf 100644 --- a/src/XGUI/XGUI_ViewerProxy.h +++ b/src/XGUI/XGUI_ViewerProxy.h @@ -95,7 +95,7 @@ Q_OBJECT virtual bool canDragByMouse() const; // Fit all along Z (perpendicular to display) - virtual void Zfitall(); + //virtual void Zfitall(); signals: /// Emits by mouse entering the view port -- 2.39.2