]> SALOME platform Git repositories - modules/yacs.git/blob - src/genericgui/GraphicsView.hxx
Salome HOME
7ed60f3f6c1f724f3d384e697f36f4090f131640
[modules/yacs.git] / src / genericgui / GraphicsView.hxx
1 //  Copyright (C) 2006-2008  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.
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 #ifndef _GRAPHICSVIEW_HXX_
20 #define _GRAPHICSVIEW_HXX_
21
22 #include "WrapGraphicsView.hxx"
23
24 #include <QContextMenuEvent>
25 #include <QAction>
26
27 namespace YACS
28 {
29   namespace HMI
30   {
31     class GraphicsView: public WrapGraphicsView
32     {
33       Q_OBJECT
34
35     public:
36       GraphicsView(QWidget *parent = 0);
37       virtual ~GraphicsView();
38
39     public slots:
40       virtual void onViewFitAll();
41       virtual void onViewFitArea();
42       virtual void onViewZoom();
43       virtual void onViewPan(); 
44       virtual void onViewGlobalPan(); 
45       virtual void onViewReset(); 
46
47     protected:
48       void contextMenuEvent(QContextMenuEvent *event);
49       void mouseMoveEvent (QMouseEvent *e);
50       void mousePressEvent (QMouseEvent *e);
51       void mouseReleaseEvent (QMouseEvent *e);
52
53       bool _zooming;
54       bool _fittingArea;
55       bool _panning;
56       int _prevX;
57       qreal _scale;
58       QPoint _prevPos;
59     };
60   }
61 }
62 #endif