From: eap Date: Tue, 23 Oct 2012 07:50:39 +0000 (+0000) Subject: 21680: EDF 2288 SMESH: creation of 0D elements from other elements X-Git-Tag: V6_6_0b1~50 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=e47e273629a54881c076060545ea4221634dd4cc;p=modules%2Fsmesh.git 21680: EDF 2288 SMESH: creation of 0D elements from other elements fix onTextChanged() for selectionMode() == CellSelection --- diff --git a/src/SMESHGUI/SMESHGUI_SelectionOp.cxx b/src/SMESHGUI/SMESHGUI_SelectionOp.cxx index 7e4039a3a..2e4c7b9c5 100644 --- a/src/SMESHGUI/SMESHGUI_SelectionOp.cxx +++ b/src/SMESHGUI/SMESHGUI_SelectionOp.cxx @@ -491,9 +491,16 @@ void SMESHGUI_SelectionOp::onTextChanged( int, const QStringList& list ) IdList ids; extractIds( list, ids, '\0' ); IdList::const_iterator anIt = ids.begin(), aLast = ids.end(); - for( ; anIt!=aLast; anIt++ ) - if( const SMDS_MeshNode * n = aMesh->FindNode( *anIt ) ) - newIndices.Add( n->GetID() ); + if ( selectionMode() == NodeSelection ) + for( ; anIt!=aLast; anIt++ ) { + if( const SMDS_MeshNode * n = aMesh->FindNode( *anIt ) ) + newIndices.Add( n->GetID() ); + } + else + for( ; anIt!=aLast; anIt++ ) { + if( const SMDS_MeshElement* e = aMesh->FindElement( *anIt ) ) + newIndices.Add( e->GetID() ); + } selector()->AddOrRemoveIndex( sel.First(), newIndices, false ); highlight( sel.First(), true, true );