1 // Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 #ifndef LIGHTAPP_VTKSELECTOR_H
23 #define LIGHTAPP_VTKSELECTOR_H
25 #include "SUIT_Selector.h"
27 #include "LightApp_DataOwner.h"
33 #ifndef DISABLE_VTKVIEWER
34 #include <TColStd_IndexedMapOfInteger.hxx>
35 #include "SVTK_Selection.h"
36 #ifndef DISABLE_SALOMEOBJECT
37 #include "SALOME_InteractiveObject.hxx"
40 class SVTK_ViewWindow;
41 class SVTK_ViewModelBase;
45 Provide salome vtk data owner list.
47 class LIGHTAPP_EXPORT LightApp_SVTKDataOwner : public LightApp_DataOwner
50 virtual ~LightApp_SVTKDataOwner() {};
51 #ifndef DISABLE_VTKVIEWER
52 #ifndef DISABLE_SALOMEOBJECT
53 LightApp_SVTKDataOwner( const Handle(SALOME_InteractiveObject)&, SUIT_Desktop* );
55 LightApp_SVTKDataOwner( const QString& );
58 /*!Gets dataowners ids list.*/
59 const TColStd_IndexedMapOfInteger& GetIds() const;
61 /*!Gets selection mode.*/
62 Selection_Mode GetMode() const;
64 /*!Finds corresponding actor in the active viewer.*/
65 SALOME_Actor* GetActor() const;
68 mutable TColStd_IndexedMapOfInteger myIds;
70 SVTK_ViewWindow* GetActiveViewWindow() const;
71 SUIT_Desktop* myDesktop;
77 \class LightApp_VTKSelector
78 Custom selector to get/set selection from object browser
80 class LIGHTAPP_EXPORT LightApp_VTKSelector : public QObject, public SUIT_Selector
85 virtual ~LightApp_VTKSelector() {};
86 #ifndef DISABLE_VTKVIEWER
87 LightApp_VTKSelector( SVTK_ViewModelBase*, SUIT_SelectionMgr* );
89 SVTK_ViewModelBase* viewer() const;
91 virtual QString type() const;
93 LightApp_VTKSelector( SUIT_SelectionMgr* );
97 void onSelectionChanged();
99 #ifndef DISABLE_VTKVIEWER
101 virtual void getSelection( SUIT_DataOwnerPtrList& ) const;
102 virtual void setSelection( const SUIT_DataOwnerPtrList& );
105 SVTK_ViewModelBase* myViewer;