Salome HOME
*** empty log message ***
[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 class SVTK_EXPORT SVTK_Viewer : public SUIT_ViewModel, public SALOME_View 
11 {
12   Q_OBJECT;
13
14 public:
15   static QString Type() { return "VTKViewer"; }
16
17   SVTK_Viewer();
18   virtual ~SVTK_Viewer();
19
20   virtual SUIT_ViewWindow* createView(SUIT_Desktop*);
21
22   virtual void             setViewManager(SUIT_ViewManager* theViewManager);
23   virtual void             contextMenuPopup( QPopupMenu* );
24   virtual QString          getType() const { return Type(); }
25
26 public:
27   void enableSelection(bool isEnabled);
28   bool isSelectionEnabled() const { return mySelectionEnabled; }
29
30   void enableMultiselection(bool isEnable);
31   bool isMultiSelectionEnabled() const { return myMultiSelectionEnabled; }
32
33   int  getSelectionCount() const;
34
35   /* Reimplemented from SALOME_View */
36   void                           Display( const SALOME_VTKPrs* );
37   void                           Erase( const SALOME_VTKPrs*, const bool = false );
38   void                           EraseAll( const bool = false );
39   SALOME_Prs*                    CreatePrs( const char* entry = 0 );
40   virtual void                   BeforeDisplay( SALOME_Displayer* d );
41   virtual void                   AfterDisplay ( SALOME_Displayer* d );
42   virtual bool                   isVisible( const Handle(SALOME_InteractiveObject)& );
43   virtual void                   Repaint();
44
45   //implemented in SOCC, but were not found in VTKVIEwer_ViewFrame, so not implemented here..
46   //?virtual void                LocalSelection( const SALOME_OCCPrs*, const int );
47   //?virtual void                GlobalSelection( const bool = false ) const;
48
49 public slots:
50   void onSelectionChanged();
51
52  signals:
53   void selectionChanged();
54
55 protected slots:
56   void onMousePress(SUIT_ViewWindow*, QMouseEvent*);
57   void onMouseMove(SUIT_ViewWindow*, QMouseEvent*);
58   void onMouseRelease(SUIT_ViewWindow*, QMouseEvent*);
59
60   void onDumpView();
61   void onShowToolbar();
62   void onChangeBgColor();
63
64 private:
65   bool mySelectionEnabled;
66   bool myMultiSelectionEnabled;
67 };
68
69 #endif