Salome HOME
studyActivated() virtual method has been added
[modules/gui.git] / src / GLViewer / GLViewer_ViewFrame.h
1 // File:      GLViewer_ViewFrame.h
2 // Created:   November, 2004
3 // Author:    OCC team
4 // Copyright (C) CEA 2004
5
6 /***************************************************************************
7 **  Class:   GLViewer_ViewFrame
8 **  Descr:   Frame window for viewport in QAD-based application
9 **  Module:  QAD
10 **  Created: UI team, 05.09.00
11 ****************************************************************************/
12 #ifndef GLVIEWER_VIEWFRAME_H
13 #define GLVIEWER_VIEWFRAME_H
14
15 #include "SUIT_ViewWindow.h"
16 #include "GLViewer.h"
17
18 class QColor;
19
20 class SUIT_Desktop;
21 class QtxAction;
22 class GLViewer_Viewer;
23 class GLViewer_ViewPort;
24
25 #ifdef WNT
26 #pragma warning( disable:4251 )
27 #endif
28
29 class GLVIEWER_EXPORT GLViewer_ViewFrame: public SUIT_ViewWindow
30 {
31   Q_OBJECT
32     
33 public:
34   GLViewer_ViewFrame( SUIT_Desktop* , GLViewer_Viewer* );
35   ~GLViewer_ViewFrame();
36   
37 public:
38   void                    setViewer( GLViewer_Viewer* );
39   GLViewer_Viewer*        getViewer() const;
40   
41   void                    setViewPort( GLViewer_ViewPort* );
42   GLViewer_ViewPort*      getViewPort() const;
43   
44   void                    setBackgroundColor( const QColor& );
45   QColor                  backgroundColor() const;
46   
47   QSize                   sizeHint() const;
48   
49   virtual void            onUpdate( int );
50   
51 signals:
52   void                    vfDrawExternal( QPainter* );
53   void                    vfViewClosing( QCloseEvent* );
54   
55 protected:
56   GLViewer_Viewer*        myViewer;
57   GLViewer_ViewPort*      myVP;
58   
59 protected:
60   QImage dumpView();
61
62 public:
63   //ViewType       getTypeView() const { return VIEW_GL; }; 
64   QWidget*       getViewWidget() { return ( QWidget* )getViewPort(); };
65   
66 protected slots:
67   void           onViewPan();
68   void           onViewZoom();
69   void           onViewFitAll();
70   void           onViewFitArea();
71   void           onViewFitSelect();
72   void           onViewGlobalPan(); 
73   void           onViewRotate();
74   void           onViewReset();
75   void           onViewFront() {}; 
76   void           onViewBack() {}; 
77   void           onViewRight() {}; 
78   void           onViewLeft() {};     
79   void           onViewBottom() {};
80   void           onViewTop() {};
81   void           onViewTrihedron() {}; 
82   
83 private slots:
84   void           keyEvent( QKeyEvent* );
85   void           mouseEvent( QMouseEvent* );
86   void           wheelEvent( QWheelEvent* );
87   
88 private:
89   void           createActions();
90   void           createToolBar();
91   
92 private:
93   enum { DumpId, FitAllId, FitRectId, FitSelectId, ZoomId, PanId, GlobalPanId, ResetId };
94   typedef QMap<int, QtxAction*> ActionsMap;
95   
96 private:
97   ActionsMap       myActionsMap;
98   QToolBar*        myToolBar;
99 };
100
101
102 #ifdef WNT
103 #pragma warning ( default:4251 )
104 #endif
105
106 #endif