]> SALOME platform Git repositories - modules/gui.git/blob - src/Plot2d/Plot2d_ViewWindow.h
Salome HOME
ec0e5bf64d363c4639d43461651b0e8d8d45174b
[modules/gui.git] / src / Plot2d / Plot2d_ViewWindow.h
1 // Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
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.
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/
18 //
19 #ifndef PLOT2D_VIEWWINDOW_H
20 #define PLOT2D_VIEWWINDOW_H
21
22 #include "Plot2d.h"
23 #include <SUIT_ViewWindow.h>
24
25 #ifdef WIN32
26 #pragma warning( disable:4251 )
27 #endif
28
29 class SUIT_Desktop;
30 class Plot2d_Viewer;
31 class Plot2d_ViewFrame;
32 class QtxAction;
33 class SUIT_ToolButton;
34
35 class PLOT2D_EXPORT Plot2d_ViewWindow : public SUIT_ViewWindow  
36 {
37   Q_OBJECT
38
39 public:
40   Plot2d_ViewWindow( SUIT_Desktop* theDesktop, Plot2d_Viewer* theModel );
41   virtual ~Plot2d_ViewWindow();
42
43   Plot2d_Viewer*    getModel() { return myModel; }
44   void              putInfo(QString theMsg);
45   Plot2d_ViewFrame* getViewFrame() { return myViewFrame; };
46   QToolBar*         getToolBar() { return myToolBar; };
47   void              contextMenuPopup( QPopupMenu* thePopup );
48
49   virtual QString   getVisualParameters();
50   virtual void      setVisualParameters( const QString& parameters );
51
52 protected:
53   virtual QImage    dumpView();
54   virtual QString   filter() const;
55   virtual bool      dumpViewToFormat( const QString& fileName, const QString& format );
56
57 private:
58   bool eventFilter(QObject* watched, QEvent* e);
59
60   void createActions();
61   void createToolBar();
62
63 public slots:
64   void onChangeHorMode();
65   void onChangeVerMode();
66   void onChangeCurveMode();
67   void onChangeLegendMode();
68   
69   void onFitAll();
70   void onFitRect();
71   void onZoom();
72   void onPanning();
73   void onGlobalPanning();
74   void onViewHorMode();
75   void onViewVerMode();
76   void onLegend();
77   void onCurves();
78
79   void onDumpView();
80
81 signals:
82   void cloneView();
83
84 protected:
85   enum { DumpId, FitAllId, FitRectId, ZoomId, PanId, GlobalPanId, HorId,
86          VerId, LegendId, CurvPointsId, CurvLinesId, CurvSplinesId, CurvSettingsId, CloneId,
87          PModeXLinearId, PModeXLogarithmicId, PModeYLinearId, PModeYLogarithmicId };
88   typedef QMap<int, QtxAction*> ActionsMap;
89   ActionsMap        myActionsMap;
90
91 private:
92   Plot2d_Viewer*    myModel;
93   Plot2d_ViewFrame* myViewFrame;
94   QToolBar*         myToolBar;
95
96   SUIT_ToolButton*  myCurveBtn;
97 };
98
99 #ifdef WIN32
100 #pragma warning( default:4251 )
101 #endif
102
103 #endif