Salome HOME
Update version to 3.2.0a1
[modules/visu.git] / src / VVTK / VVTK_ViewModel.h
1 #ifndef VVTK_VIEWMODEL_H
2 #define VVTK_VIEWMODEL_H
3
4 #include <qcolor.h>
5
6 #include "VVTK.h"
7 #include "SVTK_ViewModelBase.h"
8
9 #include "SALOME_Prs.h"
10 #include "SALOME_InteractiveObject.hxx"
11
12 class VVTK_ViewWindow;
13
14 //! Extends two interfaces #SVTK_ViewModelBase and #SALOME_View 
15 class VVTK_EXPORT VVTK_Viewer : public SVTK_ViewModelBase, public SALOME_View
16 {
17   Q_OBJECT;
18
19 public:
20   typedef VVTK_ViewWindow TViewWindow;
21   static QString Type() { return "VVTK"; }
22
23   VVTK_Viewer();
24   virtual ~VVTK_Viewer();
25
26   //! Redefine SUIT_ViewModel::createView
27   virtual SUIT_ViewWindow* createView(SUIT_Desktop*);
28
29   //! Redefine SUIT_ViewModel::setViewManager
30   virtual void setViewManager(SUIT_ViewManager* theViewManager);
31   //! Redefine SUIT_ViewModel::contextMenuPopup
32   virtual void contextMenuPopup( QPopupMenu* );
33   //! See SUIT_ViewModel::getType
34   virtual QString getType() const { return Type(); }
35
36   //! Redefine SALOME_View::Repaint
37   virtual void Repaint();
38
39   //! Redefine SALOME_View::isVisible
40   virtual bool isVisible( const Handle(SALOME_InteractiveObject)& );
41
42   //! Get background color of the viewer
43   QColor backgroundColor() const;
44
45   //! Set background color to the viewer
46   void   setBackgroundColor( const QColor& );
47
48   //! Get size of trihedron of the viewer (see SVTK_Renderer::SetTrihedronSize)
49   int    trihedronSize() const;
50
51   //! Set size of trihedron of the viewer (see SVTK_Renderer::SetTrihedronSize)
52   void   setTrihedronSize( const int );
53
54 protected slots:
55   void onMousePress(SUIT_ViewWindow*, QMouseEvent*);
56   void onMouseMove(SUIT_ViewWindow*, QMouseEvent*);
57   void onMouseRelease(SUIT_ViewWindow*, QMouseEvent*);
58
59   void onDumpView();
60   void onShowToolbar();
61   void onChangeBgColor();
62
63 private:
64   QColor myBgColor;
65   int    myTrihedronSize;
66   bool   mySelectionEnabled;
67   bool   myMultiSelectionEnabled;
68 };
69
70 #endif