+ QStringList aListId = QStringList::split("-", theNewText, false);
+ if (aListId.count() != 2)
+ return;
+
+ int i;
+ bool allOk = true;
+ const SMDS_MeshNode* a2Nodes[2];
+ for (i = 0; i < aListId.count(); i++) {
+ if(const SMDS_MeshNode *aNode = aMesh->FindNode(aListId[ i ].toInt()))
+ a2Nodes[ i ] = aNode;
+ else
+ allOk = false;
+ }
+
+ // 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()
+ newIndices.Add(tria[0]->GetID());
+ mySelector->AddOrRemoveIndex(anIO,newIndices, true);
+
+ const SMDS_MeshNode* a3Nodes [3];
+ SMDS_ElemIteratorPtr it;
+ int edgeInd = 2;
+ for (i = 0, it = tria[0]->nodesIterator(); it->more(); i++) {
+ a3Nodes[ i ] = static_cast<const SMDS_MeshNode*>(it->next());
+ if (i > 0) {
+ allOk = (a3Nodes[ i ] == a2Nodes[ 0 ] && a3Nodes[ i - 1] == a2Nodes[ 1 ]) ||
+ (a3Nodes[ i ] == a2Nodes[ 1 ] && a3Nodes[ i - 1] == a2Nodes[ 0 ]);
+ if (allOk) {
+ edgeInd = i - 1;
+ break;
+ }
+ }
+ }
+
+ newIndices.Clear();
+ newIndices.Add(-edgeInd-1);
+ mySelector->AddOrRemoveIndex(anIO,newIndices,true);
+ myBusy = false;
+
+ myOkBtn->setEnabled(true);
+ myApplyBtn->setEnabled(true);
+ }