Salome HOME
Update comments.
[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   /*!Initialize type of viewer.*/
18   static QString Type() { return "VTKViewer"; }
19
20   VTKViewer_Viewer();
21   virtual ~VTKViewer_Viewer();
22
23   virtual SUIT_ViewWindow* createView(SUIT_Desktop* theDesktop);
24
25   virtual void             setViewManager(SUIT_ViewManager* theViewManager);
26   virtual void             contextMenuPopup( QPopupMenu* );
27   /*!Gets type of viewer.*/
28   virtual QString          getType() const { return Type(); }
29
30 public:
31   void enableSelection(bool isEnabled);
32   /*!Checks: is selection enabled*/
33   bool isSelectionEnabled() const { return mySelectionEnabled; }
34
35   void enableMultiselection(bool isEnable);
36   /*!Checks: is multi selection enabled*/
37   bool isMultiSelectionEnabled() const { return myMultiSelectionEnabled; }
38
39   int  getSelectionCount() const;
40
41   QColor backgroundColor() const;
42   void   setBackgroundColor( const QColor& );
43
44 signals:
45   void selectionChanged();
46
47 protected slots:
48   void onMousePress(SUIT_ViewWindow*, QMouseEvent*);
49   void onMouseMove(SUIT_ViewWindow*, QMouseEvent*);
50   void onMouseRelease(SUIT_ViewWindow*, QMouseEvent*);
51
52   void onDumpView();
53   void onShowToolbar();
54   void onChangeBgColor();
55
56 private:
57   QColor myBgColor;
58   bool   mySelectionEnabled;
59   bool   myMultiSelectionEnabled;
60 };
61
62 #endif