Salome HOME
Issue #2625: Provide correct behavior of arrow of current feature
[modules/shaper.git] / src / PartSet / PartSet_MouseProcessor.h
1 // Copyright (C) 2014-2017  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
18 // email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
19 //
20
21 #ifndef PartSet_MouseProcessor_H
22 #define PartSet_MouseProcessor_H
23
24 #include "PartSet.h"
25
26 #include <memory>
27
28 class ModuleBase_IViewWindow;
29 class ModuleBase_ViewerPrs;
30 class QMouseEvent;
31
32 /**
33  * This is an interface to allow processing of mouse events. Implementation of necessary methods
34 * should be done in a child.
35 */
36 class PartSet_MouseProcessor
37 {
38 public:
39   /// Processing the mouse move event in the viewer
40   /// \param theWindow a view window
41   /// \param theEvent a mouse event
42   PARTSET_EXPORT virtual void mouseMoved(ModuleBase_IViewWindow* theWindow,
43                                          QMouseEvent* theEvent) {}
44   /// Processing the mouse press event in the viewer
45   /// \param theWindow a view window
46   /// \param theEvent a mouse event
47   PARTSET_EXPORT virtual void mousePressed(ModuleBase_IViewWindow* theWindow,
48                                            QMouseEvent* theEvent) {}
49   /// Processing the mouse release event in the viewer
50   /// \param theWindow a view window
51   /// \param theEvent a mouse event
52   PARTSET_EXPORT virtual void mouseReleased(ModuleBase_IViewWindow* theWindow,
53                                             QMouseEvent* theEvent) {}
54   /// Processing the mouse double click event in the viewer
55   /// \param theWindow a view window
56   /// \param theEvent a mouse event
57   PARTSET_EXPORT virtual void mouseDoubleClick(ModuleBase_IViewWindow* theWindow,
58                                                QMouseEvent* theEvent) {}
59
60   /// Fill preselection used in mouseReleased
61   virtual void setPreSelection(const std::shared_ptr<ModuleBase_ViewerPrs>& thePreSelected,
62                                ModuleBase_IViewWindow* theWnd,
63                                QMouseEvent* theEvent) {}
64 };
65
66 #endif