mgr->setRule( action( VISU_FILE_INFO ), "selcount=1 and type in {'VISU::TRESULT'}" );
mgr->setRule( action( VISU_EXPORT_MED ), "selcount=1 and type in {'VISU::TRESULT'}" );
- aRule = "isPlot2dViewer and isVisible and selcount=1 and type='VISU::TCURVE' and hasDeviation";
+ aRule = "isPlot2dViewer and isVisible and selcount > 0 and type='VISU::TCURVE' and hasDeviation";
mgr->setRule (action(VISU_SHOW_DEVIATION), aRule , QtxPopupMgr::VisibleRule);
aRule = "isPlot2dViewer and isVisible and selcount > 0 and type='VISU::TCURVE' and hasDeviation and isDeviationDisplayed";
mgr->setRule (action(VISU_SHOW_DEVIATION), aRule , QtxPopupMgr::ToggleRule);
void VisuGUI::OnShowDeviation() {
- VISU::TSelectionInfo aSelectionInfo = VISU::GetSelectedObjects(this);
- if(aSelectionInfo.size() != 1)
+ if(IsStudyLocked(GetCStudy(GetAppStudy(this))))
return;
- VISU::TSelectionItem aSelectionItem = aSelectionInfo.front();
- Handle(SALOME_InteractiveObject) anIO = aSelectionItem.myIO;
- VISU::Base_i* aBase = aSelectionItem.myObjectInfo.myBase;
- if(!aBase)
+ QAction* anAction = action(VISU_SHOW_DEVIATION);
+ if(!anAction)
return;
- if(aBase->GetType() == VISU::TCURVE) {
- if(!IsStudyLocked(GetCStudy(GetAppStudy(this)))){
+ bool anIsShow = anAction->isChecked();
+
+ VISU::TSelectionInfo aSelectionInfo = VISU::GetSelectedObjects(this);
+ if(aSelectionInfo.empty())
+ return;
+
+ TSelectionInfo::iterator anIter = aSelectionInfo.begin();
+ for( ; anIter != aSelectionInfo.end(); anIter++ )
+ {
+ VISU::TSelectionItem aSelectionItem = *anIter;
+ Handle(SALOME_InteractiveObject) anIO = aSelectionItem.myIO;
+ VISU::Base_i* aBase = aSelectionItem.myObjectInfo.myBase;
+ if(aBase && aBase->GetType() == VISU::TCURVE) {
// Curve object
if(VISU::Curve_i* aCurve = dynamic_cast<VISU::Curve_i*>(aBase)) {
- aCurve->ShowDeviation(!aCurve->isDeviationShown());
- PlotCurve(this, aCurve, VISU::eDisplay);
+ aCurve->ShowDeviation(anIsShow);
+ if( displayer()->IsDisplayed( anIO->getEntry() ) )
+ PlotCurve(this, aCurve, VISU::eDisplay);
}
}
}