From 87682eb21a06808ce932d9ba0f1b16f4d82926a3 Mon Sep 17 00:00:00 2001 From: vsv Date: Wed, 11 Sep 2019 19:25:24 +0300 Subject: [PATCH] Modification according to remarks --- src/ModuleBase/ModuleBase_IViewer.h | 7 ++----- src/PartSet/PartSet_SketcherMgr.cpp | 6 +++--- src/PartSet/PartSet_SketcherMgr.h | 2 +- src/XGUI/XGUI_ViewerProxy.cpp | 17 ++++------------- src/XGUI/XGUI_ViewerProxy.h | 6 ++---- 5 files changed, 12 insertions(+), 26 deletions(-) diff --git a/src/ModuleBase/ModuleBase_IViewer.h b/src/ModuleBase/ModuleBase_IViewer.h index e4c4a7dcc..d7f1a32c5 100644 --- a/src/ModuleBase/ModuleBase_IViewer.h +++ b/src/ModuleBase/ModuleBase_IViewer.h @@ -199,15 +199,12 @@ Q_OBJECT #ifdef HAVE_SALOME virtual void setFitter(OCCViewer_Fitter* theFitter) = 0; - virtual OCCViewer_Fitter* currentFitter() const = 0; + virtual OCCViewer_Fitter* fitter() const = 0; #else virtual void setFitter(AppElements_Fitter* theFitter) = 0; - virtual AppElements_Fitter* currentFitter() const = 0; + virtual AppElements_Fitter* fitter() const = 0; #endif - virtual void unsetFitter() = 0; - - static Handle(Prs3d_Drawer) DefaultHighlightDrawer; diff --git a/src/PartSet/PartSet_SketcherMgr.cpp b/src/PartSet/PartSet_SketcherMgr.cpp index 774742d8a..6370d6c4b 100644 --- a/src/PartSet/PartSet_SketcherMgr.cpp +++ b/src/PartSet/PartSet_SketcherMgr.cpp @@ -1107,8 +1107,8 @@ void PartSet_SketcherMgr::startSketch(ModuleBase_Operation* theOperation) void PartSet_SketcherMgr::stopSketch(ModuleBase_Operation* theOperation) { XGUI_ModuleConnector* aConnector = dynamic_cast(myModule->workshop()); - PartSet_Fitter* aFitter = (PartSet_Fitter*)myModule->workshop()->viewer()->currentFitter(); - myModule->workshop()->viewer()->unsetFitter(); + PartSet_Fitter* aFitter = (PartSet_Fitter*)myModule->workshop()->viewer()->fitter(); + myModule->workshop()->viewer()->setFitter(0); delete aFitter; myIsMouseOverWindow = false; @@ -2108,7 +2108,7 @@ void PartSet_SketcherMgr::onShowPoints(bool toShow) } -void PartSet_Fitter::fitScene(Handle(V3d_View) theView) +void PartSet_Fitter::fitAll(Handle(V3d_View) theView) { Bnd_Box aBndBox; int aNumberOfSubs = mySketch->numberOfSubs(); diff --git a/src/PartSet/PartSet_SketcherMgr.h b/src/PartSet/PartSet_SketcherMgr.h index 4920caa39..bfc8bfac6 100644 --- a/src/PartSet/PartSet_SketcherMgr.h +++ b/src/PartSet/PartSet_SketcherMgr.h @@ -82,7 +82,7 @@ public: /// A method which has top be reimplemented to provide alterantive implementation FitAll command /// \param theView - a view which has to be fit - virtual void fitScene(Handle(V3d_View) theView); + virtual void fitAll(Handle(V3d_View) theView); private: CompositeFeaturePtr mySketch; diff --git a/src/XGUI/XGUI_ViewerProxy.cpp b/src/XGUI/XGUI_ViewerProxy.cpp index 16fe9ee86..84e45201e 100644 --- a/src/XGUI/XGUI_ViewerProxy.cpp +++ b/src/XGUI/XGUI_ViewerProxy.cpp @@ -732,9 +732,9 @@ void XGUI_ViewerProxy::setFitter(OCCViewer_Fitter* theFitter) myWorkshop->salomeConnector()->viewer()->setFitter(theFitter); } -OCCViewer_Fitter* XGUI_ViewerProxy::currentFitter() const +OCCViewer_Fitter* XGUI_ViewerProxy::fitter() const { - return myWorkshop->salomeConnector()->viewer()->currentFitter(); + return myWorkshop->salomeConnector()->viewer()->fitter(); } #else void XGUI_ViewerProxy::setFitter(AppElements_Fitter* theFitter) @@ -742,17 +742,8 @@ void XGUI_ViewerProxy::setFitter(AppElements_Fitter* theFitter) myWorkshop->mainWindow()->viewer()->setFitter(theFitter); } -AppElements_Fitter* XGUI_ViewerProxy::currentFitter() const +AppElements_Fitter* XGUI_ViewerProxy::fitter() const { - return myWorkshop->mainWindow()->viewer()->currentFitter(); + return myWorkshop->mainWindow()->viewer()->fitter(); } #endif - -void XGUI_ViewerProxy::unsetFitter() -{ -#ifdef HAVE_SALOME - myWorkshop->salomeConnector()->viewer()->unsetFitter(); -#else - myWorkshop->mainWindow()->viewer()->unsetFitter(); -#endif -} diff --git a/src/XGUI/XGUI_ViewerProxy.h b/src/XGUI/XGUI_ViewerProxy.h index b1cbec119..723aae644 100644 --- a/src/XGUI/XGUI_ViewerProxy.h +++ b/src/XGUI/XGUI_ViewerProxy.h @@ -171,14 +171,12 @@ Q_OBJECT #ifdef HAVE_SALOME virtual void setFitter(OCCViewer_Fitter* theFitter); - virtual OCCViewer_Fitter* currentFitter() const; + virtual OCCViewer_Fitter* fitter() const; #else virtual void setFitter(AppElements_Fitter* theFitter); - virtual AppElements_Fitter* currentFitter() const; + virtual AppElements_Fitter* fitter() const; #endif - virtual void unsetFitter(); - signals: /// Emits by mouse entering the view port void enterViewPort(); -- 2.39.2