mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2024-11-12 00:29:17 +05:00
Define canBreakLink parameter
This commit is contained in:
parent
779967e2f5
commit
b8ddb1330c
@ -4888,7 +4888,7 @@ void SMESHGUI::initialize( CAM_Application* app )
|
||||
popupMgr()->insert( separator(), -1, -1 );
|
||||
|
||||
popupMgr()->insert( action( SMESHOp::OpBreakLink), -1, -1 );
|
||||
popupMgr()->setRule( action( SMESHOp::OpBreakLink), "$component={'SHAPERSTUDY'} and client='ObjectBrowser'", QtxPopupMgr::VisibleRule );
|
||||
popupMgr()->setRule( action( SMESHOp::OpBreakLink), "$component={'SHAPERSTUDY'} and client='ObjectBrowser' and canBreakLink", QtxPopupMgr::VisibleRule );
|
||||
|
||||
connect( application(), SIGNAL( viewManagerActivated( SUIT_ViewManager* ) ),
|
||||
this, SLOT( onViewManagerActivated( SUIT_ViewManager* ) ) );
|
||||
|
@ -140,6 +140,7 @@ QVariant SMESHGUI_Selection::parameter( const int ind, const QString& p ) const
|
||||
else if ( p=="nbChildren") val = QVariant( nbChildren( ind ) );
|
||||
else if ( p=="isContainer") val = QVariant( isContainer( ind ) );
|
||||
else if ( p=="guiState") val = QVariant( guiState() );
|
||||
else if ( p=="canBreakLink") val = QVariant( canBreakLink(ind) );
|
||||
|
||||
if ( val.isValid() )
|
||||
return val;
|
||||
@ -605,6 +606,20 @@ bool SMESHGUI_Selection::hasGeomReference( int ind ) const
|
||||
return false;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : canBreakLink
|
||||
//purpose : returns true if selected object is a Shaper object and it can break link
|
||||
//=======================================================================
|
||||
|
||||
bool SMESHGUI_Selection::canBreakLink( int ind ) const
|
||||
{
|
||||
if ( ind >= 0 && ind < myTypes.count()) {
|
||||
_PTR(SObject) so = SMESH::getStudy()->FindObjectID( entry( ind ).toUtf8().data() );
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : isEditableHyp
|
||||
//purpose :
|
||||
|
@ -61,6 +61,7 @@ public:
|
||||
virtual bool hasGeomReference( int ) const;
|
||||
virtual bool isEditableHyp( int ) const;
|
||||
virtual bool isVisible( int ) const;
|
||||
virtual bool canBreakLink(int) const;
|
||||
|
||||
virtual bool isQuadratic( int ) const;
|
||||
virtual QString quadratic2DMode( int ) const;
|
||||
|
Loading…
Reference in New Issue
Block a user