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;
}
}
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" &&
{
VTKViewer_ViewFrame* aViewFrame = GetVtkViewFrame();
if (aViewFrame) {
- ArrangeDlg aDlg(GetDesktop(), aViewFrame);
- aDlg.exec();
+ ArrangeDlg* aDlg = new ArrangeDlg(GetDesktop(), aViewFrame);
+ aDlg->exec();
+ delete aDlg;
}
}
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" );
bool VisuGUI_OffsetDlg::isToSave() const
{
- return mySaveChk->isChecked();
+ if (!VisuGUI::GetActiveStudy()->getStudyDocument()->GetProperties()->IsLocked())
+ return mySaveChk->isChecked();
+ else
+ return false;
}
vtkActor* anActor;
vtkActorCollection *anActColl = myViewFrame->getRenderer()->GetActors();
for (anActColl->InitTraversal(); (anActor = anActColl->GetNextActor()) != NULL;) {
- if (VISU_Actor* anVISUActor = dynamic_cast<VISU_Actor*>(anActor))
- if (anVISUActor->GetVisibility() != 0)
- if (VISU::Prs3d_i* aPrs = anVISUActor->GetParent()->GetPrs3d()) {
+ VISU_Actor* anVISUActor = dynamic_cast<VISU_Actor*>(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()){
}
}
}
+ }
}
myFieldLst->insertStringList(aPrsNames);
myFieldLst->setSelected(0, true);
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 ===========================================================
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;
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);
}
}
}