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