1 // Copyright (C) 2005 OPEN CASCADE
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.
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.
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
17 // See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
19 // Author : OPEN CASCADE
22 // File: GLViewer_ViewFrame.h
23 // Created: November, 2004
25 /***************************************************************************
26 ** Class: GLViewer_ViewFrame
27 ** Descr: Frame window for viewport in QAD-based application
29 ** Created: UI team, 05.09.00
30 ****************************************************************************/
31 #ifndef GLVIEWER_VIEWFRAME_H
32 #define GLVIEWER_VIEWFRAME_H
34 #include "SUIT_ViewWindow.h"
41 class GLViewer_Viewer;
42 class GLViewer_ViewPort;
47 #pragma warning( disable:4251 )
50 /*! Class GLViewer_ViewFrame
51 * Frame window for viewport in GLViewer
54 class GLVIEWER_API GLViewer_ViewFrame: public SUIT_ViewWindow
59 GLViewer_ViewFrame( SUIT_Desktop* , GLViewer_Viewer* );
60 ~GLViewer_ViewFrame();
63 void setViewer( GLViewer_Viewer* );
64 GLViewer_Viewer* getViewer() const;
66 void setViewPort( GLViewer_ViewPort* );
67 GLViewer_ViewPort* getViewPort() const;
69 void setBackgroundColor( const QColor& );
70 QColor backgroundColor() const;
72 QSize sizeHint() const;
74 virtual void onUpdate( int );
76 virtual QString getVisualParameters();
77 virtual void setVisualParameters( const QString& parameters );
80 void vfDrawExternal( QPainter* );
81 void vfViewClosing( QCloseEvent* );
84 GLViewer_Viewer* myViewer;
85 GLViewer_ViewPort* myVP;
88 //ViewType getTypeView() const { return VIEW_GL; };
89 QWidget* getViewWidget() { return ( QWidget* )getViewPort(); };
97 void onViewFitSelect();
98 void onViewGlobalPan();
101 void onViewFront() {};
102 void onViewBack() {};
103 void onViewRight() {};
104 void onViewLeft() {};
105 void onViewBottom() {};
107 void onViewTrihedron() {};
110 void keyEvent( QKeyEvent* );
111 void mouseEvent( QMouseEvent* );
112 void wheelEvent( QWheelEvent* );
115 void createActions();
116 void createToolBar();
120 enum { DumpId, FitAllId, FitRectId, FitSelectId, ZoomId, PanId, GlobalPanId, ResetId };
121 typedef QMap<int, QAction*> ActionsMap;
124 ActionsMap myActionsMap;
130 #pragma warning ( default:4251 )