0021014: EDF 1583 SMESH: Improvement of the Python Dump for the creation of groups

fix selection/visualization mode at changing the group type
This commit is contained in:
eap 2011-07-11 07:22:14 +00:00
parent e6c056f8c0
commit 34fc026192

View File

@ -728,12 +728,12 @@ void SMESHGUI_GroupDlg::onTypeChanged (int id)
if (myTypeId != id) { if (myTypeId != id) {
myElements->clear(); myElements->clear();
myTypeId = id; myTypeId = id;
if ( myGrpTypeId == 0 && myCurrentLineEdit == 0)
setSelectionMode(id);
else
setSelectionMode( mySelectionMode++ ); // update according to mySelectionMode
int curSelMode = mySelectionMode;
mySelectionMode = grpNoSelection;
setSelectionMode( curSelMode );
onObjectSelectionChanged(); onObjectSelectionChanged();
setShowEntityMode(); setShowEntityMode();
} }
} }
@ -745,13 +745,13 @@ void SMESHGUI_GroupDlg::onTypeChanged (int id)
void SMESHGUI_GroupDlg::onGrpTypeChanged (int id) void SMESHGUI_GroupDlg::onGrpTypeChanged (int id)
{ {
if (myGrpTypeId != id) { if (myGrpTypeId != id) {
myGrpTypeId = id;
myWGStack->setCurrentIndex( id ); myWGStack->setCurrentIndex( id );
myName->blockSignals(true); myName->blockSignals(true);
myName->setText(myOldName); myName->setText(myOldName);
myName->blockSignals(false); myName->blockSignals(false);
onSelectGeomGroup(id == 1); onSelectGeomGroup(id != 0);
} }
myGrpTypeId = id;
updateButtons(); updateButtons();
} }
@ -774,27 +774,26 @@ void SMESHGUI_GroupDlg::setSelectionMode (int theMode)
if (myMesh->_is_nil()) if (myMesh->_is_nil())
return; return;
SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ); SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI );
bool isSelectAll = mySelectAll->isChecked() || !myAllowElemsModif->isChecked(); bool isSelectAll = mySelectAll->isChecked() || !myAllowElemsModif->isChecked() || myGrpTypeId != 0;
if (mySelectionMode != theMode) { if (mySelectionMode != theMode) {
// [PAL10408] mySelectionMgr->clearSelected(); // [PAL10408] mySelectionMgr->clearSelected();
mySelectionMgr->clearFilters(); mySelectionMgr->clearFilters();
if (myActorsList.count() > 0) {
QListIterator<SMESH_Actor*> it( myActorsList ); if (myActorsList.count() > 0)
while ( it.hasNext() ) for (QListIterator<SMESH_Actor*> it( myActorsList ); it.hasNext(); )
it.next()->SetPointRepresentation(false); it.next()->SetPointRepresentation(false);
} else
else {
SMESH::SetPointRepresentation(false); SMESH::SetPointRepresentation(false);
}
switch (theMode) { switch (theMode) {
case grpNodeSelection: case grpNodeSelection:
if (myActorsList.count() > 0) { if ( myGrpTypeId == 0 ) // standalone
QListIterator<SMESH_Actor*> it( myActorsList ); {
while ( it.hasNext() ) if (myActorsList.count() > 0)
it.next()->SetPointRepresentation(true); for (QListIterator<SMESH_Actor*> it( myActorsList ); it.hasNext(); )
} it.next()->SetPointRepresentation(true);
else { else
SMESH::SetPointRepresentation(true); SMESH::SetPointRepresentation(true);
} }
if ( aViewWindow ) aViewWindow->SetSelectionMode(isSelectAll ? ActorSelection : NodeSelection); if ( aViewWindow ) aViewWindow->SetSelectionMode(isSelectAll ? ActorSelection : NodeSelection);
break; break;
@ -1583,7 +1582,7 @@ void SMESHGUI_GroupDlg::onSelectGroup(bool on)
//================================================================================= //=================================================================================
// function : (onSelectGeomGroup) // 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) void SMESHGUI_GroupDlg::onSelectGeomGroup(bool on)
{ {
@ -1594,8 +1593,13 @@ void SMESHGUI_GroupDlg::onSelectGeomGroup(bool on)
else if (mySelectGroup->isChecked()) { else if (mySelectGroup->isChecked()) {
mySelectGroup->setChecked(false); mySelectGroup->setChecked(false);
} }
myCurrentLineEdit = myGeomGroupLine; if ( myGrpTypeId == 1 ) { // on group
updateGeomPopup(); myCurrentLineEdit = myGeomGroupLine;
updateGeomPopup();
}
else { // on filter
myCurrentLineEdit = 0;
}
setSelectionMode(grpAllSelection); setSelectionMode(grpAllSelection);
} }
else { else {
@ -1604,7 +1608,7 @@ void SMESHGUI_GroupDlg::onSelectGeomGroup(bool on)
myGeomGroupLine->setText( "" ); myGeomGroupLine->setText( "" );
myCurrentLineEdit = 0; myCurrentLineEdit = 0;
if (myTypeId != -1) if (myTypeId != -1)
setSelectionMode(myTypeId); setSelectionMode( myTypeId );
} }
} }