1 // Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License.
8 // This library is distributed in the hope that it will be useful
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/
19 #ifndef VTKVIEWER_VIEWMODEL_H
20 #define VTKVIEWER_VIEWMODEL_H
22 #include "VTKViewer.h"
23 #include "SUIT_ViewModel.h"
27 class SUIT_ViewWindow;
30 class VTKVIEWER_EXPORT VTKViewer_Viewer: public SUIT_ViewModel
35 /*!Initialize type of viewer.*/
36 static QString Type() { return "VTKViewer"; }
39 virtual ~VTKViewer_Viewer();
41 virtual SUIT_ViewWindow* createView(SUIT_Desktop* theDesktop);
43 virtual void setViewManager(SUIT_ViewManager* theViewManager);
44 virtual void contextMenuPopup( QPopupMenu* );
45 /*!Gets type of viewer.*/
46 virtual QString getType() const { return Type(); }
49 void enableSelection(bool isEnabled);
50 /*!Checks: is selection enabled*/
51 bool isSelectionEnabled() const { return mySelectionEnabled; }
53 void enableMultiselection(bool isEnable);
54 /*!Checks: is multi selection enabled*/
55 bool isMultiSelectionEnabled() const { return myMultiSelectionEnabled; }
57 int getSelectionCount() const;
59 QColor backgroundColor() const;
60 void setBackgroundColor( const QColor& );
63 void selectionChanged();
66 void onMousePress(SUIT_ViewWindow*, QMouseEvent*);
67 void onMouseMove(SUIT_ViewWindow*, QMouseEvent*);
68 void onMouseRelease(SUIT_ViewWindow*, QMouseEvent*);
72 void onChangeBgColor();
76 bool mySelectionEnabled;
77 bool myMultiSelectionEnabled;