]> SALOME platform Git repositories - modules/gui.git/blob - src/LightApp/LightApp_VTKSelector.h
Salome HOME
25c4ac44ee52bb5dfc0666ebc694555f3202b390
[modules/gui.git] / src / LightApp / LightApp_VTKSelector.h
1 #ifndef LIGHTAPP_VTKSELECTOR_H
2 #define LIGHTAPP_VTKSELECTOR_H
3
4 #include <vtkSmartPointer.h>
5
6 #include <TColStd_IndexedMapOfInteger.hxx>
7
8 #include "SUIT_Selector.h"
9
10 #include "LightApp.h"
11 #include "LightApp_DataOwner.h"
12
13 #include "SVTK_Selection.h"
14 #include "SALOME_InteractiveObject.hxx"
15
16 class SALOME_Actor;
17 class SVTK_Viewer;
18
19 /*!
20   Provide salome vtk data owner list.
21 */
22 class LIGHTAPP_EXPORT LightApp_SVTKDataOwner : public LightApp_DataOwner
23 {
24  public:
25     LightApp_SVTKDataOwner( const Handle(SALOME_InteractiveObject)& theIO,
26                             const TColStd_IndexedMapOfInteger& theIds,
27                             Selection_Mode theMode = ActorSelection,
28                             SALOME_Actor* theActor = NULL);
29     virtual ~LightApp_SVTKDataOwner();
30
31     /*!Gets dataowners ids list.*/
32     const TColStd_IndexedMapOfInteger& GetIds() const
33     {
34       return myIds;
35     }
36
37     /*!Gets selection mode.*/
38     Selection_Mode GetMode() const 
39     { 
40       return mySelectionMode; 
41     }
42
43     SALOME_Actor* GetActor() const;
44
45  protected:
46     TColStd_IndexedMapOfInteger myIds;
47     Selection_Mode mySelectionMode;
48     vtkSmartPointer<SALOME_Actor> myActor;
49 };
50
51
52 /*!
53   Provide vtk selection of data owners.
54 */
55 class LIGHTAPP_EXPORT LightApp_VTKSelector : public SUIT_Selector
56 {
57   Q_OBJECT;
58
59 public:
60   LightApp_VTKSelector( SVTK_Viewer*, SUIT_SelectionMgr* );
61   virtual ~LightApp_VTKSelector();
62
63   SVTK_Viewer* viewer() const;
64
65   virtual QString type() const;
66
67 private slots:
68   void              onSelectionChanged();
69
70 protected:
71   virtual void      getSelection( SUIT_DataOwnerPtrList& ) const;
72   virtual void      setSelection( const SUIT_DataOwnerPtrList& );
73
74 private:
75   SVTK_Viewer* myViewer;
76 };
77
78 #endif