1 // Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
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.
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/
19 #ifndef LIGHTAPP_VTKSELECTOR_H
20 #define LIGHTAPP_VTKSELECTOR_H
22 #include "SUIT_Selector.h"
24 #include "LightApp_DataOwner.h"
28 #ifndef DISABLE_VTKVIEWER
29 #include <vtkSmartPointer.h>
30 #include <TColStd_IndexedMapOfInteger.hxx>
31 #include "SVTK_Selection.h"
32 #ifndef DISABLE_SALOMEOBJECT
33 #include "SALOME_InteractiveObject.hxx"
36 class SVTK_ViewWindow;
37 class SVTK_ViewModelBase;
41 Provide salome vtk data owner list.
43 class LIGHTAPP_EXPORT LightApp_SVTKDataOwner : public LightApp_DataOwner
46 #ifndef DISABLE_VTKVIEWER
47 #ifndef DISABLE_SALOMEOBJECT
48 LightApp_SVTKDataOwner( const Handle(SALOME_InteractiveObject)& theIO,
49 SUIT_Desktop* theDesktop );
51 virtual ~LightApp_SVTKDataOwner();
53 /*!Gets dataowners ids list.*/
54 const TColStd_IndexedMapOfInteger& GetIds() const;
56 /*!Gets selection mode.*/
57 Selection_Mode GetMode() const;
59 /*!Finds corresponding actor in the active viewer.*/
60 SALOME_Actor* GetActor() const;
63 mutable TColStd_IndexedMapOfInteger myIds;
65 SVTK_ViewWindow* GetActiveViewWindow() const;
66 SUIT_Desktop* myDesktop;
69 LightApp_SVTKDataOwner( const QString& );
75 \class LightApp_VTKSelector
76 Custom selector to get/set selection from object browser
78 class LIGHTAPP_EXPORT LightApp_VTKSelector : public SUIT_Selector
83 #ifndef DISABLE_VTKVIEWER
84 LightApp_VTKSelector( SVTK_ViewModelBase*, SUIT_SelectionMgr* );
85 virtual ~LightApp_VTKSelector();
87 SVTK_ViewModelBase* viewer() const;
89 virtual QString type() const;
91 LightApp_VTKSelector( SUIT_SelectionMgr* );
95 void onSelectionChanged();
97 #ifndef DISABLE_VTKVIEWER
99 virtual void getSelection( SUIT_DataOwnerPtrList& ) const;
100 virtual void setSelection( const SUIT_DataOwnerPtrList& );
103 SVTK_ViewModelBase* myViewer;