]> SALOME platform Git repositories - modules/gui.git/blob - src/GLViewer/GLViewer_ViewFrame.h
Salome HOME
*** empty log message ***
[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
22 class GLViewer_Viewer;
23 class GLViewer_ViewPort;
24
25 #include <qaction.h>
26
27 #ifdef WNT
28 #pragma warning( disable:4251 )
29 #endif
30
31 class GLVIEWER_API GLViewer_ViewFrame: public SUIT_ViewWindow
32 {
33   Q_OBJECT
34     
35 public:
36   GLViewer_ViewFrame( SUIT_Desktop* , GLViewer_Viewer* );
37   ~GLViewer_ViewFrame();
38   
39 public:
40   void                    setViewer( GLViewer_Viewer* );
41   GLViewer_Viewer*        getViewer() const;
42   
43   void                    setViewPort( GLViewer_ViewPort* );
44   GLViewer_ViewPort*      getViewPort() const;
45   
46   void                    setBackgroundColor( const QColor& );
47   QColor                  backgroundColor() const;
48   
49   QSize                   sizeHint() const;
50   
51   virtual void            onUpdate( int );
52   
53 signals:
54   void                    vfDrawExternal( QPainter* );
55   void                    vfViewClosing( QCloseEvent* );
56   
57 protected:
58   GLViewer_Viewer*        myViewer;
59   GLViewer_ViewPort*      myVP;
60   
61 public:
62   //ViewType       getTypeView() const { return VIEW_GL; }; 
63   QWidget*       getViewWidget() { return ( QWidget* )getViewPort(); };
64   
65 protected slots:
66   void           onViewDump();
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, QAction*> 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