Version: 9.15.0
OCCViewer_ViewportInputFilter.h
Go to the documentation of this file.
1 // Copyright (C) 2007-2025 CEA, EDF, OPEN CASCADE
2 //
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License, or (at your option) any later version.
10 //
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
15 //
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 //
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22 
23 #ifndef OCCVIEWER_VIEWPORTINPUTFILTER_H
24 #define OCCVIEWER_VIEWPORTINPUTFILTER_H
25 
26 #include <QObject>
27 
30 class OCCViewer_Viewer;
31 class SUIT_ViewWindow;
32 class QMouseEvent;
33 class QKeyEvent;
34 
48 {
49  Q_OBJECT
50 
51 public:
54 
55 public:
56  virtual void setEnabled( const bool );
57 
58 protected:
59  virtual bool mouseMove( QMouseEvent*, OCCViewer_ViewPort3d* ) = 0;
60  virtual bool mousePress( QMouseEvent*, OCCViewer_ViewPort3d* ) = 0;
61  virtual bool mouseRelease( QMouseEvent*, OCCViewer_ViewPort3d* ) = 0;
62  virtual bool mouseDoubleClick( QMouseEvent*, OCCViewer_ViewPort3d* ) = 0;
63  virtual bool keyPress( QKeyEvent*, OCCViewer_ViewPort3d* ) = 0;
64  virtual bool keyRelease( QKeyEvent*, OCCViewer_ViewPort3d* ) = 0;
65 
66 protected:
69 
70 protected:
71  bool eventFilter( QObject*, QEvent* );
72 
73 protected slots:
76 
77 protected:
81 };
82 
83 #endif
Definition: OCCViewer_ViewManager.h:33
Definition: OCCViewer_ViewPort3d.h:43
Definition: OCCViewer_ViewModel.h:77
The user input filter of OCC viewports. The class can be used to introduce custom interactive operati...
Definition: OCCViewer_ViewportInputFilter.h:48
void disconnectView(SUIT_ViewWindow *)
Disconnects view to event processing.
Definition: OCCViewer_ViewportInputFilter.cxx:136
~OCCViewer_ViewportInputFilter()
Destructor.
Definition: OCCViewer_ViewportInputFilter.cxx:47
virtual bool keyRelease(QKeyEvent *, OCCViewer_ViewPort3d *)=0
OCCViewer_Viewer * myViewer
Definition: OCCViewer_ViewportInputFilter.h:79
virtual bool mouseDoubleClick(QMouseEvent *, OCCViewer_ViewPort3d *)=0
virtual void setEnabled(const bool)
Enables or disables event processing within the viewer.
Definition: OCCViewer_ViewportInputFilter.cxx:55
virtual bool keyPress(QKeyEvent *, OCCViewer_ViewPort3d *)=0
virtual bool mousePress(QMouseEvent *, OCCViewer_ViewPort3d *)=0
bool myIsEnabled
Definition: OCCViewer_ViewportInputFilter.h:80
OCCViewer_ViewportInputFilter(OCCViewer_ViewManager *, QObject *)
Constructor.
Definition: OCCViewer_ViewportInputFilter.cxx:37
void onViewRemoved(SUIT_ViewWindow *)
Disconnects view being removed from viewer.
Definition: OCCViewer_ViewportInputFilter.cxx:154
OCCViewer_ViewManager * myVM
Definition: OCCViewer_ViewportInputFilter.h:78
bool eventFilter(QObject *, QEvent *)
Base-level implementation of event filtering. Routes user input events to associated implementation m...
Definition: OCCViewer_ViewportInputFilter.cxx:101
virtual bool mouseMove(QMouseEvent *, OCCViewer_ViewPort3d *)=0
void onViewCreated(SUIT_ViewWindow *)
Connects newly created within viewer to event processing.
Definition: OCCViewer_ViewportInputFilter.cxx:145
virtual bool mouseRelease(QMouseEvent *, OCCViewer_ViewPort3d *)=0
void connectView(SUIT_ViewWindow *)
Connects view to event processing.
Definition: OCCViewer_ViewportInputFilter.cxx:127
For more information see QT documentation.
Definition: SUIT_Application.h:42
Definition: SUIT_ViewWindow.h:42