X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMESHGUI%2FSMESHGUI_SelectionOp.cxx;h=0c8486ed2e944befe69846068b34557bf40ff4a7;hp=1cb2fc21363612b403fc894b370c47aac196fe55;hb=0fdf27b77bce6d48fa08a35ded5a5af3d13834e8;hpb=0635c9fc80f67d1e5dc0e94ec85f487286a92070 diff --git a/src/SMESHGUI/SMESHGUI_SelectionOp.cxx b/src/SMESHGUI/SMESHGUI_SelectionOp.cxx index 1cb2fc213..0c8486ed2 100644 --- a/src/SMESHGUI/SMESHGUI_SelectionOp.cxx +++ b/src/SMESHGUI/SMESHGUI_SelectionOp.cxx @@ -1,24 +1,25 @@ -// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE // -// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS // -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. // -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // + // File : SMESHGUI_SelectionOp.cxx // Author : Alexander SOLOVYOV, Open CASCADE S.A.S. // SMESH includes @@ -317,7 +318,9 @@ int SMESHGUI_SelectionOp::typeById( const QString& str, const EntityType objtype GEOM::GEOM_Object_var obj = GEOM::GEOM_Object::_narrow( dynamic_cast( sobj.get() )->GetObject() ); if( !CORBA::is_nil( obj ) ) - res = SMESHGUI_Dialog::prefix( "GEOM" ) + obj->GetType(); + // as decoding of type id is not realized in LightApp_Dialog, + //make all GEOM objects have same type id + res = SMESHGUI_Dialog::prefix( "GEOM" );// + obj->GetType(); } } else @@ -423,9 +426,9 @@ void SMESHGUI_SelectionOp::selected( QStringList& names, SalomeApp_Study* _study = dynamic_cast( study() ); if( _study ) { - _PTR(SObject) obj = _study->studyDS()->FindObjectID( anIt.Value()->getEntry() ); - if( obj ) - names.append( obj->GetName().c_str() ); + _PTR(SObject) obj = _study->studyDS()->FindObjectID( anIt.Value()->getEntry() ); + if( obj ) + names.append( obj->GetName().c_str() ); } } } @@ -490,9 +493,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 );