From 3ac780626efe40becaaa53525de268bde4aea686 Mon Sep 17 00:00:00 2001 From: dmv Date: Mon, 16 Nov 2009 15:03:12 +0000 Subject: [PATCH] SIGSEGV after changing the Mesh in "Greate Group", then select elements. (Filter Volume, Geometry type is used) --- src/SMESHGUI/SMESHGUI_FilterDlg.cxx | 8 +++++++- src/SMESHGUI/SMESHGUI_GroupDlg.cxx | 10 ++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/SMESHGUI/SMESHGUI_FilterDlg.cxx b/src/SMESHGUI/SMESHGUI_FilterDlg.cxx index b567f89a5..4cc5d3fdc 100755 --- a/src/SMESHGUI/SMESHGUI_FilterDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_FilterDlg.cxx @@ -2632,7 +2632,13 @@ void SMESHGUI_FilterDlg::SetSourceWg (QWidget* theWg, //======================================================================= void SMESHGUI_FilterDlg::SetMesh (SMESH::SMESH_Mesh_var theMesh) { - myMesh = theMesh; + if ( !theMesh->_is_nil() ) { + myMesh = theMesh; + if ( !myFilter[ myTable->GetType() ]->_is_nil() && !myFilter[ myTable->GetType() ]->GetPredicate()->_is_nil() ) { + SMESH::Predicate_ptr aPred = myFilter[ myTable->GetType() ]->GetPredicate(); + aPred->SetMesh(myMesh); + } + } const bool isEnable = !(myMesh->_is_nil()); myButtons[BTN_OK]->setEnabled(isEnable); myButtons[BTN_Apply]->setEnabled(isEnable); diff --git a/src/SMESHGUI/SMESHGUI_GroupDlg.cxx b/src/SMESHGUI/SMESHGUI_GroupDlg.cxx index 114a7fd97..32f66474c 100644 --- a/src/SMESHGUI/SMESHGUI_GroupDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_GroupDlg.cxx @@ -1062,6 +1062,10 @@ void SMESHGUI_GroupDlg::onObjectSelectionChanged() myIsBusy = false; return; } + + if ( myFilterDlg && !myMesh->_is_nil()){ + myFilterDlg->SetMesh( myMesh ); + } myGroup = SMESH::SMESH_Group::_nil(); // NPAL19389: create a group with a selection in another group @@ -1087,7 +1091,6 @@ void SMESHGUI_GroupDlg::onObjectSelectionChanged() return; } myIsBusy = false; - myCurrentLineEdit = 0; myGroup = SMESH::SMESH_Group::_nil(); myGroupOnGeom = SMESH::SMESH_GroupOnGeom::_nil(); @@ -1417,11 +1420,14 @@ void SMESHGUI_GroupDlg::setCurrentSelection() QPushButton* send = (QPushButton*)sender(); myCurrentLineEdit = 0; if (send == myMeshGroupBtn) { - myCurrentLineEdit = myMeshGroupLine; + disconnect(myMeshGroupBtn, SIGNAL(clicked()), this, SLOT(setCurrentSelection())); + mySelectionMgr->clearSelected(); if (myCreate) setSelectionMode(6); else setSelectionMode(5); + connect(myMeshGroupBtn, SIGNAL(clicked()), this, SLOT(setCurrentSelection())); + myCurrentLineEdit = myMeshGroupLine; onObjectSelectionChanged(); } else if (send == mySubMeshBtn) { -- 2.39.2