+// Copyright (C) 2007-2013 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
+//
+// 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 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
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#include "HYDROGUI_OCCSelector.h"
+
+#include "HYDROGUI_DataModel.h"
+#include "HYDROGUI_DataObject.h"
+#include "HYDROGUI_Module.h"
+
+#include <AIS_ListOfInteractive.hxx>
+#include <AIS_ListIteratorOfListOfInteractive.hxx>
+
+#include <LightApp_DataOwner.h>
+
+HYDROGUI_OCCSelector::HYDROGUI_OCCSelector( HYDROGUI_Module* theModule,
+ OCCViewer_Viewer* theViewer,
+ SUIT_SelectionMgr* theSelMgr )
+: LightApp_OCCSelector( theViewer, theSelMgr ),
+ myModule( theModule )
+{
+}
+
+HYDROGUI_OCCSelector::~HYDROGUI_OCCSelector()
+{
+}
+
+void HYDROGUI_OCCSelector::getSelection( SUIT_DataOwnerPtrList& aList ) const
+{
+ OCCViewer_Viewer* aViewer = viewer();
+ if ( !aViewer )
+ return;
+
+ AIS_ListOfInteractive aSelList;
+ aViewer->getSelectedObjects( aSelList );
+ for ( AIS_ListIteratorOfListOfInteractive anIt( aSelList ); anIt.More(); anIt.Next() )
+ if ( !anIt.Value().IsNull() )
+ {
+ aList.append( SUIT_DataOwnerPtr( new LightApp_DataOwner( entry( anIt.Value() ) ) ) );
+ }
+ // add externally selected objects
+ SUIT_DataOwnerPtrList::const_iterator anExtIter;
+ for(anExtIter = mySelectedExternals.begin(); anExtIter != mySelectedExternals.end(); anExtIter++) {
+ aList.append(*anExtIter);
+ }
+}
+
+QString HYDROGUI_OCCSelector::entry( const Handle(AIS_InteractiveObject)& anAIS ) const
+{
+ QString aRes;
+
+ if ( anAIS.IsNull() || !anAIS->HasOwner() )
+ return aRes;
+
+ Handle(HYDROData_Object) anObj =
+ Handle(HYDROData_Object)::DownCast( anAIS->GetOwner() );
+ if ( !anObj.IsNull() )
+ aRes = HYDROGUI_DataObject::dataObjectEntry( anObj );
+
+ return aRes;
+}
\ No newline at end of file