1 // Copyright (C) 2013-2019 CEA/DEN, EDF R&D, OPEN CASCADE
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 email : webmaster.salome@opencascade.com
20 #ifndef GRAPHICSVIEW_VIEWFRAME_H
21 #define GRAPHICSVIEW_VIEWFRAME_H
23 #include "GraphicsView.h"
25 #include <SUIT_ViewWindow.h>
27 class QGraphicsSceneContextMenuEvent;
28 class QGraphicsSceneMouseEvent;
29 class QGraphicsSceneWheelEvent;
35 class GraphicsView_Viewer;
36 class GraphicsView_ViewPort;
39 Class : GraphicsView_ViewFrame
40 Description : View frame of the graphics view
42 class GRAPHICSVIEW_API GraphicsView_ViewFrame : public SUIT_ViewWindow
47 enum { DumpId, FitAllId, FitRectId, FitSelectId, ZoomId, PanId, GlobalPanId, ResetId };
50 GraphicsView_ViewFrame( SUIT_Desktop*, GraphicsView_Viewer*, QWidget* w = NULL );
51 ~GraphicsView_ViewFrame();
53 GraphicsView_Viewer* getViewer() const { return myViewer; }
54 GraphicsView_ViewPort* getViewPort() const { return myViewPort; }
56 virtual QImage dumpView();
58 virtual QString getVisualParameters();
59 virtual void setVisualParameters( const QString& theParameters );
61 virtual void expandToolBarActions();
65 virtual void showEvent( QShowEvent* );
66 virtual void hideEvent( QHideEvent* );
73 void onViewFitSelect();
74 void onViewGlobalPan();
78 void keyEvent( QKeyEvent* );
79 void mouseEvent( QGraphicsSceneMouseEvent* );
80 void wheelEvent( QGraphicsSceneWheelEvent* );
81 void contextMenuEvent( QGraphicsSceneContextMenuEvent* );
84 void keyPressed( QKeyEvent* );
85 void keyReleased( QKeyEvent* );
86 void mousePressed( QGraphicsSceneMouseEvent* );
87 void mouseMoving( QGraphicsSceneMouseEvent* );
88 void mouseReleased( QGraphicsSceneMouseEvent* );
89 void mouseDoubleClicked( QGraphicsSceneMouseEvent* );
90 void wheeling( QGraphicsSceneWheelEvent* );
92 void sketchingFinished( QPainterPath );
94 void Show( QShowEvent* );
95 void Hide( QHideEvent* );
98 virtual void createActions();
99 virtual int createToolBar();
100 virtual QString filter() const;
101 virtual bool dumpViewToFormat( const QImage&, const QString& fileName, const QString& format );
104 GraphicsView_Viewer* myViewer;
105 GraphicsView_ViewPort* myViewPort;
108 QAction* myScaleAction;
109 QAction* myPanAction;