Salome HOME
Preferences edition.
[modules/gui.git] / src / VTKViewer / VTKViewer_ViewModel.h
1 #ifndef VTKVIEWER_VIEWMODEL_H
2 #define VTKVIEWER_VIEWMODEL_H
3
4 #include "VTKViewer.h"
5 #include "SUIT_ViewModel.h"
6
7 #include <qcolor.h>
8
9 class SUIT_ViewWindow;
10 class SUIT_Desktop;
11
12 class VTKVIEWER_EXPORT VTKViewer_Viewer: public SUIT_ViewModel
13 {
14   Q_OBJECT
15
16 public:
17   static QString Type() { return "VTKViewer"; }
18
19   VTKViewer_Viewer();
20   virtual ~VTKViewer_Viewer();
21
22   virtual SUIT_ViewWindow* createView(SUIT_Desktop* theDesktop);
23
24   virtual void             setViewManager(SUIT_ViewManager* theViewManager);
25   virtual void             contextMenuPopup( QPopupMenu* );
26   virtual QString          getType() const { return Type(); }
27
28 public:
29   void enableSelection(bool isEnabled);
30   bool isSelectionEnabled() const { return mySelectionEnabled; }
31
32   void enableMultiselection(bool isEnable);
33   bool isMultiSelectionEnabled() const { return myMultiSelectionEnabled; }
34
35   int  getSelectionCount() const;
36
37   QColor backgroundColor() const;
38   void   setBackgroundColor( const QColor& );
39
40 signals:
41   void selectionChanged();
42
43 protected slots:
44   void onMousePress(SUIT_ViewWindow*, QMouseEvent*);
45   void onMouseMove(SUIT_ViewWindow*, QMouseEvent*);
46   void onMouseRelease(SUIT_ViewWindow*, QMouseEvent*);
47
48   void onDumpView();
49   void onShowToolbar();
50   void onChangeBgColor();
51
52 private:
53   QColor myBgColor;
54   bool   mySelectionEnabled;
55   bool   myMultiSelectionEnabled;
56 };
57
58 #endif