From b9bef2981816fe74494e020341132139346a2541 Mon Sep 17 00:00:00 2001 From: jfa Date: Thu, 2 Jul 2009 11:44:45 +0000 Subject: [PATCH] Bug 0020409: EDF GUI: Rotation point. --- src/OCCViewer/OCCViewer_ViewWindow.cxx | 46 ++++++++++++++------------ 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/src/OCCViewer/OCCViewer_ViewWindow.cxx b/src/OCCViewer/OCCViewer_ViewWindow.cxx index a366dfbb5..32298e99b 100755 --- a/src/OCCViewer/OCCViewer_ViewWindow.cxx +++ b/src/OCCViewer/OCCViewer_ViewWindow.cxx @@ -21,7 +21,7 @@ // // File : OCCViewer_ViewWindow.cxx // Author : -// + #include "OCCViewer_ViewWindow.h" #include "OCCViewer_ViewModel.h" #include "OCCViewer_ViewPort3d.h" @@ -1046,9 +1046,10 @@ void OCCViewer_ViewWindow::createActions() connect(aAction, SIGNAL(triggered()), this, SLOT(onResetView())); toolMgr()->registerAction( aAction, ResetId ); - // Reset - aAction = new QtxAction(tr("MNU_CLONE_VIEW"), aResMgr->loadPixmap( "OCCViewer", tr( "ICON_OCCVIEWER_CLONE_VIEW" ) ), - tr( "MNU_CLONE_VIEW" ), 0, this); + // Clone + aAction = new QtxAction(tr("MNU_CLONE_VIEW"), + aResMgr->loadPixmap("OCCViewer", tr("ICON_OCCVIEWER_CLONE_VIEW")), + tr("MNU_CLONE_VIEW"), 0, this); aAction->setStatusTip(tr("DSC_CLONE_VIEW")); connect(aAction, SIGNAL(triggered()), this, SLOT(onCloneView())); toolMgr()->registerAction( aAction, CloneId ); @@ -1241,30 +1242,31 @@ void OCCViewer_ViewWindow::onFitAll() */ void OCCViewer_ViewWindow::onSetRotationPoint( bool on ) { - if ( on ) + if (on) + { + if (!mySetRotationPointDlg) { - if ( !mySetRotationPointDlg ) - { - mySetRotationPointDlg = new OCCViewer_SetRotationPointDlg( this, myDesktop ); - mySetRotationPointDlg->SetAction( mySetRotationPointAction ); - } + mySetRotationPointDlg = new OCCViewer_SetRotationPointDlg (this, myDesktop); + mySetRotationPointDlg->SetAction(mySetRotationPointAction); + } - if ( !mySetRotationPointDlg->isVisible() ) + if (!mySetRotationPointDlg->isVisible()) + { + //if (mySetRotationPointDlg->IsFirstShown()) + if (myCurrPointType == GRAVITY) { - if ( mySetRotationPointDlg->IsFirstShown() ) - { - Standard_Real Xcenter, Ycenter, Zcenter; - if ( computeGravityCenter( Xcenter, Ycenter, Zcenter ) ) - mySetRotationPointDlg->setCoords( Xcenter, Ycenter, Zcenter ); - } - mySetRotationPointDlg->show(); + Standard_Real Xcenter, Ycenter, Zcenter; + if (computeGravityCenter(Xcenter, Ycenter, Zcenter)) + mySetRotationPointDlg->setCoords(Xcenter, Ycenter, Zcenter); } + mySetRotationPointDlg->show(); } + } else - { - if ( mySetRotationPointDlg->isVisible() ) - mySetRotationPointDlg->hide(); - } + { + if (mySetRotationPointDlg->isVisible()) + mySetRotationPointDlg->hide(); + } } /*! -- 2.39.2