1 // Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 #include "ATOMICGUI_Selection.h"
21 #include "LightApp_DataOwner.h"
23 #include <LightApp_SelectionMgr.h>
24 #include <qstringlist.h>
27 ATOMICGUI_Selection::ATOMICGUI_Selection ()
28 : LightApp_Selection()
33 ATOMICGUI_Selection::~ATOMICGUI_Selection()
37 /*! Initialization of Selection */
38 void ATOMICGUI_Selection::init( const QString& client, LightApp_SelectionMgr* mgr )
41 SUIT_DataOwnerPtrList sel;
43 SUIT_DataOwnerPtrList::const_iterator anIt = sel.begin(),
45 for ( ; anIt != aLast; anIt++ ) {
46 QString type = "Unknown";
47 SUIT_DataOwner* owner = (SUIT_DataOwner*)( (*anIt).get() );
48 LightApp_DataOwner* sowner = dynamic_cast<LightApp_DataOwner*>( owner );
49 QStringList es = sowner->entry().split( "_" );
50 if ( es.count() > 0 && es[ 0 ] == "ATOMICGUI" ) {
51 if ( es.count() > 1 ) {
52 if( es[ 1 ] == "root" )
60 myTypes.append( type );
63 LightApp_Selection::init( client, mgr );
66 /*! Returns number of objects of supported types. */
67 int ATOMICGUI_Selection::count() const
69 return myTypes.count();
72 /*! Returns selection parameter value. */
73 QVariant ATOMICGUI_Selection::parameter( const int ind, const QString& p ) const
76 return myTypes[ ind ];
77 return LightApp_Selection::parameter( ind, p );