1 #ifndef SVTK_VIEWMODEL_H
2 #define SVTK_VIEWMODEL_H
5 #include "VTKViewer_ViewModel.h"
7 #include "SALOME_Prs.h"
8 #include "SALOME_InteractiveObject.hxx"
12 class SVTK_EXPORT SVTK_Viewer : public SUIT_ViewModel, public SALOME_View
17 static QString Type() { return "VTKViewer"; }
20 virtual ~SVTK_Viewer();
22 virtual SUIT_ViewWindow* createView(SUIT_Desktop*);
24 virtual void setViewManager(SUIT_ViewManager* theViewManager);
25 virtual void contextMenuPopup( QPopupMenu* );
26 virtual QString getType() const { return Type(); }
28 QColor backgroundColor() const;
29 void setBackgroundColor( const QColor& );
32 void enableSelection(bool isEnabled);
33 bool isSelectionEnabled() const { return mySelectionEnabled; }
35 void enableMultiselection(bool isEnable);
36 bool isMultiSelectionEnabled() const { return myMultiSelectionEnabled; }
38 int getSelectionCount() const;
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();
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;
55 void onSelectionChanged();
58 void selectionChanged();
61 void onMousePress(SUIT_ViewWindow*, QMouseEvent*);
62 void onMouseMove(SUIT_ViewWindow*, QMouseEvent*);
63 void onMouseRelease(SUIT_ViewWindow*, QMouseEvent*);
67 void onChangeBgColor();
71 bool mySelectionEnabled;
72 bool myMultiSelectionEnabled;