Salome HOME
Preferences edition.
[modules/gui.git] / src / SVTK / SVTK_ViewModel.h
1 #ifndef SVTK_VIEWMODEL_H
2 #define SVTK_VIEWMODEL_H
3
4 #include "SVTK.h"
5 #include "VTKViewer_ViewModel.h"
6
7 #include "SALOME_Prs.h"
8 #include "SALOME_InteractiveObject.hxx"
9
10 #include <qcolor.h>
11
12 class SVTK_EXPORT SVTK_Viewer : public SUIT_ViewModel, public SALOME_View 
13 {
14   Q_OBJECT;
15
16 public:
17   static QString Type() { return "VTKViewer"; }
18
19   SVTK_Viewer();
20   virtual ~SVTK_Viewer();
21
22   virtual SUIT_ViewWindow* createView(SUIT_Desktop*);
23
24   virtual void             setViewManager(SUIT_ViewManager* theViewManager);
25   virtual void             contextMenuPopup( QPopupMenu* );
26   virtual QString          getType() const { return Type(); }
27
28   QColor backgroundColor() const;
29   void   setBackgroundColor( const QColor& );
30
31 public:
32   void enableSelection(bool isEnabled);
33   bool isSelectionEnabled() const { return mySelectionEnabled; }
34
35   void enableMultiselection(bool isEnable);
36   bool isMultiSelectionEnabled() const { return myMultiSelectionEnabled; }
37
38   int  getSelectionCount() const;
39
40   /* Reimplemented from SALOME_View */
41   void                           Display( const SALOME_VTKPrs* );
42   void                           Erase( const SALOME_VTKPrs*, const bool = false );
43   void                           EraseAll( const bool = false );
44   SALOME_Prs*                    CreatePrs( const char* entry = 0 );
45   virtual void                   BeforeDisplay( SALOME_Displayer* d );
46   virtual void                   AfterDisplay ( SALOME_Displayer* d );
47   virtual bool                   isVisible( const Handle(SALOME_InteractiveObject)& );
48   virtual void                   Repaint();
49
50   //implemented in SOCC, but were not found in VTKVIEwer_ViewFrame, so not implemented here..
51   //?virtual void                LocalSelection( const SALOME_OCCPrs*, const int );
52   //?virtual void                GlobalSelection( const bool = false ) const;
53
54 public slots:
55   void onSelectionChanged();
56
57  signals:
58   void selectionChanged();
59
60 protected slots:
61   void onMousePress(SUIT_ViewWindow*, QMouseEvent*);
62   void onMouseMove(SUIT_ViewWindow*, QMouseEvent*);
63   void onMouseRelease(SUIT_ViewWindow*, QMouseEvent*);
64
65   void onDumpView();
66   void onShowToolbar();
67   void onChangeBgColor();
68
69 private:
70   QColor myBgColor;
71   bool   mySelectionEnabled;
72   bool   myMultiSelectionEnabled;
73 };
74
75 #endif