Salome HOME
The selections of elements corrected.
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_RevolutionDlg.cxx
index 731f9460d90045f80764fe69b3e411bc04349471..b2e4615b12e50744f045677b8b420403e8074245 100644 (file)
@@ -87,9 +87,10 @@ SMESHGUI_RevolutionDlg::SMESHGUI_RevolutionDlg( SMESHGUI* theModule, const char*
      myViewWindow( SMESH::GetViewWindow( theModule ) ),
      mySelector( myViewWindow->GetSelector() )
 {
-  QPixmap image0 (SMESHGUI::resourceMgr()->loadPixmap("SMESH", tr("ICON_DLG_EDGE")));
-  QPixmap image1 (SMESHGUI::resourceMgr()->loadPixmap("SMESH", tr("ICON_DLG_TRIANGLE")));
-  QPixmap image2 (SMESHGUI::resourceMgr()->loadPixmap("SMESH", tr("ICON_SELECT")));
+  SUIT_ResourceMgr* mgr = SMESH::GetResourceMgr( mySMESHGUI );
+  QPixmap image0 ( mgr->loadPixmap("SMESH", tr("ICON_DLG_EDGE")));
+  QPixmap image1 ( mgr->loadPixmap("SMESH", tr("ICON_DLG_TRIANGLE")));
+  QPixmap image2 ( mgr->loadPixmap("SMESH", tr("ICON_SELECT")));
 
   if (!name)
     setName("SMESHGUI_RevolutionDlg");
@@ -521,35 +522,22 @@ void SMESHGUI_RevolutionDlg::onTextChange (const QString& theNewText)
 
   if (aMesh) {
     if (send == LineEditElements) {
-      //mySelectionMgr->clearSelected();
-      //mySelectionMgr->AddIObject(myActor->getIO());
-      SALOME_ListIO aList;
-      aList.Append(myActor->getIO());
-      mySelectionMgr->setSelectedObjects(aList, false);
+      Handle(SALOME_InteractiveObject) anIO = myActor->getIO();
 
-      TColStd_IndexedMapOfInteger selectedIndices;
       TColStd_MapOfInteger newIndices;
-      mySelector->GetIndex(myActor->getIO(), selectedIndices);
 
       QStringList aListId = QStringList::split(" ", theNewText, false);
+      
       for (int i = 0; i < aListId.count(); i++) {
        const SMDS_MeshElement * e = aMesh->FindElement(aListId[ i ].toInt());
-       if (e) {
-         //if (!mySelectionMgr->IsIndexSelected(myActor->getIO(), e->GetID())) {
-          if (selectedIndices.Add(e->GetID())) {
-           //mySelectionMgr->AddOrRemoveIndex (myActor->getIO(), e->GetID(), true);
-            newIndices.Add(e->GetID());
-          }
-         myNbOkElements++;
-       }
-      }
-
-      if (newIndices.Extent() > 0)
-      {
-        mySelector->AddOrRemoveIndex(myActor->getIO(), newIndices, true);
-       myViewWindow->highlight( myActor->getIO(), true, true );
+       if (e)
+         newIndices.Add(e->GetID());
+       myNbOkElements++;
       }
 
+      mySelector->AddOrRemoveIndex(myActor->getIO(), newIndices, false);
+      myViewWindow->highlight( myActor->getIO(), true, true );
+      
       myElementsId = theNewText;
     }
   }