Salome HOME
Initial version
[modules/gui.git] / src / Plot2d / Plot2d_ViewWindow.h
1 #ifndef PLOT2D_VIEWWINDOW_H
2 #define PLOT2D_VIEWWINDOW_H
3
4 #include "Plot2d.h"
5
6 #include "Plot2d_ViewModel.h"
7 #include "Plot2d_ViewFrame.h"
8
9 #include <SUIT_Desktop.h>
10 #include <SUIT_ViewWindow.h>
11 #include <SUIT_ToolButton.h>
12
13 #include <QtxAction.h>
14
15 #include <qstring.h>
16 #include <qstring.h>
17 #include <qtoolbar.h>
18 #include <qpopupmenu.h>
19
20 #ifdef WIN32
21 #pragma warning( disable:4251 )
22 #endif
23
24 class PLOT2D_EXPORT Plot2d_ViewWindow : public SUIT_ViewWindow  
25 {
26   Q_OBJECT
27
28 public:
29   Plot2d_ViewWindow( SUIT_Desktop* theDesktop, Plot2d_Viewer* theModel );
30   virtual ~Plot2d_ViewWindow();
31
32   Plot2d_Viewer*    getModel() { return myModel; }
33   void              putInfo(QString theMsg);
34   Plot2d_ViewFrame* getViewFrame() { return myViewFrame; };
35   QToolBar*         getToolBar() { return myToolBar; };
36   void              contextMenuPopup( QPopupMenu* thePopup );
37
38 private:
39   bool eventFilter(QObject* watched, QEvent* e);
40
41   void createActions();
42   void createToolBar();
43
44 public slots:
45   void onChangeHorMode();
46   void onChangeVerMode();
47   void onChangeCurveMode();
48   void onChangeLegendMode();
49   
50   void onDumpView();
51   void onFitAll();
52   void onFitRect();
53   void onZoom();
54   void onPanning();
55   void onGlobalPanning();
56   void onViewHorMode();
57   void onViewVerMode();
58   void onLegend();
59   void onCurves();
60
61 signals:
62   void cloneView();
63
64 protected:
65   enum { DumpId, FitAllId, FitRectId, ZoomId, PanId, GlobalPanId, HorId,
66          VerId, LegendId, CurvPointsId, CurvLinesId, CurvSplinesId, CurvSettingsId, CloneId,
67          PModeXLinearId, PModeXLogarithmicId, PModeYLinearId, PModeYLogarithmicId };
68   typedef QMap<int, QtxAction*> ActionsMap;
69   ActionsMap        myActionsMap;
70
71 private:
72   Plot2d_Viewer*    myModel;
73   Plot2d_ViewFrame* myViewFrame;
74   QToolBar*         myToolBar;
75
76   SUIT_ToolButton*  myCurveBtn;
77 };
78
79 #ifdef WIN32
80 #pragma warning( default:4251 )
81 #endif
82
83 #endif