X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSMESHGUI%2FSMESHGUI_MergeNodesDlg.cxx;h=af1a68a57ee8bde8f578b599d4a40421d1394633;hb=2ad752b10cb247a162b27593121a7ae13173258d;hp=2a36a93afc960ff2c31a9a8c3ca136788843776c;hpb=c38c10811a065cf5b13e8807ed71864d92ca7d80;p=modules%2Fsmesh.git diff --git a/src/SMESHGUI/SMESHGUI_MergeNodesDlg.cxx b/src/SMESHGUI/SMESHGUI_MergeNodesDlg.cxx index 2a36a93af..af1a68a57 100644 --- a/src/SMESHGUI/SMESHGUI_MergeNodesDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_MergeNodesDlg.cxx @@ -79,12 +79,10 @@ SMESHGUI_MergeNodesDlg::SMESHGUI_MergeNodesDlg( SMESHGUI* theModule, const char* : QDialog( SMESH::GetDesktop( theModule ), name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | Qt::WDestructiveClose), mySMESHGUI( theModule ), - mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ), - myViewWindow( SMESH::GetViewWindow( theModule ) ), - mySelector( myViewWindow->GetSelector() ) + mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ) { - QPixmap image0 (SMESHGUI::resourceMgr()->loadPixmap("SMESH", tr("ICON_SMESH_MERGE_NODES"))); - QPixmap image1 (SMESHGUI::resourceMgr()->loadPixmap("SMESH", tr("ICON_SELECT"))); + QPixmap image0 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SMESH_MERGE_NODES"))); + QPixmap image1 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SELECT"))); if (!name) setName("SMESHGUI_MergeNodesDlg"); @@ -245,9 +243,12 @@ SMESHGUI_MergeNodesDlg::SMESHGUI_MergeNodesDlg( SMESHGUI* theModule, const char* RadioButton1->setChecked(TRUE); + myEditCurrentArgument = (QWidget*)LineEditMesh; + myActor = 0; - mySMESHGUI = SMESHGUI::GetSMESHGUI(); + mySelector = (SMESH::GetViewWindow( mySMESHGUI ))->GetSelector(); + mySMESHGUI->SetActiveDialogBox((QDialog*)this); myMeshOrSubMeshFilter = new SMESH_TypeFilter (MESHorSUBMESH); @@ -281,6 +282,9 @@ SMESHGUI_MergeNodesDlg::SMESHGUI_MergeNodesDlg( SMESHGUI* theModule, const char* resize(0,0); buttonOk->setEnabled(false); buttonApply->setEnabled(false); + + // Init Mesh field from selection + SelectionIntoArgument(); } //================================================================================= @@ -331,7 +335,7 @@ bool SMESHGUI_MergeNodesDlg::ClickOnApply() } catch(...) { } - mySelectionMgr->clearSelected(); + //mySelectionMgr->clearSelected(); SMESH::UpdateView(); onDetect(); @@ -355,9 +359,10 @@ void SMESHGUI_MergeNodesDlg::ClickOnOk() void SMESHGUI_MergeNodesDlg::ClickOnCancel() { mySelectionMgr->clearFilters(); - mySelectionMgr->clearSelected(); + //mySelectionMgr->clearSelected(); SMESH::SetPointRepresentation(false); - myViewWindow->SetSelectionMode(ActorSelection); + if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) + aViewWindow->SetSelectionMode(ActorSelection); disconnect(mySelectionMgr, 0, this, 0); mySMESHGUI->ResetState(); reject(); @@ -389,7 +394,8 @@ void SMESHGUI_MergeNodesDlg::updateControls() { if (ListCoincident->childCount() < 1) { SMESH::SetPointRepresentation(false); - myViewWindow->SetSelectionMode(ActorSelection); + if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) + aViewWindow->SetSelectionMode(ActorSelection); return; } @@ -477,7 +483,8 @@ void SMESHGUI_MergeNodesDlg::onSelectNodesGroup() mySelectionMgr->setSelectedObjects(aList, false); SMESH::SetPointRepresentation(true); - myViewWindow->SetSelectionMode(NodeSelection); + if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) + aViewWindow->SetSelectionMode(NodeSelection); ListEdit->selectAll(true); } @@ -591,7 +598,8 @@ void SMESHGUI_MergeNodesDlg::SetEditCurrentArgument() if (send == SelectMeshButton) { myEditCurrentArgument = (QWidget*)LineEditMesh; SMESH::SetPointRepresentation(false); - myViewWindow->SetSelectionMode(ActorSelection); + if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) + aViewWindow->SetSelectionMode(ActorSelection); mySelectionMgr->installFilter(myMeshOrSubMeshFilter); }