Version: 9.12.0
Plot2d_ViewWindow.h
Go to the documentation of this file.
1 // Copyright (C) 2007-2023 CEA, EDF, OPEN CASCADE
2 //
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License, or (at your option) any later version.
10 //
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
15 //
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 //
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22 
23 // File : Plot2d_ViewWindow.h
24 // Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
25 //
26 #ifndef PLOT2D_VIEWWINDOW_H
27 #define PLOT2D_VIEWWINDOW_H
28 
29 #include "Plot2d.h"
30 #include <SUIT_ViewWindow.h>
31 #include <QMap>
32 
33 
34 #ifdef WIN32
35 #pragma warning( disable:4251 )
36 #endif
37 
38 class SUIT_Desktop;
39 class Plot2d_Viewer;
40 class Plot2d_ViewFrame;
41 class QtxAction;
42 class QImage;
43 class QMenu;
44 class QToolBar;
45 
47 {
48  Q_OBJECT
49 
50 public:
51  enum { DumpId,
52  ScaleOpId, FitAllId, FitRectId, ZoomId,
53  MoveOpId, PanId, GlobalPanId,
54  PModeXLinearId, PModeXLogarithmicId,
55  PModeYLinearId, PModeYLogarithmicId,
56  PModeNormLMaxId, PModeNormLMinId,
57  PModeNormRMaxId, PModeNormRMinId,
58  CurvPointsId, CurvLinesId, CurvSplinesId,
61  CloneId, PrintId,
62  AnalyticalCurveId };
63 
64 public:
66  virtual ~Plot2d_ViewWindow();
67 
68  Plot2d_Viewer* getModel();
69  void putInfo( const QString&);
70  Plot2d_ViewFrame* getViewFrame();
71  QToolBar* getToolBar();
72  virtual void initLayout();
73  void contextMenuPopup( QMenu* );
74 
75  virtual bool eventFilter( QObject*, QEvent* );
76 
77  void createActions();
78  void createToolBar();
79 
80  virtual QString getVisualParameters();
81  virtual void setVisualParameters( const QString& );
82 
83  virtual void RefreshDumpImage();
84 
85 public slots:
86  void onChangeHorMode();
87  void onChangeVerMode();
88  void onChangeCurveMode();
89  void onChangeLegendMode();
90  void onChangeNormLMode();
91  void onChangeNormRMode();
92 
93 
94  void onFitAll();
95  void onFitRect();
96  void onZoom();
97  void onPanning();
98  void onGlobalPanning();
99  void onViewHorMode();
100  void onViewVerMode();
101  void onViewNormLMode();
102  void onViewNormRMode();
103  void onLegend();
104  void onCurves();
105 
106  void onDumpView();
107  void onPrintView();
108 
109 protected:
110  virtual QImage dumpView();
111  virtual bool dumpViewToFormat( const QImage&,
112  const QString&,
113  const QString& );
114  virtual QString filter() const;
115 
116 signals:
117  void cloneView();
118 
119 private:
123  QImage myDumpImage;
124 };
125 
126 #ifdef WIN32
127 #pragma warning( default:4251 )
128 #endif
129 
130 #endif // PLOT2D_VIEWWINDOW_H
#define PLOT2D_EXPORT
Definition: Plot2d.h:36
Definition: Plot2d_ViewFrame.h:67
Plot2d view window.
Definition: Plot2d_ViewWindow.h:47
@ CurvSettingsId
Definition: Plot2d_ViewWindow.h:60
@ GlobalPanId
Definition: Plot2d_ViewWindow.h:53
@ CurvLinesId
Definition: Plot2d_ViewWindow.h:58
@ PModeNormRMaxId
Definition: Plot2d_ViewWindow.h:57
@ PModeYLinearId
Definition: Plot2d_ViewWindow.h:55
@ FitAllId
Definition: Plot2d_ViewWindow.h:52
@ LegendId
Definition: Plot2d_ViewWindow.h:59
@ DumpId
Definition: Plot2d_ViewWindow.h:51
@ PModeNormLMaxId
Definition: Plot2d_ViewWindow.h:56
@ CloneId
Definition: Plot2d_ViewWindow.h:61
@ PModeXLinearId
Definition: Plot2d_ViewWindow.h:54
Plot2d_ViewFrame * myViewFrame
Definition: Plot2d_ViewWindow.h:121
void cloneView()
Emitted when the "Clone View" action is activated.
QImage myDumpImage
Definition: Plot2d_ViewWindow.h:123
Plot2d_Viewer * myModel
Definition: Plot2d_ViewWindow.h:120
int myToolBar
Definition: Plot2d_ViewWindow.h:122
Definition: Plot2d_ViewModel.h:38
For more information see QT documentation.
Definition: SUIT_Application.h:42
Generic action class.
Definition: QtxAction.h:40
Definition: SUIT_Desktop.h:47
Definition: SUIT_ViewWindow.h:42
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
virtual void onDumpView()
Definition: SUIT_ViewWindow.cxx:165