Version: 9.15.0
QtViewer_Viewer.h
Go to the documentation of this file.
1 // Copyright (C) 2013-2025 CEA, EDF, OPEN CASCADE
2 //
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, or (at your option) any later version.
7 //
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.
12 //
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
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19 
20 #ifndef QTVIEWER_VIEWER_H
21 #define QTVIEWER_VIEWER_H
22 
23 #include "QtViewer.h"
24 #include <SUIT_ViewModel.h>
25 
26 class QKeyEvent;
27 class QMouseEvent;
28 class QWheelEvent;
29 
30 class SUIT_ViewWindow;
31 
32 class QtViewer_Selector;
33 class QtViewer_Scene;
34 class QtViewer_ViewFrame;
35 class QtViewer_ViewPort;
36 
37 /*
38  Class : QtViewer_Viewer
39  Description : View model of the graphics view
40 */
42 {
43  Q_OBJECT
44 
45 public:
46  QtViewer_Viewer(const QString& title, QWidget* widget = nullptr);
47  ~QtViewer_Viewer();
48 
49 public:
51 
52  virtual QString getType() const { return Type(); }
53  static QString Type() { return "QtViewer"; }
54 
55  virtual void contextMenuPopup(QMenu*);
56 
57 public:
58  QtViewer_Selector* getSelector();
59 
60  QtViewer_ViewFrame* getActiveView() const;
61  QtViewer_ViewPort* getActiveViewPort() const;
62  QtViewer_Scene* getActiveScene() const;
63 
64  void fitAll();
65  void fitSelect();
66  void fitArea();
67  void zoom();
68  void pan();
69  void globalPan();
70 
71 signals:
73 
74 protected:
75 
76  virtual QtViewer_ViewFrame* createViewFrame(SUIT_Desktop* theDesktop, QWidget* theWidget);
77 
78 protected slots:
79  virtual void onKeyEvent(QKeyEvent*);
80  virtual void onMouseEvent(QMouseEvent*);
81  virtual void onWheelEvent(QWheelEvent*);
82 
83  virtual void onSelectionDone();
84  virtual void onChangeBgColor();
85 
86 protected:
87  virtual void handleKeyPress(QKeyEvent*);
88  virtual void handleKeyRelease(QKeyEvent*);
89  virtual void handleMouseMove(QMouseEvent*);
90  virtual void handleMousePress(QMouseEvent*);
91  virtual void handleMouseRelease(QMouseEvent*);
92  virtual void handleWheel(QWheelEvent*);
93 
94 protected:
97 };
98 
99 #endif
#define QTVIEWER_API
Definition: QtViewer.h:29
Definition: QtViewer_Scene.h:33
Definition: QtViewer_Selector.h:35
Definition: QtViewer_ViewFrame.h:42
Definition: QtViewer_ViewPort.h:34
Definition: QtViewer_Viewer.h:42
static QString Type()
Definition: QtViewer_Viewer.h:53
virtual QString getType() const
Definition: QtViewer_Viewer.h:52
void selectionChanged()
QWidget * myWidget
Definition: QtViewer_Viewer.h:96
QtViewer_Selector * mySelector
Definition: QtViewer_Viewer.h:95
Definition: SUIT_Desktop.h:47
Definition: SUIT_ViewModel.h:47
virtual void contextMenuPopup(QMenu *)
Definition: SUIT_ViewModel.h:69
virtual SUIT_ViewWindow * createView(SUIT_Desktop *theDesktop)
Definition: SUIT_ViewModel.cxx:77
Definition: SUIT_ViewWindow.h:42
int Type
Definition: VTKViewer_Actor.h:62