#16755 [CEA 16749] Merge nodes generates fatal error if selection is disabled

This commit is contained in:
eap 2019-03-28 18:22:44 +03:00
parent d2203f18e1
commit 5e337ede0d
2 changed files with 17 additions and 3 deletions

View File

@ -1144,6 +1144,9 @@ void SMESHGUI_MergeDlg::SetEditCurrentArgument()
//================================================================================= //=================================================================================
void SMESHGUI_MergeDlg::SelectionIntoArgument() void SMESHGUI_MergeDlg::SelectionIntoArgument()
{ {
if ( myIsBusy )
return;
if (myEditCurrentArgument == (QWidget*)LineEditMesh) if (myEditCurrentArgument == (QWidget*)LineEditMesh)
{ {
QString aString = ""; QString aString = "";
@ -1222,6 +1225,9 @@ void SMESHGUI_MergeDlg::SelectionIntoArgument()
LineEditMesh->setText( aString ); LineEditMesh->setText( aString );
myIsBusy = true; // here selection can change
if (myAction == MERGE_NODES) { if (myAction == MERGE_NODES) {
SMESH::SetPointRepresentation(true); SMESH::SetPointRepresentation(true);
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
@ -1231,6 +1237,8 @@ void SMESHGUI_MergeDlg::SelectionIntoArgument()
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(CellSelection); aViewWindow->SetSelectionMode(CellSelection);
myIsBusy = false;
// process groups // process groups
myGroups.clear(); myGroups.clear();
ListExclude->clear(); ListExclude->clear();
@ -1408,9 +1416,11 @@ void SMESHGUI_MergeDlg::onTypeChanged (int id)
myIdPreview->SetPointsLabeled(false); myIdPreview->SetPointsLabeled(false);
SMESH::SetPointRepresentation(false); SMESH::SetPointRepresentation(false);
myIsBusy = true; // keep currently selected mesh
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(ActorSelection); aViewWindow->SetSelectionMode(ActorSelection);
mySelectionMgr->clearFilters(); mySelectionMgr->clearFilters();
myIsBusy = false;
GroupCoincident->hide(); GroupCoincident->hide();
GroupEdit->hide(); GroupEdit->hide();
@ -1424,6 +1434,7 @@ void SMESHGUI_MergeDlg::onTypeChanged (int id)
myMeshOrSubMeshOrGroupFilter = new SMESH_TypeFilter (SMESH::IDSOURCE); myMeshOrSubMeshOrGroupFilter = new SMESH_TypeFilter (SMESH::IDSOURCE);
myIsBusy = true; // keep currently selected mesh
if (myAction == MERGE_NODES) { if (myAction == MERGE_NODES) {
SMESH::SetPointRepresentation(true); SMESH::SetPointRepresentation(true);
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
@ -1435,10 +1446,13 @@ void SMESHGUI_MergeDlg::onTypeChanged (int id)
if( mySelector->IsSelectionEnabled() ) if( mySelector->IsSelectionEnabled() )
aViewWindow->SetSelectionMode(CellSelection); aViewWindow->SetSelectionMode(CellSelection);
} }
myIsBusy = false;
GroupCoincident->show(); GroupCoincident->show();
GroupEdit->show(); GroupEdit->show();
break; break;
} }
if ( myMesh->_is_nil() )
SelectionIntoArgument(); SelectionIntoArgument();
updateControls(); updateControls();

View File

@ -1009,9 +1009,9 @@ TCollection_AsciiString SMESH_Gen_i::DumpPython_impl
lines.push_back( aSMESHGen + " = smeshBuilder.New()" ); lines.push_back( aSMESHGen + " = smeshBuilder.New()" );
if ( isPublished ) if ( isPublished )
optionalComment = helper + "#"; optionalComment = "#";
lines.push_back( optionalComment + aSMESHGen + ".SetEnablePublish( False ) # Set to False to avoid publish in study if not needed or in some particular situations:" ); lines.push_back( optionalComment + aSMESHGen + ".SetEnablePublish( False ) # Set to False to avoid publish in study if not needed or in some particular situations:" );
lines.push_back( " # multiples meshes built in parallel, complex and numerous mesh edition (performance)" ); lines.push_back( " # multiples meshes built in parallel, complex and numerous mesh edition (performance)\n" );
lines.push_back( helper + "aFilterManager = " + aSMESHGen + ".CreateFilterManager()" ); lines.push_back( helper + "aFilterManager = " + aSMESHGen + ".CreateFilterManager()" );
lines.push_back( helper + "aMeasurements = " + aSMESHGen + ".CreateMeasurements()" ); lines.push_back( helper + "aMeasurements = " + aSMESHGen + ".CreateMeasurements()" );