Salome HOME
ff8aee99b80f40c7a5e2b108074080dea420d839
[modules/shaper.git] / src / PartSet / PartSet_MouseProcessor.h
1 // Copyright (C) 2014-2022  CEA/DEN, EDF R&D
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 PartSet_MouseProcessor_H
21 #define PartSet_MouseProcessor_H
22
23 #include "PartSet.h"
24
25 #include <memory>
26
27 #ifdef _MSC_VER
28 #pragma warning(disable: 4100)
29 #endif
30
31 class ModuleBase_IViewWindow;
32 class ModuleBase_ViewerPrs;
33 class QMouseEvent;
34
35 /**
36  * This is an interface to allow processing of mouse events. Implementation of necessary methods
37 * should be done in a child.
38 */
39 class PartSet_MouseProcessor
40 {
41 public:
42   /// Processing the mouse move event in the viewer
43   /// \param theWindow a view window
44   /// \param theEvent a mouse event
45   PARTSET_EXPORT virtual void mouseMoved(ModuleBase_IViewWindow* theWindow,
46                                          QMouseEvent* theEvent) {}
47   /// Processing the mouse press event in the viewer
48   /// \param theWindow a view window
49   /// \param theEvent a mouse event
50   PARTSET_EXPORT virtual void mousePressed(ModuleBase_IViewWindow* theWindow,
51                                            QMouseEvent* theEvent) {}
52   /// Processing the mouse release event in the viewer
53   /// \param theWindow a view window
54   /// \param theEvent a mouse event
55   PARTSET_EXPORT virtual void mouseReleased(ModuleBase_IViewWindow* theWindow,
56                                             QMouseEvent* theEvent) {}
57   /// Processing the mouse double click event in the viewer
58   /// \param theWindow a view window
59   /// \param theEvent a mouse event
60   PARTSET_EXPORT virtual void mouseDoubleClick(ModuleBase_IViewWindow* theWindow,
61                                                QMouseEvent* theEvent) {}
62
63   /// Fill preselection used in mouseReleased
64   virtual void setPreSelection(const std::shared_ptr<ModuleBase_ViewerPrs>& thePreSelected,
65                                ModuleBase_IViewWindow* theWnd,
66                                QMouseEvent* theEvent) {}
67 };
68
69 #endif