]> SALOME platform Git repositories - modules/gui.git/blob - src/SalomeApp/SalomeApp_VTKSelector.h
Salome HOME
ENV: Windows porting
[modules/gui.git] / src / SalomeApp / SalomeApp_VTKSelector.h
1 #ifndef SALOMEAPP_VTKSELECTOR_H
2 #define SALOMEAPP_VTKSELECTOR_H
3
4 #include <vtkSmartPointer.h>
5
6 #include <TColStd_IndexedMapOfInteger.hxx>
7
8 #include "SUIT_Selector.h"
9
10 #include "SalomeApp.h"
11 #include "SalomeApp_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 SalomeApp_SVTKDataOwner : public SalomeApp_DataOwner
23 {
24  public:
25     SalomeApp_SVTKDataOwner( const Handle(SALOME_InteractiveObject)& theIO,
26                              const TColStd_IndexedMapOfInteger& theIds,
27                              Selection_Mode theMode = ActorSelection,
28                              SALOME_Actor* theActor = NULL);
29     virtual ~SalomeApp_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 salome vtk selection of data owners.
54 */
55 class SALOMEAPP_EXPORT SalomeApp_VTKSelector : public SUIT_Selector
56 {
57   Q_OBJECT;
58
59 public:
60   SalomeApp_VTKSelector( SVTK_Viewer*, SUIT_SelectionMgr* );
61   virtual ~SalomeApp_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