1 // Copyright (C) 2013-2014 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* );
51 ~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 void expandToolBarActions();
69 void onViewFitSelect();
70 void onViewGlobalPan();
74 void keyEvent( QKeyEvent* );
75 void mouseEvent( QGraphicsSceneMouseEvent* );
76 void wheelEvent( QGraphicsSceneWheelEvent* );
77 void contextMenuEvent( QGraphicsSceneContextMenuEvent* );
80 void keyPressed( QKeyEvent* );
81 void keyReleased( QKeyEvent* );
82 void mousePressed( QGraphicsSceneMouseEvent* );
83 void mouseMoving( QGraphicsSceneMouseEvent* );
84 void mouseReleased( QGraphicsSceneMouseEvent* );
85 void mouseDoubleClicked( QGraphicsSceneMouseEvent* );
86 void wheeling( QGraphicsSceneWheelEvent* );
88 void sketchingFinished( QPainterPath );
95 GraphicsView_Viewer* myViewer;
96 GraphicsView_ViewPort* myViewPort;
99 QtxMultiAction* myScaleAction;
100 QtxMultiAction* myPanAction;