1 // Copyright (C) 2014-2017 CEA/DEN, EDF R&D
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.
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.
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
17 // See http://www.salome-platform.org/ or
18 // email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
21 #ifndef PartSet_MouseProcessor_H
22 #define PartSet_MouseProcessor_H
28 class ModuleBase_IViewWindow;
29 class ModuleBase_ViewerPrs;
33 * This is an interface to allow processing of mouse events. Implementation of necessary methods
34 * should be done in a child.
36 class PartSet_MouseProcessor
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) {}
60 /// Fill preselection used in mouseReleased
61 virtual void setPreSelection(const std::shared_ptr<ModuleBase_ViewerPrs>& thePreSelected,
62 ModuleBase_IViewWindow* theWnd,
63 QMouseEvent* theEvent) {}