Salome HOME
Merge branch 'V9_2_2_BR'
[modules/shaper.git] / src / PartSet / PartSet_MouseProcessor.h
1 // Copyright (C) 2014-2019  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 class ModuleBase_IViewWindow;
28 class ModuleBase_ViewerPrs;
29 class QMouseEvent;
30
31 /**
32  * This is an interface to allow processing of mouse events. Implementation of necessary methods
33 * should be done in a child.
34 */
35 class PartSet_MouseProcessor
36 {
37 public:
38   /// Processing the mouse move event in the viewer
39   /// \param theWindow a view window
40   /// \param theEvent a mouse event
41   PARTSET_EXPORT virtual void mouseMoved(ModuleBase_IViewWindow* theWindow,
42                                          QMouseEvent* theEvent) {}
43   /// Processing the mouse press event in the viewer
44   /// \param theWindow a view window
45   /// \param theEvent a mouse event
46   PARTSET_EXPORT virtual void mousePressed(ModuleBase_IViewWindow* theWindow,
47                                            QMouseEvent* theEvent) {}
48   /// Processing the mouse release event in the viewer
49   /// \param theWindow a view window
50   /// \param theEvent a mouse event
51   PARTSET_EXPORT virtual void mouseReleased(ModuleBase_IViewWindow* theWindow,
52                                             QMouseEvent* theEvent) {}
53   /// Processing the mouse double click event in the viewer
54   /// \param theWindow a view window
55   /// \param theEvent a mouse event
56   PARTSET_EXPORT virtual void mouseDoubleClick(ModuleBase_IViewWindow* theWindow,
57                                                QMouseEvent* theEvent) {}
58
59   /// Fill preselection used in mouseReleased
60   virtual void setPreSelection(const std::shared_ptr<ModuleBase_ViewerPrs>& thePreSelected,
61                                ModuleBase_IViewWindow* theWnd,
62                                QMouseEvent* theEvent) {}
63 };
64
65 #endif