X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSMESHGUI%2FSMESHGUI_RemoveElementsDlg.cxx;h=16529726e7d9342c6f2780ce67137bcb1d26b06e;hb=4f27e7392a109bdc465b943b8d92d969e93f129c;hp=011402ab7c0680656a689acdbe920f72d73f6f29;hpb=c38c10811a065cf5b13e8807ed71864d92ca7d80;p=modules%2Fsmesh.git diff --git a/src/SMESHGUI/SMESHGUI_RemoveElementsDlg.cxx b/src/SMESHGUI/SMESHGUI_RemoveElementsDlg.cxx index 011402ab7..16529726e 100644 --- a/src/SMESHGUI/SMESHGUI_RemoveElementsDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_RemoveElementsDlg.cxx @@ -82,12 +82,11 @@ SMESHGUI_RemoveElementsDlg WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | Qt::WDestructiveClose), mySelector(SMESH::GetViewWindow(theModule)->GetSelector()), mySelectionMgr(SMESH::GetSelectionMgr(theModule)), - myViewWindow(SMESH::GetViewWindow(theModule)), mySMESHGUI(theModule), myBusy(false) { - QPixmap image0 (SMESHGUI::resourceMgr()->loadPixmap("SMESH", tr("ICON_DLG_REM_ELEMENT"))); - QPixmap image1 (SMESHGUI::resourceMgr()->loadPixmap("SMESH", tr("ICON_SELECT"))); + QPixmap image0 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_DLG_REM_ELEMENT"))); + QPixmap image1 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SELECT"))); if (!name) setName("SMESHGUI_RemoveElementsDlg"); @@ -225,7 +224,8 @@ void SMESHGUI_RemoveElementsDlg::Init() this->move(x, y); this->show(); /* displays Dialog */ - myViewWindow->SetSelectionMode(CellSelection); + if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) + aViewWindow->SetSelectionMode(CellSelection); SelectionIntoArgument(); } @@ -261,9 +261,7 @@ void SMESHGUI_RemoveElementsDlg::ClickOnApply() } if (aResult) { - SALOME_ListIO aList; - aList.Append(myActor->getIO()); - mySelectionMgr->setSelectedObjects(aList, false); + myEditCurrentArgument->clear(); SMESH::UpdateView(); } } @@ -288,7 +286,8 @@ void SMESHGUI_RemoveElementsDlg::ClickOnOk() void SMESHGUI_RemoveElementsDlg::ClickOnCancel() { mySelectionMgr->clearSelected(); - myViewWindow->SetSelectionMode(ActorSelection); + if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) + aViewWindow->SetSelectionMode(ActorSelection); disconnect(mySelectionMgr, 0, this, 0); mySMESHGUI->ResetState(); reject(); @@ -314,36 +313,28 @@ void SMESHGUI_RemoveElementsDlg::onTextChange (const QString& theNewText) if(myActor){ if(SMDS_Mesh* aMesh = myActor->GetObject()->GetMesh()){ Handle(SALOME_InteractiveObject) anIO = myActor->getIO(); - SALOME_ListIO aList; - aList.Append(anIO); - mySelectionMgr->setSelectedObjects(aList, false); - TColStd_IndexedMapOfInteger selectedIndices; TColStd_MapOfInteger newIndices; - mySelector->GetIndex(anIO,selectedIndices); QStringList aListId = QStringList::split(" ", theNewText, false); for (int i = 0; i < aListId.count(); i++) { if(const SMDS_MeshElement *anElem = aMesh->FindElement(aListId[i].toInt())) { - if (selectedIndices.Add(anElem->GetID())) { - newIndices.Add(anElem->GetID()); - } + newIndices.Add(anElem->GetID()); myNbOkElements++; } } - - if (newIndices.Extent() > 0){ - mySelector->AddOrRemoveIndex(anIO,newIndices,true); - myViewWindow->highlight(anIO,true,true); - } + + mySelector->AddOrRemoveIndex(anIO,newIndices,false); + if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) + aViewWindow->highlight(anIO,true,true); } } - + if (myNbOkElements) { buttonOk->setEnabled(true); buttonApply->setEnabled(true); } - + myBusy = false; } @@ -457,7 +448,8 @@ void SMESHGUI_RemoveElementsDlg::ActivateThisDialog() mySMESHGUI->SetActiveDialogBox((QDialog*)this); // ?? - myViewWindow->SetSelectionMode(NodeSelection); + if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) + aViewWindow->SetSelectionMode(NodeSelection); SelectionIntoArgument(); // ?? }