X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMESHGUI%2FSMESHGUI_SingleEditDlg.cxx;h=223dbaad8a565864f3c31f4e8dbaec0b84519000;hp=fcf0682b49ef72c673973f5c70e453e60a7cb997;hb=544a24fb7fd4dc55a61ffac82c8001d84d9d6f6b;hpb=b33324fe602b1fe1158c14a866c3802df12370fa diff --git a/src/SMESHGUI/SMESHGUI_SingleEditDlg.cxx b/src/SMESHGUI/SMESHGUI_SingleEditDlg.cxx index fcf0682b4..223dbaad8 100755 --- a/src/SMESHGUI/SMESHGUI_SingleEditDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_SingleEditDlg.cxx @@ -350,10 +350,10 @@ void SMESHGUI_SingleEditDlg::onTextChange (const QString& theNewText) // find a triangle and an edge nb const SMDS_MeshElement* tria[2]; allOk &= a2Nodes[0] != a2Nodes[1] && findTriangles(a2Nodes[0],a2Nodes[1],tria[0],tria[1]); - if(allOk){ - myBusy = true; // block onSelectionDone() + myBusy = true; // block onSelectionDone() + if(allOk) + { newIndices.Add(tria[0]->GetID()); - mySelector->AddOrRemoveIndex(anIO,newIndices, true); const SMDS_MeshNode* a3Nodes [3]; SMDS_ElemIteratorPtr it; @@ -369,15 +369,15 @@ void SMESHGUI_SingleEditDlg::onTextChange (const QString& theNewText) } } } - - newIndices.Clear(); newIndices.Add(-edgeInd-1); - mySelector->AddOrRemoveIndex(anIO,newIndices,true); - myBusy = false; myOkBtn->setEnabled(true); myApplyBtn->setEnabled(true); } + mySelector->AddOrRemoveIndex(anIO,newIndices, false); + SMESH::GetViewWindow(mySMESHGUI)->highlight( anIO, true, true ); + + myBusy = false; } } } @@ -407,19 +407,22 @@ void SMESHGUI_SingleEditDlg::onSelectionDone() myActor = SMESH::FindActorByEntry(anIO->getEntry()); if(myActor){ TVisualObjPtr aVisualObj = myActor->GetObject(); - if(SMDS_Mesh* aMesh = aVisualObj->GetMesh()){ - if(SMESH::GetEdgeNodes(mySelector, aVisualObj, anId1, anId2) >= 1){ + if(SMDS_Mesh* aMesh = aVisualObj->GetMesh()) + { + const SMDS_MeshElement* tria[2]; + if( SMESH::GetEdgeNodes( mySelector, aVisualObj, anId1, anId2 ) >= 1 && + findTriangles( aMesh->FindNode( anId1 ), aMesh->FindNode( anId2 ), tria[0],tria[1] ) ) + { QString aText = QString("%1-%2").arg(anId1).arg(anId2); myBusy = true; myEdge->setText(aText); myBusy = false; - const SMDS_MeshElement* tria[2]; - if (findTriangles(aMesh->FindNode(anId1), aMesh->FindNode(anId2), tria[0],tria[1])) { - myOkBtn->setEnabled(true); - myApplyBtn->setEnabled(true); - } - } else { + myOkBtn->setEnabled(true); + myApplyBtn->setEnabled(true); + } + else + { myEdge->clear(); } }