}
}
+ // Break link with Shaper model
+ void breakShaperLink()
+ {
+ LightApp_SelectionMgr *aSel = SMESHGUI::selectionMgr();
+ SALOME_ListIO selected;
+ if (aSel) {
+ aSel->selectedObjects(selected);
+ if (selected.Extent()) {
+ Handle(SALOME_InteractiveObject) anIObject = selected.First();
+ _PTR(Study) aStudy = SMESH::getStudy();
+ _PTR(SObject) aSObj = aStudy->FindObjectID(anIObject->getEntry());
+ if (aSObj) {
+ std::string aName = aSObj->GetName();
+ QMessageBox::StandardButton aRes = SUIT_MessageBox::warning(SMESHGUI::desktop(),
+ QObject::tr("SMESH_WRN_WARNING"),
+ QObject::tr("MSG_BREAK_SHAPER_LINK").arg(aName.c_str()),
+ SUIT_MessageBox::Yes | SUIT_MessageBox::No, SUIT_MessageBox::No);
+ if (aRes == SUIT_MessageBox::Yes) {
+ // Remove link here
+ }
+ }
+ }
+ }
+ }
+
void SetDisplayMode(int theCommandID, VTK::MarkerMap& theMarkerMap)
{
SALOME_ListIO selected;
case SMESHOp::OpSortChild:
::sortChildren();
break;
+ case SMESHOp::OpBreakLink:
+ ::breakShaperLink();
+ break;
}
createSMESHAction( SMESHOp::OpSortChild, "SORT_CHILD_ITEMS" );
+ createSMESHAction( SMESHOp::OpBreakLink, "BREAK_SHAPER_LINK" );
+
QList<int> aCtrlActions;
aCtrlActions << SMESHOp::OpFreeNode << SMESHOp::OpEqualNode
<< SMESHOp::OpNodeConnectivityNb // node controls
popupMgr()->setRule( action( SMESHOp::OpSortChild ), "$component={'SMESH'} and client='ObjectBrowser' and isContainer and nbChildren>1", QtxPopupMgr::VisibleRule );
popupMgr()->insert( separator(), -1, -1 );
+ popupMgr()->insert( action( SMESHOp::OpBreakLink), -1, -1 );
+ popupMgr()->setRule( action( SMESHOp::OpBreakLink), "$component={'SHAPERSTUDY'} and client='ObjectBrowser'", QtxPopupMgr::VisibleRule );
+
connect( application(), SIGNAL( viewManagerActivated( SUIT_ViewManager* ) ),
this, SLOT( onViewManagerActivated( SUIT_ViewManager* ) ) );
OpClipping = 6100, // POPUP MENU - CLIPPING
// SortChild ----------------------//--------------------------------
OpSortChild = 6110, // POPUP MENU - SORT CHILDREN
+ // Break link with Shaper object --//--------------------------------
+ OpBreakLink = 6120, // POPUP MENU - Break link with Shaper
// Advanced -----------------------//--------------------------------
OpAdvancedNoOp = 10000, // NO OPERATION (advanced operations base)
//@@ insert new functions before this line @@ do not remove this line @@//
<source>STB_SORT_CHILD_ITEMS</source>
<translation>Sort child items</translation>
</message>
+ <message>
+ <source>MEN_BREAK_SHAPER_LINK</source>
+ <translation>Break link</translation>
+ </message>
+ <message>
+ <source>STB_BREAK_SHAPER_LINK</source>
+ <translation>Break link with Shaper model</translation>
+ </message>
+ <message>
+ <source>MSG_BREAK_SHAPER_LINK</source>
+ <translation>A link with Shaper model for object %1 will be broken.
+Continue?</translation>
+ </message>
<message>
<source>SMESH_ADVANCED</source>
<translation>Advanced</translation>