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 #ifndef GLVIEWER_VIEWFRAME_H
26 #define GLVIEWER_VIEWFRAME_H
28 #include "SUIT_ViewWindow.h"
35 class GLViewer_Viewer;
36 class GLViewer_ViewPort;
41 #pragma warning( disable:4251 )
45 \class GLViewer_ViewFrame
46 Frame window for viewport in QAD-based application
49 class GLVIEWER_API GLViewer_ViewFrame: public SUIT_ViewWindow
54 GLViewer_ViewFrame( SUIT_Desktop* , GLViewer_Viewer* );
55 ~GLViewer_ViewFrame();
58 void setViewer( GLViewer_Viewer* );
59 GLViewer_Viewer* getViewer() const;
61 void setViewPort( GLViewer_ViewPort* );
62 GLViewer_ViewPort* getViewPort() const;
64 void setBackgroundColor( const QColor& );
65 QColor backgroundColor() const;
67 QSize sizeHint() const;
69 virtual void onUpdate( int );
71 virtual QString getVisualParameters();
72 virtual void setVisualParameters( const QString& parameters );
75 void vfDrawExternal( QPainter* );
76 void vfViewClosing( QCloseEvent* );
79 GLViewer_Viewer* myViewer;
80 GLViewer_ViewPort* myVP;
83 //ViewType getTypeView() const { return VIEW_GL; };
84 QWidget* getViewWidget() { return ( QWidget* )getViewPort(); };
92 void onViewFitSelect();
93 void onViewGlobalPan();
96 void onViewFront() {};
98 void onViewRight() {};
100 void onViewBottom() {};
102 void onViewTrihedron() {};
105 void keyEvent( QKeyEvent* );
106 void mouseEvent( QMouseEvent* );
107 void wheelEvent( QWheelEvent* );
110 void createActions();
111 void createToolBar();
115 enum { DumpId, FitAllId, FitRectId, FitSelectId, ZoomId, PanId, GlobalPanId, ResetId };
116 typedef QMap<int, QAction*> ActionsMap;
119 ActionsMap myActionsMap;
125 #pragma warning ( default:4251 )