X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMESHGUI%2FSMESHGUI.cxx;h=082159299d77fa19a1733d6d56aba1cf7431c738;hp=d696c0ba2bfdc609e9e38eade8b530f1b04553bf;hb=8a1ff9ba77b7b72b64b08134f941b56aac80ff55;hpb=65c1beab50fcec33a4e988c10b3fedb081543164 diff --git a/src/SMESHGUI/SMESHGUI.cxx b/src/SMESHGUI/SMESHGUI.cxx index d696c0ba2..082159299 100644 --- a/src/SMESHGUI/SMESHGUI.cxx +++ b/src/SMESHGUI/SMESHGUI.cxx @@ -151,6 +151,9 @@ #include #include #include +#include +#include +#include // BOOST includes #include @@ -195,7 +198,7 @@ namespace void SetDisplayEntity(int theCommandID); - int ActionToControl( int theID, bool theReversed = false ); + int ActionToControl( int theID, bool theReversed = false ); void Control( int theCommandID ); @@ -265,14 +268,16 @@ namespace filter, QObject::tr( "SMESH_IMPORT_MESH" ) ); } - if ( filenames.count() > 0 ) { + if ( filenames.count() > 0 ) + { SUIT_OverrideCursor wc; _PTR(Study) aStudy = SMESH::GetActiveStudyDocument(); QStringList errors; QStringList anEntryList; bool isEmpty = false; - for ( QStringList::ConstIterator it = filenames.begin(); it != filenames.end(); ++it ) { + for ( QStringList::ConstIterator it = filenames.begin(); it != filenames.end(); ++it ) + { QString filename = *it; SMESH::mesh_array_var aMeshes = new SMESH::mesh_array; try { @@ -365,7 +370,8 @@ namespace arg( QObject::tr( "SMESH_ERR_UNKNOWN_IMPORT_ERROR" ) ) ); } - for ( int i = 0, iEnd = aMeshes->length(); i < iEnd; i++ ) { + for ( int i = 0, iEnd = aMeshes->length(); i < iEnd; i++ ) + { _PTR(SObject) aMeshSO = SMESH::FindSObject( aMeshes[i] ); if ( aMeshSO ) { _PTR(StudyBuilder) aBuilder = aStudy->NewBuilder(); @@ -441,7 +447,10 @@ namespace const bool multiMeshSupported = ( isMED || isCGNS ); // file can hold several meshes if ( selected.Extent() == 0 || ( selected.Extent() > 1 && !multiMeshSupported )) return; - + SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr(); + bool aCheckWarn = true; + if ( resMgr ) + aCheckWarn = resMgr->booleanValue( "SMESH", "show_warning", false ); // get mesh object from selection and check duplication of their names bool hasDuplicatedMeshNames = false; QList< QPair< SMESH::SMESH_IDSource_var, QString > > aMeshList; @@ -458,6 +467,30 @@ namespace QObject::tr( "SMESH_BAD_MESH_SELECTION" )); return; } + SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow( aMeshItem ); + if ( aCheckWarn && !aGroup->_is_nil() ) { + QMessageBox msgBox(SUIT_MessageBox::Warning,QObject::tr("SMESH_WRN_WARNING"), + QObject::tr("SMESH_EXPORT_ONLY_GPOUP"),QMessageBox::StandardButton::NoButton, SMESHGUI::desktop()); + QCheckBox dontShowCheckBox(QObject::tr("SMESH_WRN_SHOW_DLG_CHECKBOX")); + msgBox.addButton(QMessageBox::Ok); + msgBox.addButton(QMessageBox::Cancel); + msgBox.setDefaultButton(QMessageBox::Cancel); + QGridLayout* lt = qobject_cast(msgBox.layout()); + QDialogButtonBox* btnbox = msgBox.findChild(); + lt->addWidget(&dontShowCheckBox, lt->rowCount(), lt->columnCount()-1, lt->rowCount(), lt->columnCount()); + lt->addWidget(btnbox, lt->rowCount(), 0, lt->rowCount(), lt->columnCount()); + if(msgBox.exec() == QMessageBox::Ok) + { + if(dontShowCheckBox.checkState() == Qt::Checked) + { + if ( resMgr ) + resMgr->setValue( "SMESH", "show_warning", false); + } + aCheckWarn = false; + } + else + return; + } QString aMeshName = anIObject->getName(); @@ -587,7 +620,7 @@ namespace }; // is typeMsg complete? (compilation failure mains that enum SMDSAbs_EntityType changed) const int nbTypes = sizeof( typeMsg ) / sizeof( const char* ); - int _assert[( nbTypes == SMESH::Entity_Last ) ? 1 : -1 ]; _assert[0]=1; + int _assert[( nbTypes == SMESH::Entity_Last ) ? 2 : -1 ]; _assert[0]=_assert[1]; QString andStr = " " + QObject::tr("SMESH_AND") + " ", comma(", "); for ( size_t iType = 0; iType < presentNotSupported.size(); ++iType ) { @@ -612,7 +645,6 @@ namespace // Init the parameters with the default values bool aIsASCII_STL = true; bool toCreateGroups = false; - SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr(); if ( resMgr ) toCreateGroups = resMgr->booleanValue( "SMESH", "auto_groups", false ); bool toOverwrite = true; @@ -943,6 +975,7 @@ namespace aSel->selectedObjects( selected ); if ( selected.Extent() >= 1 ) { + SUIT_OverrideCursor wc; SALOME_ListIteratorOfListIO It( selected ); for( ; It.More(); It.Next()){ Handle(SALOME_InteractiveObject) IObject = It.Value(); @@ -1110,6 +1143,8 @@ namespace type = QObject::tr( "EQUAL_FACE" ); else if ( dynamic_cast< SMESH::Controls::CoincidentElements3D* >( f.get() ) ) type = QObject::tr( "EQUAL_VOLUME" ); + else if ( dynamic_cast< SMESH::Controls::NodeConnectivityNumber* >( f.get() ) ) + type = QObject::tr( "NODE_CONNECTIVITY_NB" ); return type; } @@ -1561,6 +1596,7 @@ namespace return; } // case SMESHOp::OpProperties: } // switch(theCommandID) + SUIT_OverrideCursor wc; SALOME_ListIteratorOfListIO It( selected ); for( ; It.More(); It.Next()){ Handle(SALOME_InteractiveObject) IObject = It.Value(); @@ -1604,6 +1640,7 @@ namespace ActionControl.Bind( 0, SMESH_Actor::eNone ); ActionControl.Bind( SMESHOp::OpFreeNode, SMESH_Actor::eFreeNodes ); ActionControl.Bind( SMESHOp::OpEqualNode, SMESH_Actor::eCoincidentNodes ); + ActionControl.Bind( SMESHOp::OpNodeConnectivityNb, SMESH_Actor::eNodeConnectivityNb ); ActionControl.Bind( SMESHOp::OpFreeEdge, SMESH_Actor::eFreeEdges ); ActionControl.Bind( SMESHOp::OpFreeBorder, SMESH_Actor::eFreeBorders ); ActionControl.Bind( SMESHOp::OpLength, SMESH_Actor::eLength ); @@ -1634,11 +1671,11 @@ namespace void Control( int theCommandID ) { - SMESH_Actor::eControl aControl = SMESH_Actor::eControl( ActionToControl( theCommandID ) ); + SMESH_Actor::eControl aControl = SMESH_Actor::eControl( ActionToControl( theCommandID )); _PTR(Study) aStudy = SMESH::GetActiveStudyDocument(); - LightApp_SelectionMgr *aSel = SMESHGUI::selectionMgr(); + SALOME_ListIO selected; - if ( aSel ) + if ( LightApp_SelectionMgr *aSel = SMESHGUI::selectionMgr() ) aSel->selectedObjects( selected ); if ( !selected.IsEmpty() ) { @@ -1646,15 +1683,28 @@ namespace for ( ; It.More(); It.Next()) { Handle(SALOME_InteractiveObject) anIO = It.Value(); - if(!anIO.IsNull()){ + if ( !anIO.IsNull() ) { _PTR(SObject) SO = aStudy->FindObjectID( It.Value()->getEntry() ); if ( SO ) { CORBA::Object_var aObject = SMESH::SObjectToObject( SO ); SMESH::SMESH_IDSource_var anIDSrc = SMESH::SMESH_IDSource::_narrow( aObject ); if ( !anIDSrc->_is_nil() ) { - if ( SMESH_Actor *anActor = SMESH::FindActorByEntry( anIO->getEntry()) ) { - QString functorName = functorToString( anActor->GetFunctor() ); + SMESH_Actor *anActor = SMESH::FindActorByEntry( anIO->getEntry()); + if (( !anActor && selected.Extent() == 1 ) && + ( anActor = SMESH::CreateActor( aStudy, anIO->getEntry() ))) + { anActor->SetControlMode( aControl ); + SMESH::DisplayActor( SMESH::GetCurrentVtkView(), anActor ); + SMESH::UpdateView ( SMESH::eDisplay, anIO->getEntry() ); + } + if ( anActor ) + { + if ( anActor->GetControlMode() != aControl ) + anActor->SetControlMode( aControl ); + QString functorName = functorToString( anActor->GetFunctor() ); + int anEntitiesCount = anActor->GetNumberControlEntities(); + if (anEntitiesCount >= 0) + functorName = functorName + ": " + QString::number(anEntitiesCount); anActor->GetScalarBarActor()->SetTitle( functorName.toLatin1().constData() ); SMESH::RepaintCurrentView(); #ifndef DISABLE_PLOT2DVIEWER @@ -1721,25 +1771,25 @@ namespace } - QString CheckHomogeneousSelection() - { - LightApp_SelectionMgr *aSel = SMESHGUI::selectionMgr(); - SALOME_ListIO selected; - if ( aSel ) - aSel->selectedObjects( selected ); + // QString CheckHomogeneousSelection() + // { + // LightApp_SelectionMgr *aSel = SMESHGUI::selectionMgr(); + // SALOME_ListIO selected; + // if ( aSel ) + // aSel->selectedObjects( selected ); - QString RefType = CheckTypeObject(selected.First()); - SALOME_ListIteratorOfListIO It(selected); - for ( ; It.More(); It.Next()) - { - Handle(SALOME_InteractiveObject) IObject = It.Value(); - QString Type = CheckTypeObject(IObject); - if ( Type.compare(RefType) != 0 ) - return "Heterogeneous Selection"; - } + // QString RefType = CheckTypeObject(selected.First()); + // SALOME_ListIteratorOfListIO It(selected); + // for ( ; It.More(); It.Next()) + // { + // Handle(SALOME_InteractiveObject) IObject = It.Value(); + // QString Type = CheckTypeObject(IObject); + // if ( Type.compare(RefType) != 0 ) + // return "Heterogeneous Selection"; + // } - return RefType; - } + // return RefType; + // } uint randomize( uint size ) { @@ -2551,6 +2601,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID ) case SMESHOp::OpOrientationOnFaces: { + SUIT_OverrideCursor wc; LightApp_SelectionMgr* mgr = selectionMgr(); SALOME_ListIO selected; mgr->selectedObjects( selected ); @@ -2675,7 +2726,10 @@ bool SMESHGUI::OnGUIEvent( int theCommandID ) case SMESHOp::OpCreateMesh: case SMESHOp::OpCreateSubMesh: case SMESHOp::OpEditMeshOrSubMesh: + case SMESHOp::OpEditMesh: + case SMESHOp::OpEditSubMesh: case SMESHOp::OpCompute: + case SMESHOp::OpComputeSubMesh: case SMESHOp::OpPreCompute: case SMESHOp::OpEvaluate: case SMESHOp::OpMeshOrder: @@ -3301,12 +3355,12 @@ bool SMESHGUI::OnGUIEvent( int theCommandID ) for ( ; It.More(); It.Next() ) { Handle(SALOME_InteractiveObject) IOS = It.Value(); - SMESH::SMESH_Mesh_var aMesh = - SMESH::IObjectToInterface(IOS); + SMESH::SMESH_Mesh_var aMesh = SMESH::IObjectToInterface(IOS); if ( aMesh->_is_nil()) continue; try { - SMESH::RemoveVisualObjectWithActors(IOS->getEntry(), true); aMesh->Clear(); + if ( aMesh->NbNodes() == 0 ) // imported mesh is not empty + SMESH::RemoveVisualObjectWithActors(IOS->getEntry(), true); _PTR(SObject) aMeshSObj = SMESH::FindSObject(aMesh); SMESH::ModifiedMesh( aMeshSObj, false, true); // hide groups and submeshes @@ -3529,6 +3583,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID ) // CONTROLS case SMESHOp::OpFreeNode: case SMESHOp::OpEqualNode: + case SMESHOp::OpNodeConnectivityNb: case SMESHOp::OpFreeEdge: case SMESHOp::OpFreeBorder: case SMESHOp::OpLength: @@ -3793,9 +3848,12 @@ void SMESHGUI::initialize( CAM_Application* app ) createSMESHAction( SMESHOp::OpCreateMesh, "CREATE_MESH", "ICON_DLG_INIT_MESH" ); createSMESHAction( SMESHOp::OpCreateSubMesh, "CREATE_SUBMESH", "ICON_DLG_ADD_SUBMESH" ); createSMESHAction( SMESHOp::OpEditMeshOrSubMesh, "EDIT_MESHSUBMESH", "ICON_DLG_EDIT_MESH" ); + createSMESHAction( SMESHOp::OpEditMesh, "EDIT_MESH", "ICON_DLG_EDIT_MESH" ); + createSMESHAction( SMESHOp::OpEditSubMesh, "EDIT_SUBMESH", "ICON_DLG_EDIT_MESH" ); createSMESHAction( SMESHOp::OpBuildCompoundMesh, "BUILD_COMPOUND", "ICON_BUILD_COMPOUND" ); createSMESHAction( SMESHOp::OpCopyMesh, "COPY_MESH", "ICON_COPY_MESH" ); createSMESHAction( SMESHOp::OpCompute, "COMPUTE", "ICON_COMPUTE" ); + createSMESHAction( SMESHOp::OpComputeSubMesh, "COMPUTE_SUBMESH", "ICON_COMPUTE" ); createSMESHAction( SMESHOp::OpPreCompute, "PRECOMPUTE", "ICON_PRECOMPUTE" ); createSMESHAction( SMESHOp::OpEvaluate, "EVALUATE", "ICON_EVALUATE" ); createSMESHAction( SMESHOp::OpMeshOrder, "MESH_ORDER", "ICON_MESH_ORDER"); @@ -3818,6 +3876,7 @@ void SMESHGUI::initialize( CAM_Application* app ) //update createSMESHAction( SMESHOp::OpFreeNode, "FREE_NODE", "ICON_FREE_NODE", 0, true ); createSMESHAction( SMESHOp::OpEqualNode, "EQUAL_NODE", "ICON_EQUAL_NODE", 0, true ); + createSMESHAction( SMESHOp::OpNodeConnectivityNb, "NODE_CONNECTIVITY_NB", "ICON_NODE_CONN_NB", 0, true ); createSMESHAction( SMESHOp::OpFreeEdge, "FREE_EDGE", "ICON_FREE_EDGE", 0, true ); createSMESHAction( SMESHOp::OpFreeBorder, "FREE_BORDER", "ICON_FREE_EDGE_2D", 0, true ); createSMESHAction( SMESHOp::OpLength, "LENGTH", "ICON_LENGTH", 0, true ); @@ -3951,7 +4010,8 @@ void SMESHGUI::initialize( CAM_Application* app ) createSMESHAction( SMESHOp::OpSortChild, "SORT_CHILD_ITEMS" ); QList aCtrlActions; - aCtrlActions << SMESHOp::OpFreeNode << SMESHOp::OpEqualNode // node controls + aCtrlActions << SMESHOp::OpFreeNode << SMESHOp::OpEqualNode + << SMESHOp::OpNodeConnectivityNb // node controls << SMESHOp::OpFreeEdge << SMESHOp::OpFreeBorder << SMESHOp::OpLength << SMESHOp::OpConnection << SMESHOp::OpEqualEdge // edge controls << SMESHOp::OpFreeFace << SMESHOp::OpLength2D << SMESHOp::OpConnection2D @@ -4048,6 +4108,7 @@ void SMESHGUI::initialize( CAM_Application* app ) createMenu( SMESHOp::OpFreeNode, nodeId, -1 ); createMenu( SMESHOp::OpEqualNode, nodeId, -1 ); + //createMenu( SMESHOp::OpNodeConnectivityNb, nodeId, -1 ); createMenu( SMESHOp::OpFreeBorder, edgeId, -1 ); createMenu( SMESHOp::OpLength, edgeId, -1 ); createMenu( SMESHOp::OpConnection, edgeId, -1 ); @@ -4148,9 +4209,9 @@ void SMESHGUI::initialize( CAM_Application* app ) createMenu( SMESHOp::OpPropertiesVolume, basicPropId, -1 ); createMenu( SMESHOp::OpUpdate, viewId, -1 ); - connect( nodeMenu, SIGNAL( aboutToShow() ), this, SLOT( onUpdateControlActions() ) ); - connect( edgeMenu, SIGNAL( aboutToShow() ), this, SLOT( onUpdateControlActions() ) ); - connect( faceMenu, SIGNAL( aboutToShow() ), this, SLOT( onUpdateControlActions() ) ); + connect( nodeMenu, SIGNAL( aboutToShow() ), this, SLOT( onUpdateControlActions() ) ); + connect( edgeMenu, SIGNAL( aboutToShow() ), this, SLOT( onUpdateControlActions() ) ); + connect( faceMenu, SIGNAL( aboutToShow() ), this, SLOT( onUpdateControlActions() ) ); connect( volumeMenu, SIGNAL( aboutToShow() ), this, SLOT( onUpdateControlActions() ) ); // ----- create toolbars -------------- @@ -4193,6 +4254,7 @@ void SMESHGUI::initialize( CAM_Application* app ) createTool( SMESHOp::OpFreeNode, ctrl0dTb ); createTool( SMESHOp::OpEqualNode, ctrl0dTb ); + //createTool( SMESHOp::OpNodeConnectivityNb, ctrl0dTb ); createTool( SMESHOp::OpFreeBorder, ctrl1dTb ); createTool( SMESHOp::OpLength, ctrl1dTb ); @@ -4290,24 +4352,26 @@ void SMESHGUI::initialize( CAM_Application* app ) QString dc = "selcount"; // VSR : instead of QtxPopupSelection::defSelCountParam() myRules.clear(); - QString OB = "'ObjectBrowser'", - View = "'" + SVTK_Viewer::Type() + "'", - pat = "'%1'", - mesh = pat.arg( SMESHGUI_Selection::typeName( SMESH::MESH ) ), - group = pat.arg( SMESHGUI_Selection::typeName( SMESH::GROUP ) ), - hypo = pat.arg( SMESHGUI_Selection::typeName( SMESH::HYPOTHESIS ) ), - algo = pat.arg( SMESHGUI_Selection::typeName( SMESH::ALGORITHM ) ), - elems = QString( "'%1' '%2' '%3' '%4' '%5' '%6'" ). - arg( SMESHGUI_Selection::typeName( SMESH::SUBMESH_VERTEX ) ). - arg( SMESHGUI_Selection::typeName( SMESH::SUBMESH_EDGE ) ). - arg( SMESHGUI_Selection::typeName( SMESH::SUBMESH_FACE ) ). - arg( SMESHGUI_Selection::typeName( SMESH::SUBMESH_SOLID ) ). - arg( SMESHGUI_Selection::typeName( SMESH::SUBMESH_COMPOUND ) ). - arg( SMESHGUI_Selection::typeName( SMESH::SUBMESH ) ), - subMesh = elems, - mesh_part = mesh + " " + subMesh + " " + group, - mesh_group = mesh + " " + group, - hyp_alg = hypo + " " + algo; + QString + OB = "'ObjectBrowser'", + View = "'" + SVTK_Viewer::Type() + "'", + pat = "'%1'", + mesh = pat.arg( SMESHGUI_Selection::typeName( SMESH::MESH ) ), + group = pat.arg( SMESHGUI_Selection::typeName( SMESH::GROUP ) ), + hypo = pat.arg( SMESHGUI_Selection::typeName( SMESH::HYPOTHESIS ) ), + algo = pat.arg( SMESHGUI_Selection::typeName( SMESH::ALGORITHM ) ), + elems = QString( "'%1' '%2' '%3' '%4' '%5' '%6'" ). + arg( SMESHGUI_Selection::typeName( SMESH::SUBMESH_VERTEX ) ). + arg( SMESHGUI_Selection::typeName( SMESH::SUBMESH_EDGE ) ). + arg( SMESHGUI_Selection::typeName( SMESH::SUBMESH_FACE ) ). + arg( SMESHGUI_Selection::typeName( SMESH::SUBMESH_SOLID ) ). + arg( SMESHGUI_Selection::typeName( SMESH::SUBMESH_COMPOUND ) ). + arg( SMESHGUI_Selection::typeName( SMESH::SUBMESH ) ), + subMesh = elems, + mesh_part = mesh + " " + subMesh + " " + group, + mesh_group = mesh + " " + group, + mesh_submesh = mesh + " " + subMesh, + hyp_alg = hypo + " " + algo; // popup for object browser QString @@ -4326,36 +4390,36 @@ void SMESHGUI::initialize( CAM_Application* app ) hasVolumes("({'Volume'} in elemTypes)"), hasFacesOrVolumes("(({'Face'} in elemTypes) || ({'Volume'} in elemTypes)) "); - createPopupItem( SMESHOp::OpFileInformation, OB, mesh, "&& selcount=1 && isImported" ); - createPopupItem( SMESHOp::OpCreateSubMesh, OB, mesh, "&& hasGeomReference"); - createPopupItem( SMESHOp::OpEditMeshOrSubMesh, OB, mesh ); - createPopupItem( SMESHOp::OpEditMeshOrSubMesh, OB, subMesh, "&& hasGeomReference" ); - createPopupItem( SMESHOp::OpEditGroup, OB, group ); + createPopupItem( SMESHOp::OpFileInformation, OB, mesh, "&& selcount=1 && isImported" ); + createPopupItem( SMESHOp::OpCreateSubMesh, OB, mesh, "&& hasGeomReference"); + createPopupItem( SMESHOp::OpEditMesh, OB, mesh, "&& selcount=1" ); + createPopupItem( SMESHOp::OpEditSubMesh, OB, subMesh, "&& selcount=1 && hasGeomReference" ); + createPopupItem( SMESHOp::OpEditGroup, OB, group ); createPopupItem( SMESHOp::OpEditGeomGroupAsGroup, OB, group, "&& groupType != 'Group'" ); popupMgr()->insert( separator(), -1, 0 ); - createPopupItem( SMESHOp::OpCompute, OB, mesh, "&& isComputable" ); - createPopupItem( SMESHOp::OpPreCompute, OB, mesh, "&& isPreComputable" ); - createPopupItem( SMESHOp::OpEvaluate, OB, mesh, "&& isComputable" ); - createPopupItem( SMESHOp::OpMeshOrder, OB, mesh, "&& isComputable && hasGeomReference" ); - createPopupItem( SMESHOp::OpUpdate, OB, mesh_part ); - createPopupItem( SMESHOp::OpMeshInformation, OB, mesh_part ); - createPopupItem( SMESHOp::OpFindElementByPoint, OB, mesh_group ); - createPopupItem( SMESHOp::OpOverallMeshQuality, OB, mesh_part ); + createPopupItem( SMESHOp::OpCompute, OB, mesh, "&& selcount=1 && isComputable" ); + createPopupItem( SMESHOp::OpComputeSubMesh, OB, subMesh, "&& selcount=1 && isComputable" ); + createPopupItem( SMESHOp::OpPreCompute, OB, mesh, "&& selcount=1 && isPreComputable" ); + createPopupItem( SMESHOp::OpEvaluate, OB, mesh, "&& selcount=1 && isComputable" ); + createPopupItem( SMESHOp::OpMeshOrder, OB, mesh, "&& selcount=1 && isComputable && hasGeomReference" ); + createPopupItem( SMESHOp::OpUpdate, OB, mesh_part ); + createPopupItem( SMESHOp::OpMeshInformation, OB, mesh_part ); + createPopupItem( SMESHOp::OpFindElementByPoint,OB, mesh_group, "&& selcount=1" ); + createPopupItem( SMESHOp::OpOverallMeshQuality,OB, mesh_part ); popupMgr()->insert( separator(), -1, 0 ); - createPopupItem( SMESHOp::OpCreateGroup, OB, mesh ); - createPopupItem( SMESHOp::OpCreateGeometryGroup, OB, mesh, "&& hasGeomReference" ); - createPopupItem( SMESHOp::OpConstructGroup, OB, subMesh ); + createPopupItem( SMESHOp::OpCreateGroup, OB, mesh, "&& selcount=1" ); + createPopupItem( SMESHOp::OpCreateGeometryGroup, OB, mesh, "&& selcount=1 && hasGeomReference" ); + createPopupItem( SMESHOp::OpConstructGroup, OB, subMesh ); popupMgr()->insert( separator(), -1, 0 ); - createPopupItem( SMESHOp::OpEditHypothesis, OB, hypo, "&& isEditableHyp"); - createPopupItem( SMESHOp::OpUnassign, OB, hyp_alg ); // REMOVE HYPOTHESIS / ALGORITHMS + createPopupItem( SMESHOp::OpEditHypothesis, OB, hypo, "&& isEditableHyp"); + createPopupItem( SMESHOp::OpUnassign, OB, hyp_alg ); popupMgr()->insert( separator(), -1, 0 ); - createPopupItem( SMESHOp::OpConvertMeshToQuadratic, OB, mesh + " " + subMesh ); // convert to quadratic - createPopupItem( SMESHOp::OpCreateBoundaryElements, OB, mesh + " " + group, // create 2D mesh from 3D - "&& dim>=2"); + createPopupItem( SMESHOp::OpConvertMeshToQuadratic, OB, mesh_submesh ); + createPopupItem( SMESHOp::OpCreateBoundaryElements, OB, mesh_group, "&& selcount=1 && dim>=2"); popupMgr()->insert( separator(), -1, 0 ); createPopupItem( SMESHOp::OpClearMesh, OB, mesh ); - popupMgr()->insert( separator(), -1, 0 ); + //popupMgr()->insert( separator(), -1, 0 ); QString only_one_non_empty = QString( " && %1=1 && numberOfNodes>0" ).arg( dc ); QString multiple_non_empty = QString( " && %1>0 && numberOfNodes>0" ).arg( dc ); @@ -4533,6 +4597,10 @@ void SMESHGUI::initialize( CAM_Application* app ) popupMgr()->setRule( action( SMESHOp::OpEqualNode ), aMeshInVtkHasNodes, QtxPopupMgr::VisibleRule ); popupMgr()->setRule( action( SMESHOp::OpEqualNode ), "controlMode = 'eCoincidentNodes'", QtxPopupMgr::ToggleRule); + // popupMgr()->insert( action( SMESHOp::OpNodeConnectivityNb ), aSubId, -1 ); + // popupMgr()->setRule( action( SMESHOp::OpNodeConnectivityNb ), aMeshInVtkHasNodes, QtxPopupMgr::VisibleRule ); + // popupMgr()->setRule( action( SMESHOp::OpNodeConnectivityNb ), "controlMode = 'eNodeConnectivityNb'", QtxPopupMgr::ToggleRule ); + aSubId = popupMgr()->insert( tr( "MEN_EDGE_CTRL" ), anId, -1 ); // EDGE CONTROLS popupMgr()->insert( action( SMESHOp::OpFreeBorder ), aSubId, -1 ); @@ -4984,6 +5052,7 @@ void SMESHGUI::createPreferences() int exportgroup = addPreference( tr( "PREF_GROUP_EXPORT" ), genTab ); setPreferenceProperty( exportgroup, "columns", 2 ); addPreference( tr( "PREF_AUTO_GROUPS" ), exportgroup, LightApp_Preferences::Bool, "SMESH", "auto_groups" ); + addPreference( tr( "PREF_SHOW_WARN" ), exportgroup, LightApp_Preferences::Bool, "SMESH", "show_warning" ); //addPreference( tr( "PREF_RENUMBER" ), exportgroup, LightApp_Preferences::Bool, "SMESH", "renumbering" ); int computeGroup = addPreference( tr( "PREF_GROUP_COMPUTE" ), genTab ); @@ -5476,9 +5545,12 @@ LightApp_Operation* SMESHGUI::createOperation( const int id ) const op = new SMESHGUI_MeshOp( true, false ); break; case SMESHOp::OpEditMeshOrSubMesh: + case SMESHOp::OpEditMesh: + case SMESHOp::OpEditSubMesh: op = new SMESHGUI_MeshOp( false ); break; case SMESHOp::OpCompute: + case SMESHOp::OpComputeSubMesh: op = new SMESHGUI_ComputeOp(); break; case SMESHOp::OpPreCompute: @@ -6206,8 +6278,7 @@ void SMESHGUI::restoreVisualParameters (int savePoint) if (ac->IsA("SMESH_Actor")) { SMESH_Actor* aGeomAc = SMESH_Actor::SafeDownCast(ac); if (aGeomAc->hasIO()) { - Handle(SALOME_InteractiveObject) io = - Handle(SALOME_InteractiveObject)::DownCast(aGeomAc->getIO()); + Handle(SALOME_InteractiveObject) io = aGeomAc->getIO(); if (io->hasEntry() && strcmp(io->getEntry(), entry.toLatin1().data()) == 0) { isFound = true; vtkActors.Bind(viewIndex, aGeomAc); @@ -6832,23 +6903,24 @@ void SMESHGUI::onHypothesisEdit( int result ) */ void SMESHGUI::onUpdateControlActions() { - LightApp_SelectionMgr* aSel = SMESHGUI::selectionMgr(); SALOME_ListIO selected; - if ( aSel ) + if ( LightApp_SelectionMgr* aSel = SMESHGUI::selectionMgr() ) aSel->selectedObjects( selected ); SMESH_Actor::eControl aControl = SMESH_Actor::eNone; if ( selected.Extent() ) { if ( selected.First()->hasEntry() ) { - aControl = SMESH::FindActorByEntry( selected.First()->getEntry() )->GetControlMode(); - SALOME_ListIteratorOfListIO it(selected); - for ( ; it.More(); it.Next() ) { - Handle(SALOME_InteractiveObject) anIO = it.Value(); - if ( anIO->hasEntry() ) { - if ( SMESH_Actor* anActor = SMESH::FindActorByEntry( anIO->getEntry() ) ) { - if ( aControl != anActor->GetControlMode() ) { - aControl = SMESH_Actor::eNone; - break; + if ( SMESH_Actor* anActor = SMESH::FindActorByEntry( selected.First()->getEntry() )) { + aControl = anActor->GetControlMode(); + SALOME_ListIteratorOfListIO it(selected); + for ( it.Next(); it.More(); it.Next() ) { + Handle(SALOME_InteractiveObject) anIO = it.Value(); + if ( anIO->hasEntry() ) { + if ( SMESH_Actor* anActor = SMESH::FindActorByEntry( anIO->getEntry() ) ) { + if ( aControl != anActor->GetControlMode() ) { + aControl = SMESH_Actor::eNone; + break; + } } } }