Salome HOME
PAL10110 - incorrect title of dialog of file selection for file preference item
[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   int    trihedronSize() const;
32   void   setTrihedronSize( const int );
33
34 public:
35   void enableSelection(bool isEnabled);
36   bool isSelectionEnabled() const { return mySelectionEnabled; }
37
38   void enableMultiselection(bool isEnable);
39   bool isMultiSelectionEnabled() const { return myMultiSelectionEnabled; }
40
41   int  getSelectionCount() const;
42
43   /* Reimplemented from SALOME_View */
44   void                           Display( const SALOME_VTKPrs* );
45   void                           Erase( const SALOME_VTKPrs*, const bool = false );
46   void                           EraseAll( const bool = false );
47   SALOME_Prs*                    CreatePrs( const char* entry = 0 );
48   virtual void                   BeforeDisplay( SALOME_Displayer* d );
49   virtual void                   AfterDisplay ( SALOME_Displayer* d );
50   virtual bool                   isVisible( const Handle(SALOME_InteractiveObject)& );
51   virtual void                   Repaint();
52
53   //implemented in SOCC, but were not found in VTKVIEwer_ViewFrame, so not implemented here..
54   //?virtual void                LocalSelection( const SALOME_OCCPrs*, const int );
55   //?virtual void                GlobalSelection( const bool = false ) const;
56
57 public slots:
58   void onSelectionChanged();
59
60  signals:
61   void selectionChanged();
62
63 protected slots:
64   void onMousePress(SUIT_ViewWindow*, QMouseEvent*);
65   void onMouseMove(SUIT_ViewWindow*, QMouseEvent*);
66   void onMouseRelease(SUIT_ViewWindow*, QMouseEvent*);
67
68   void onDumpView();
69   void onShowToolbar();
70   void onChangeBgColor();
71
72 private:
73   QColor myBgColor;
74   int    myTrihedronSize;
75   bool   mySelectionEnabled;
76   bool   myMultiSelectionEnabled;
77 };
78
79 #endif