Salome HOME
The selections of elements corrected.
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_ExtrusionDlg.cxx
index 4860baeef08822edc19346087fbc58336f50cc9d..b5df5cc9442e274db537c266c71553c215e21624 100644 (file)
@@ -438,34 +438,19 @@ void SMESHGUI_ExtrusionDlg::onTextChange (const QString& theNewText)
     aMesh = myActor->GetObject()->GetMesh();
 
   if (aMesh) {
-    //mySelectionMgr->clearSelected();
-    //mySelectionMgr->AddIObject(myActor->getIO());
-    SALOME_ListIO aList;
-    aList.Append(myActor->getIO());
-    mySelectionMgr->setSelectedObjects(aList, false);
-
     QStringList aListId = QStringList::split(" ", theNewText, false);
 
     if (send == LineEditElements) {
       const Handle(SALOME_InteractiveObject)& anIO = myActor->getIO();
-      TColStd_IndexedMapOfInteger selectedIndices;
       TColStd_MapOfInteger newIndices;
-      mySelector->GetIndex(anIO, selectedIndices);
       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(anIO, newIndices, true);
-       myViewWindow->highlight( anIO, true, true );
+       if (e)
+         newIndices.Add(e->GetID());
+       myNbOkElements++;
       }
+      mySelector->AddOrRemoveIndex(anIO, newIndices, false);
+      myViewWindow->highlight( anIO, true, true );
       myElementsId = theNewText;
     }
   }