Salome HOME
The selections of elements corrected.
authormzn <mzn@opencascade.com>
Fri, 24 Jun 2005 13:54:25 +0000 (13:54 +0000)
committermzn <mzn@opencascade.com>
Fri, 24 Jun 2005 13:54:25 +0000 (13:54 +0000)
src/SMESHGUI/SMESHGUI_AddMeshElementDlg.cxx
src/SMESHGUI/SMESHGUI_CreatePolyhedralVolumeDlg.cxx
src/SMESHGUI/SMESHGUI_MeshPatternDlg.cxx
src/SMESHGUI/SMESHGUI_MoveNodesDlg.cxx
src/SMESHGUI/SMESHGUI_SewingDlg.cxx

index 8226cdc6a7470801d4f96923479c78c8ed2aedb7..263758674743da0150dcd5bab341b388efbd2d5e 100644 (file)
@@ -524,28 +524,20 @@ void SMESHGUI_AddMeshElementDlg::onTextChange (const QString& theNewText)
     aMesh = myActor->GetObject()->GetMesh();
 
   if (aMesh) {
-    SALOME_ListIO aList; aList.Append( myActor->getIO() );
-    mySelectionMgr->setSelectedObjects( aList, false );
-
-    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++) {
       if( const SMDS_MeshNode * n = aMesh->FindNode( aListId[ i ].toInt() ) )
       {
-       if( selectedIndices.Add( n->GetID() ) )
-         newIndices.Add( n->GetID() );
+       newIndices.Add( n->GetID() );
        myNbOkNodes++;
       }
     }
     
-    if( newIndices.Extent()>0 )
-    {
-      mySelector->AddOrRemoveIndex( myActor->getIO(), newIndices, true );
-      myViewWindow->highlight( myActor->getIO(), true, true );
-    }
+    mySelector->AddOrRemoveIndex( myActor->getIO(), newIndices, false );
+    myViewWindow->highlight( myActor->getIO(), true, true );
+    
     bool aNodesOK = false;
     if (myIsPoly && myElementType == SMDSAbs_Face && aListId.count() >=3 ){
       myNbOkNodes = aListId.count();
index 6e7223ed498b92dcdc626a1a863cc3ddaea45abb..abf447e17425fd4ca058b342b976906374553db9 100644 (file)
@@ -583,28 +583,20 @@ void SMESHGUI_CreatePolyhedralVolumeDlg::onTextChange(const QString& theNewText)
   if (GetConstructorId() == 0)
   {
     if ( aMesh ) {
-      SALOME_ListIO aList; aList.Append( myActor->getIO() );
-      mySelectionMgr->setSelectedObjects( aList );
-
-      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_MeshNode * n = aMesh->FindNode( aListId[ i ].toInt() );
        if ( n ) {
-         if (selectedIndices.Add(n->GetID()))
-           newIndices.Add(n->GetID());
+         newIndices.Add(n->GetID());
          myNbOkElements++;
         }
       }
       
-      if (newIndices.Extent() > 0){
-       mySelector->AddOrRemoveIndex( myActor->getIO(), newIndices, true );
-       myViewWindow->highlight( myActor->getIO(), true, true );
-      }
-
+      mySelector->AddOrRemoveIndex( myActor->getIO(), newIndices, false );
+      myViewWindow->highlight( myActor->getIO(), true, true );
+      
       if ( myNbOkElements>0 && aListId.count()>=3)
        AddButton->setEnabled(true);
       else
@@ -621,29 +613,21 @@ void SMESHGUI_CreatePolyhedralVolumeDlg::onTextChange(const QString& theNewText)
       // check entered ids of faces and hilight them
     QStringList aListId;
     if ( aMesh ) {
-      SALOME_ListIO aList; aList.Append( myActor->getIO() );
-      mySelectionMgr->setSelectedObjects( aList );
-
-      TColStd_IndexedMapOfInteger selectedIndices;
       TColStd_MapOfInteger newIndices;
-      mySelector->GetIndex( myActor->getIO(), selectedIndices);
-
+      
       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 (selectedIndices.Add(e->GetID()))
-             newIndices.Add(e->GetID());
+         newIndices.Add(e->GetID());
          myNbOkElements++;  
        }
       }
 
-      if (newIndices.Extent() > 0){
-       mySelector->AddOrRemoveIndex( myActor->getIO(), newIndices, true );
-       myViewWindow->highlight( myActor->getIO(), true, true );
-      }
-
+      mySelector->AddOrRemoveIndex( myActor->getIO(), newIndices, false );
+      myViewWindow->highlight( myActor->getIO(), true, true );
+      
       if ( myNbOkElements ) {
        if (aListId.count()>1){ 
          buttonOk->setEnabled( true );
index cab4a47a2fd8cb10b48d7477b0be97abd2c3950c..047781d20f51bdc54ba957e3fe3f71854d659a37 100755 (executable)
@@ -1256,28 +1256,16 @@ void SMESHGUI_MeshPatternDlg::onTextChanged (const QString& theNewText)
 
   if (aMesh) {
     QStringList aListId = QStringList::split(" ", theNewText, false);
-
-    SALOME_ListIO aList;
-    aList.Append(anActor->getIO());
-    mySelectionMgr->setSelectedObjects(aList, false);
-
-    TColStd_IndexedMapOfInteger selectedIndices;
+    
     TColStd_MapOfInteger newIndices;
-    mySelector->GetIndex(anActor->getIO(), selectedIndices);
-
+    
     for (int i = 0; i < aListId.count(); i++) {
       const SMDS_MeshElement * e = aMesh->FindElement(aListId[ i ].toInt());
-      if (e && e->GetType() == (myType == Type_2d ? SMDSAbs_Face : SMDSAbs_Volume)) {
-        if (selectedIndices.Add(e->GetID())) {
-          newIndices.Add(e->GetID());
-        }
-      }
-    }
-    if (newIndices.Extent() > 0)
-    {
-      mySelector->AddOrRemoveIndex( anActor->getIO(), newIndices, true);
-      myViewWindow->highlight( anActor->getIO(), true, true );
+      if (e && e->GetType() == (myType == Type_2d ? SMDSAbs_Face : SMDSAbs_Volume))
+       newIndices.Add(e->GetID());
     }
+    mySelector->AddOrRemoveIndex( anActor->getIO(), newIndices, false);
+    myViewWindow->highlight( anActor->getIO(), true, true );
   }
 
   myBusy = false;
index 12ad1b684ca5377ac5cddf34125814160fe21fac..f249535c87a3e4a6521ab88218941b9aa069233b 100644 (file)
@@ -355,8 +355,10 @@ void SMESHGUI_MoveNodesDlg::onTextChange (const QString& theNewText)
       if(const SMDS_MeshElement *anElem = aMesh->FindElement(theNewText.toInt())) {
        TColStd_MapOfInteger aListInd;
        aListInd.Add(anElem->GetID());
-       mySelector->AddOrRemoveIndex(anIO,aListInd, true);
+       mySelector->AddOrRemoveIndex(anIO,aListInd, false);
        myViewWindow->highlight(anIO,true,true);
+       
+       onSelectionDone();
       }
     }
   }
index dab2df03253f5f7c0c2ba4a4562723815c6008b2..6bbc5c7b141412b71efaed2cd471d7f9c7a92aa2 100644 (file)
@@ -638,16 +638,8 @@ void SMESHGUI_SewingDlg::onTextChange (const QString& theNewText)
     send->clear();
 
   if (aMesh) {
-    //mySelectionMgr->clearSelected();
-    //mySelectionMgr->AddIObject(myActor->getIO());
-    SALOME_ListIO aList;
-    aList.Append(myActor->getIO());
-    mySelectionMgr->setSelectedObjects(aList, false);
-
-    TColStd_IndexedMapOfInteger selectedIndices;
     TColStd_MapOfInteger newIndices;
-    mySelector->GetIndex( myActor->getIO(), selectedIndices);
-
+    
     if (GetConstructorId() != 3 || (send != LineEdit1 && send != LineEdit4)) {
       SMESH::SetPointRepresentation(true);
 
@@ -655,14 +647,10 @@ void SMESHGUI_SewingDlg::onTextChange (const QString& theNewText)
 
       const SMDS_MeshNode * n = aMesh->FindNode(theNewText.toInt());
       if (n) {
-        //if (!mySelectionMgr->IsIndexSelected(myActor->getIO(), n->GetID())) {
-        if (selectedIndices.Add(n->GetID())) {
-          //mySelectionMgr->AddOrRemoveIndex (myActor->getIO(), n->GetID(), true);
-          newIndices.Add(n->GetID());
-          mySelector->AddOrRemoveIndex(myActor->getIO(), newIndices, true);
-         myViewWindow->highlight( myActor->getIO(), true, true );
-        }
-
+       newIndices.Add(n->GetID());
+       mySelector->AddOrRemoveIndex(myActor->getIO(), newIndices, false);
+       myViewWindow->highlight( myActor->getIO(), true, true );
+       
         if      (send == LineEdit1)
           myOk1 = true;
         else if (send == LineEdit2)
@@ -687,23 +675,17 @@ void SMESHGUI_SewingDlg::onTextChange (const QString& theNewText)
 
       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());
-          }
+        if (e) 
+         newIndices.Add(e->GetID());
+       
           if (!isEvenOneExists)
             isEvenOneExists = true;
-        }
-      }
-
-      if (newIndices.Extent() > 0)
-      {
-        mySelector->AddOrRemoveIndex(myActor->getIO(), newIndices, true);
-       myViewWindow->highlight( myActor->getIO(), true, true );
       }
+      
 
+      mySelector->AddOrRemoveIndex(myActor->getIO(), newIndices, false);
+      myViewWindow->highlight( myActor->getIO(), true, true );
+      
       if (isEvenOneExists) {
         if (send == LineEdit1)
           myOk1 = true;