Salome HOME
compilation error (afterCloseDoc() - twice) is fixed.
[modules/gui.git] / src / SalomeApp / SalomeApp_VTKSelector.h
1 #ifndef SALOMEAPP_VTKSELECTOR_H
2 #define SALOMEAPP_VTKSELECTOR_H
3
4 #include <qobject.h>
5
6 #include <vtkSmartPointer.h>
7
8 #include <TColStd_IndexedMapOfInteger.hxx>
9
10 #include "SUIT_Selector.h"
11
12 #include "SalomeApp.h"
13 #include "SalomeApp_DataOwner.h"
14
15 #include "SVTK_Selection.h"
16 #include "SALOME_InteractiveObject.hxx"
17
18 class SALOME_Actor;
19 class SVTK_Viewer;
20
21 class SalomeApp_SVTKDataOwner : public SalomeApp_DataOwner
22 {
23  public:
24     SalomeApp_SVTKDataOwner( const Handle(SALOME_InteractiveObject)& theIO,
25                              const TColStd_IndexedMapOfInteger& theIds,
26                              Selection_Mode theMode = ActorSelection,
27                              SALOME_Actor* theActor = NULL);
28     virtual ~SalomeApp_SVTKDataOwner();
29
30     const Handle(SALOME_InteractiveObject)& GetIO() const
31     {
32       return myIO;
33     }
34
35     const TColStd_IndexedMapOfInteger& GetIds() const
36     {
37       return myIds;
38     }
39
40     Selection_Mode GetMode() const 
41     { 
42       return mySelectionMode; 
43     }
44
45     SALOME_Actor* GetActor() const;
46
47  protected:
48     Handle(SALOME_InteractiveObject) myIO;
49     TColStd_IndexedMapOfInteger myIds;
50     Selection_Mode mySelectionMode;
51     vtkSmartPointer<SALOME_Actor> myActor;
52 };
53
54
55 class SALOMEAPP_EXPORT SalomeApp_VTKSelector : public QObject, 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