1 // Copyright (C) 2013-2022 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>
26 #include <QPainterPath>
28 class QGraphicsSceneContextMenuEvent;
29 class QGraphicsSceneMouseEvent;
30 class QGraphicsSceneWheelEvent;
36 class GraphicsView_Viewer;
37 class GraphicsView_ViewPort;
40 Class : GraphicsView_ViewFrame
41 Description : View frame of the graphics view
43 class GRAPHICSVIEW_API GraphicsView_ViewFrame : public SUIT_ViewWindow
48 enum { DumpId, FitAllId, FitRectId, FitSelectId, ZoomId, PanId, GlobalPanId, ResetId };
51 GraphicsView_ViewFrame( SUIT_Desktop*, GraphicsView_Viewer*, QWidget* w = NULL );
52 ~GraphicsView_ViewFrame();
54 GraphicsView_Viewer* getViewer() const { return myViewer; }
55 GraphicsView_ViewPort* getViewPort() const { return myViewPort; }
57 virtual QImage dumpView();
59 virtual QString getVisualParameters();
60 virtual void setVisualParameters( const QString& theParameters );
62 virtual void expandToolBarActions();
66 virtual void showEvent( QShowEvent* );
67 virtual void hideEvent( QHideEvent* );
74 void onViewFitSelect();
75 void onViewGlobalPan();
79 void keyEvent( QKeyEvent* );
80 void mouseEvent( QGraphicsSceneMouseEvent* );
81 void wheelEvent( QGraphicsSceneWheelEvent* );
82 void contextMenuEvent( QGraphicsSceneContextMenuEvent* );
85 void keyPressed( QKeyEvent* );
86 void keyReleased( QKeyEvent* );
87 void mousePressed( QGraphicsSceneMouseEvent* );
88 void mouseMoving( QGraphicsSceneMouseEvent* );
89 void mouseReleased( QGraphicsSceneMouseEvent* );
90 void mouseDoubleClicked( QGraphicsSceneMouseEvent* );
91 void wheeling( QGraphicsSceneWheelEvent* );
93 void sketchingFinished( QPainterPath );
95 void Show( QShowEvent* );
96 void Hide( QHideEvent* );
99 virtual void createActions();
100 virtual int createToolBar();
101 virtual QString filter() const;
102 virtual bool dumpViewToFormat( const QImage&, const QString& fileName, const QString& format );
105 GraphicsView_Viewer* myViewer;
106 GraphicsView_ViewPort* myViewPort;
109 QAction* myScaleAction;
110 QAction* myPanAction;