From: eap Date: Mon, 11 Jul 2011 07:22:14 +0000 (+0000) Subject: 0021014: EDF 1583 SMESH: Improvement of the Python Dump for the creation of groups X-Git-Tag: V6_4_0a1~159 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=34fc0261926b32e613dd2f85c58b3efb0d86d710;p=modules%2Fsmesh.git 0021014: EDF 1583 SMESH: Improvement of the Python Dump for the creation of groups fix selection/visualization mode at changing the group type --- diff --git a/src/SMESHGUI/SMESHGUI_GroupDlg.cxx b/src/SMESHGUI/SMESHGUI_GroupDlg.cxx index 45cc20e6b..d4d7647eb 100644 --- a/src/SMESHGUI/SMESHGUI_GroupDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_GroupDlg.cxx @@ -728,12 +728,12 @@ void SMESHGUI_GroupDlg::onTypeChanged (int id) if (myTypeId != id) { myElements->clear(); myTypeId = id; + if ( myGrpTypeId == 0 && myCurrentLineEdit == 0) + setSelectionMode(id); + else + setSelectionMode( mySelectionMode++ ); // update according to mySelectionMode - int curSelMode = mySelectionMode; - mySelectionMode = grpNoSelection; - setSelectionMode( curSelMode ); onObjectSelectionChanged(); - setShowEntityMode(); } } @@ -745,13 +745,13 @@ void SMESHGUI_GroupDlg::onTypeChanged (int id) void SMESHGUI_GroupDlg::onGrpTypeChanged (int id) { if (myGrpTypeId != id) { + myGrpTypeId = id; myWGStack->setCurrentIndex( id ); myName->blockSignals(true); myName->setText(myOldName); myName->blockSignals(false); - onSelectGeomGroup(id == 1); + onSelectGeomGroup(id != 0); } - myGrpTypeId = id; updateButtons(); } @@ -774,27 +774,26 @@ void SMESHGUI_GroupDlg::setSelectionMode (int theMode) if (myMesh->_is_nil()) return; SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ); - bool isSelectAll = mySelectAll->isChecked() || !myAllowElemsModif->isChecked(); + bool isSelectAll = mySelectAll->isChecked() || !myAllowElemsModif->isChecked() || myGrpTypeId != 0; if (mySelectionMode != theMode) { // [PAL10408] mySelectionMgr->clearSelected(); mySelectionMgr->clearFilters(); - if (myActorsList.count() > 0) { - QListIterator it( myActorsList ); - while ( it.hasNext() ) + + if (myActorsList.count() > 0) + for (QListIterator it( myActorsList ); it.hasNext(); ) it.next()->SetPointRepresentation(false); - } - else { + else SMESH::SetPointRepresentation(false); - } + switch (theMode) { case grpNodeSelection: - if (myActorsList.count() > 0) { - QListIterator it( myActorsList ); - while ( it.hasNext() ) - it.next()->SetPointRepresentation(true); - } - else { - SMESH::SetPointRepresentation(true); + if ( myGrpTypeId == 0 ) // standalone + { + if (myActorsList.count() > 0) + for (QListIterator it( myActorsList ); it.hasNext(); ) + it.next()->SetPointRepresentation(true); + else + SMESH::SetPointRepresentation(true); } if ( aViewWindow ) aViewWindow->SetSelectionMode(isSelectAll ? ActorSelection : NodeSelection); break; @@ -1583,7 +1582,7 @@ void SMESHGUI_GroupDlg::onSelectGroup(bool on) //================================================================================= // function : (onSelectGeomGroup) -// purpose : Called when selection in 3D view or ObjectBrowser is changed +// purpose : Called when group type changed. on == "on group" or "on filter" //================================================================================= void SMESHGUI_GroupDlg::onSelectGeomGroup(bool on) { @@ -1594,8 +1593,13 @@ void SMESHGUI_GroupDlg::onSelectGeomGroup(bool on) else if (mySelectGroup->isChecked()) { mySelectGroup->setChecked(false); } - myCurrentLineEdit = myGeomGroupLine; - updateGeomPopup(); + if ( myGrpTypeId == 1 ) { // on group + myCurrentLineEdit = myGeomGroupLine; + updateGeomPopup(); + } + else { // on filter + myCurrentLineEdit = 0; + } setSelectionMode(grpAllSelection); } else { @@ -1604,7 +1608,7 @@ void SMESHGUI_GroupDlg::onSelectGeomGroup(bool on) myGeomGroupLine->setText( "" ); myCurrentLineEdit = 0; if (myTypeId != -1) - setSelectionMode(myTypeId); + setSelectionMode( myTypeId ); } }