Version: 8.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
GraphicsView_ViewFrame.h
Go to the documentation of this file.
1 // Copyright (C) 2013-2016 CEA/DEN, EDF R&D, OPEN CASCADE
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 GRAPHICSVIEW_VIEWFRAME_H
21 #define GRAPHICSVIEW_VIEWFRAME_H
22 
23 #include "GraphicsView.h"
24 
25 #include <SUIT_ViewWindow.h>
26 
27 class QGraphicsSceneContextMenuEvent;
28 class QGraphicsSceneMouseEvent;
29 class QGraphicsSceneWheelEvent;
30 
31 class QtxMultiAction;
32 
33 class SUIT_Desktop;
34 
37 
38 /*
39  Class : GraphicsView_ViewFrame
40  Description : View frame of the graphics view
41 */
43 {
44  Q_OBJECT
45 
46 public:
47  enum { DumpId, FitAllId, FitRectId, FitSelectId, ZoomId, PanId, GlobalPanId, ResetId };
48 
49 public:
52 
53 public:
54  GraphicsView_Viewer* getViewer() const { return myViewer; }
55  GraphicsView_ViewPort* getViewPort() const { return myViewPort; }
56 
57  virtual QImage dumpView();
58 
59  virtual QString getVisualParameters();
60  virtual void setVisualParameters( const QString& theParameters );
61 
62  void expandToolBarActions();
63  int getToolBarId();
64 
65 protected slots:
66  void onViewPan();
67  void onViewZoom();
68  void onViewFitAll();
69  void onViewFitArea();
70  void onViewFitSelect();
71  void onViewGlobalPan();
72  void onViewReset();
73 
74 private slots:
75  void keyEvent( QKeyEvent* );
76  void mouseEvent( QGraphicsSceneMouseEvent* );
77  void wheelEvent( QGraphicsSceneWheelEvent* );
78  void contextMenuEvent( QGraphicsSceneContextMenuEvent* );
79 
80 signals:
81  void keyPressed( QKeyEvent* );
82  void keyReleased( QKeyEvent* );
83  void mousePressed( QGraphicsSceneMouseEvent* );
84  void mouseMoving( QGraphicsSceneMouseEvent* );
85  void mouseReleased( QGraphicsSceneMouseEvent* );
86  void mouseDoubleClicked( QGraphicsSceneMouseEvent* );
87  void wheeling( QGraphicsSceneWheelEvent* );
88 
89  void sketchingFinished( QPainterPath );
90 
91 private:
92  void createActions();
93  int createToolBar();
94 
95 private:
98 
102 };
103 
104 #endif