Version: 9.15.0
QtViewer_ViewFrame.h
Go to the documentation of this file.
1 // Copyright (C) 2013-2025 CEA, EDF, 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 QTVIEWER_VIEWFRAME_H
21 #define QTVIEWER_VIEWFRAME_H
22 
23 #include "QtViewer.h"
24 
25 #include <SUIT_ViewWindow.h>
26 #include <QPainterPath>
27 
28 class QContextMenuEvent;
29 
30 class QAction;
31 
32 class SUIT_Desktop;
33 
34 class QtViewer_Viewer;
35 class QtViewer_ViewPort;
36 
37 /*
38  Class : QtViewer_ViewFrame
39  Description : View frame of the graphics view
40 */
42 {
43  Q_OBJECT
44 
45 public:
46  enum { DumpId, FitAllId, FitRectId, FitSelectId, ZoomId, PanId, GlobalPanId, ResetId };
47 
48 public:
51 
52  QtViewer_Viewer* getViewer() const { return myViewer; }
53  QtViewer_ViewPort* getViewPort() const { return myViewPort; }
54 
55  virtual QImage dumpView();
56 
57  virtual QString getVisualParameters();
58  virtual void setVisualParameters( const QString& theParameters );
59 
60 public slots:
61  virtual void showEvent( QShowEvent* );
62  virtual void hideEvent( QHideEvent* );
63 
64 protected slots:
65  void onViewPan();
66  void onViewZoom();
67  void onViewFitAll();
68  void onViewFitArea();
69  void onViewFitSelect();
70  void onViewGlobalPan();
71  void onViewReset();
72 
73 private slots:
74  void keyEvent( QKeyEvent* );
75  void mouseEvent( QMouseEvent* );
76  void wheelEvent( QWheelEvent* );
77  void contextMenuEvent( QContextMenuEvent* );
78 
79 signals:
80  void keyPressed( QKeyEvent* );
81  void keyReleased( QKeyEvent* );
82  void mousePressed( QMouseEvent* );
83  void mouseMoving( QMouseEvent* );
84  void mouseReleased( QMouseEvent* );
85  void mouseDoubleClicked( QMouseEvent* );
86  void wheeling( QWheelEvent* );
87 
88  void sketchingFinished( QPainterPath );
89 
90  void Show( QShowEvent* );
91  void Hide( QHideEvent* );
92 
93 protected:
94  virtual void createActions();
95  virtual void createToolBar();
96  virtual QString filter() const;
97  virtual bool dumpViewToFormat( const QImage&, const QString& fileName, const QString& format );
98 
99 private:
102 };
103 
104 #endif
#define QTVIEWER_API
Definition: QtViewer.h:29
Definition: QtViewer_ViewFrame.h:42
void mouseDoubleClicked(QMouseEvent *)
void mouseReleased(QMouseEvent *)
void Hide(QHideEvent *)
void wheeling(QWheelEvent *)
@ DumpId
Definition: QtViewer_ViewFrame.h:46
QtViewer_ViewPort * myViewPort
Definition: QtViewer_ViewFrame.h:101
QtViewer_Viewer * myViewer
Definition: QtViewer_ViewFrame.h:100
void sketchingFinished(QPainterPath)
void mouseMoving(QMouseEvent *)
QtViewer_ViewPort * getViewPort() const
Definition: QtViewer_ViewFrame.h:53
void keyReleased(QKeyEvent *)
void mousePressed(QMouseEvent *)
void keyPressed(QKeyEvent *)
QtViewer_Viewer * getViewer() const
Definition: QtViewer_ViewFrame.h:52
void Show(QShowEvent *)
Definition: QtViewer_ViewPort.h:34
Definition: QtViewer_Viewer.h:42
Definition: SUIT_Desktop.h:47
Definition: SUIT_ViewWindow.h:42
virtual void contextMenuEvent(QContextMenuEvent *)
Definition: SUIT_ViewWindow.cxx:150
bool dumpViewToFormat(const QString &fileName, const QString &format)
Definition: SUIT_ViewWindow.cxx:125
virtual void setVisualParameters(const QString &parameters)
Definition: SUIT_ViewWindow.cxx:259
virtual QString getVisualParameters()
Definition: SUIT_ViewWindow.cxx:250
virtual QImage dumpView()
Definition: SUIT_ViewWindow.cxx:92
virtual QString filter() const
Definition: SUIT_ViewWindow.cxx:175