From 40dbe4f919250386d298662dfdd4cdc4a0bb8f6d Mon Sep 17 00:00:00 2001 From: vsv Date: Fri, 27 May 2005 05:42:28 +0000 Subject: [PATCH] Bug 8828: Translate opertation for locked study --- src/VISUGUI/VisuGUI.cxx | 13 ++++++++----- src/VISUGUI/VisuGUI_OffsetDlg.cxx | 13 +++++++++---- src/VISUGUI/VisuGUI_TimeAnimation.cxx | 22 +++++++++++++++------- 3 files changed, 32 insertions(+), 16 deletions(-) diff --git a/src/VISUGUI/VisuGUI.cxx b/src/VISUGUI/VisuGUI.cxx index 61922f31..9babe860 100644 --- a/src/VISUGUI/VisuGUI.cxx +++ b/src/VISUGUI/VisuGUI.cxx @@ -2941,9 +2941,10 @@ bool VisuGUI::CustomPopup (QAD_Desktop* parent, QPopupMenu* thePopup, const QStr thePopup->clear(); if ( nbSel == 0 ) { - if ( theParent == "Viewer" && isVTKViewer && !aIsLocked) { + if ( theParent == "Viewer" && isVTKViewer) { thePopup->insertItem( "Arrange actors...", visuGUI, SLOT( ArrangeActors() ) ); - thePopup->insertItem( "Save view parameters", visuGUI, SLOT( SaveViewParams() ) ); + if (!aIsLocked) + thePopup->insertItem( "Save view parameters", visuGUI, SLOT( SaveViewParams() ) ); } return false; } @@ -3181,7 +3182,8 @@ bool VisuGUI::CustomPopup (QAD_Desktop* parent, QPopupMenu* thePopup, const QStr } if (isVTKViewer) { - thePopup->insertItem("Translate...", visuGUI, SLOT(TranslatePrs())); + if ( !isStudyLocked( GetActiveStudy()->getStudyDocument() ) ) + thePopup->insertItem("Translate...", visuGUI, SLOT(TranslatePrs())); thePopup->insertItem("Clipping planes", visuGUI, SLOT(ClippingPlanes())); if ( theParent == "Viewer" && @@ -4588,7 +4590,8 @@ void VisuGUI::ArrangeActors() { VTKViewer_ViewFrame* aViewFrame = GetVtkViewFrame(); if (aViewFrame) { - ArrangeDlg aDlg(GetDesktop(), aViewFrame); - aDlg.exec(); + ArrangeDlg* aDlg = new ArrangeDlg(GetDesktop(), aViewFrame); + aDlg->exec(); + delete aDlg; } } diff --git a/src/VISUGUI/VisuGUI_OffsetDlg.cxx b/src/VISUGUI/VisuGUI_OffsetDlg.cxx index 4ab146f7..e09c21c8 100644 --- a/src/VISUGUI/VisuGUI_OffsetDlg.cxx +++ b/src/VISUGUI/VisuGUI_OffsetDlg.cxx @@ -58,9 +58,11 @@ VisuGUI_OffsetDlg::VisuGUI_OffsetDlg(VISU::Prs3d_i* thePrs) TopLayout->addWidget(aOffsetsPane); - mySaveChk = new QCheckBox("Save to presentation", this); - mySaveChk->setChecked(true); - TopLayout->addWidget(mySaveChk); + if (!VisuGUI::GetActiveStudy()->getStudyDocument()->GetProperties()->IsLocked()) { + mySaveChk = new QCheckBox("Save to presentation", this); + TopLayout->addWidget(mySaveChk); + mySaveChk->setChecked(true); + } // Common buttons =========================================================== QGroupBox* GroupButtons = new QGroupBox( this, "GroupButtons" ); @@ -129,7 +131,10 @@ void VisuGUI_OffsetDlg::onReset() bool VisuGUI_OffsetDlg::isToSave() const { - return mySaveChk->isChecked(); + if (!VisuGUI::GetActiveStudy()->getStudyDocument()->GetProperties()->IsLocked()) + return mySaveChk->isChecked(); + else + return false; } diff --git a/src/VISUGUI/VisuGUI_TimeAnimation.cxx b/src/VISUGUI/VisuGUI_TimeAnimation.cxx index 00f0d8da..e734aea3 100644 --- a/src/VISUGUI/VisuGUI_TimeAnimation.cxx +++ b/src/VISUGUI/VisuGUI_TimeAnimation.cxx @@ -87,9 +87,11 @@ ArrangeDlg::ArrangeDlg(QWidget* theParent, VTKViewer_ViewFrame* theViewFrame) vtkActor* anActor; vtkActorCollection *anActColl = myViewFrame->getRenderer()->GetActors(); for (anActColl->InitTraversal(); (anActor = anActColl->GetNextActor()) != NULL;) { - if (VISU_Actor* anVISUActor = dynamic_cast(anActor)) - if (anVISUActor->GetVisibility() != 0) - if (VISU::Prs3d_i* aPrs = anVISUActor->GetParent()->GetPrs3d()) { + VISU_Actor* anVISUActor = dynamic_cast(anActor); + if (anVISUActor) + if (anVISUActor->GetVisibility() != 0) { + VISU::Prs3d_i* aPrs = anVISUActor->GetParent()->GetPrs3d(); + if (aPrs) { if (!myPrsMap.contains(aPrs)) { SALOMEDS::SObject_var aSObject = aPrs->GetSObject(); if(!aSObject->_is_nil()){ @@ -107,6 +109,7 @@ ArrangeDlg::ArrangeDlg(QWidget* theParent, VTKViewer_ViewFrame* theViewFrame) } } } + } } myFieldLst->insertStringList(aPrsNames); myFieldLst->setSelected(0, true); @@ -191,10 +194,12 @@ void ArrangeDlg::init() connect(aBtnGrp, SIGNAL(clicked(int)), myStackWgt, SLOT(raiseWidget(int)) ); - if (!myAnimator) { + if (!myAnimator && (!VisuGUI::GetActiveStudy()->getStudyDocument()->GetProperties()->IsLocked())) { mySaveChk = new QCheckBox("Save to presentation", this); mySaveChk->setChecked(false); aMainLayout->addWidget(mySaveChk); + } else { + mySaveChk = 0; } // Common buttons =========================================================== @@ -311,7 +316,9 @@ void ArrangeDlg::acceptViewWindow() VISU::Prs3d_i* aPrs = it.key(); Offset& aOffs = myOffsets[it.data()]; if (VISU_Actor* anActor = VisuGUI::GetActor(aPrs, myViewFrame)) anActor->SetPosition(aOffs.myOffset); - if (mySaveChk->isChecked())aPrs->SetOffset(aOffs.myOffset); + if (mySaveChk) + if (mySaveChk->isChecked()) + aPrs->SetOffset(aOffs.myOffset); } } else { float aDist = 0; @@ -342,8 +349,9 @@ void ArrangeDlg::acceptViewWindow() aOffset[0] = aOffset[1] = aOffset[2] = 0; aOffset[aAxis] = aDist * i; aActor->SetPosition(aOffset); - - if (mySaveChk->isChecked())aPrs->SetOffset(aOffset); + if (mySaveChk) + if (mySaveChk->isChecked()) + aPrs->SetOffset(aOffset); } } } -- 2.39.2