Back to index

salome-gui  6.5.0
GLViewer_ViewFrame.h
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
00004 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
00005 //
00006 // This library is free software; you can redistribute it and/or
00007 // modify it under the terms of the GNU Lesser General Public
00008 // License as published by the Free Software Foundation; either
00009 // version 2.1 of the License.
00010 //
00011 // This library is distributed in the hope that it will be useful,
00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014 // Lesser General Public License for more details.
00015 //
00016 // You should have received a copy of the GNU Lesser General Public
00017 // License along with this library; if not, write to the Free Software
00018 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00019 //
00020 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00021 //
00022 
00023 //  Author : OPEN CASCADE
00024 // File:      GLViewer_ViewFrame.h
00025 // Created:   November, 2004
00026 //
00027 #ifndef GLVIEWER_VIEWFRAME_H
00028 #define GLVIEWER_VIEWFRAME_H
00029 
00030 #include "SUIT_ViewWindow.h"
00031 #include "GLViewer.h"
00032 
00033 class QColor;
00034 
00035 class SUIT_Desktop;
00036 
00037 class GLViewer_Viewer;
00038 class GLViewer_ViewPort;
00039 
00040 #include <QtxAction.h>
00041 
00042 #ifdef WIN32
00043 #pragma warning( disable:4251 )
00044 #endif
00045 
00051 class GLVIEWER_API GLViewer_ViewFrame: public SUIT_ViewWindow
00052 {
00053   Q_OBJECT
00054 
00055 public:
00057   enum { DumpId, FitAllId, FitRectId, FitSelectId, ZoomId, PanId, GlobalPanId, ResetId };
00058 
00059 public:
00060   GLViewer_ViewFrame( SUIT_Desktop* , GLViewer_Viewer* );
00061   ~GLViewer_ViewFrame();
00062 
00063 public:
00064   void                    setViewer( GLViewer_Viewer* );
00065   GLViewer_Viewer*        getViewer() const;
00066 
00067   void                    setViewPort( GLViewer_ViewPort* );
00068   GLViewer_ViewPort*      getViewPort() const;
00069 
00070   void                    setBackgroundColor( const QColor& );
00071   QColor                  backgroundColor() const;
00072 
00073   QSize                   sizeHint() const;
00074 
00075   virtual void            onUpdate( int );
00076 
00077   virtual QString         getVisualParameters();
00078   virtual void            setVisualParameters( const QString& parameters );
00079 
00080   virtual QImage          dumpView();
00081 
00082 signals:
00083   void                    vfDrawExternal( QPainter* );
00084   void                    vfViewClosing( QCloseEvent* );
00085 
00086 protected:
00087   GLViewer_Viewer*        myViewer;
00088   GLViewer_ViewPort*      myVP;
00089 
00090 public:
00091   //ViewType       getTypeView() const { return VIEW_GL; };
00092   QWidget*       getViewWidget() { return ( QWidget* )getViewPort(); };
00093 
00094 protected slots:
00095   void           onViewPan();
00096   void           onViewZoom();
00097   void           onViewFitAll();
00098   void           onViewFitArea();
00099   void           onViewFitSelect();
00100   void           onViewGlobalPan();
00101   void           onViewRotate();
00102   void           onViewReset();
00103   void           onViewFront() {};
00104   void           onViewBack() {};
00105   void           onViewRight() {};
00106   void           onViewLeft() {};
00107   void           onViewBottom() {};
00108   void           onViewTop() {};
00109   void           onViewTrihedron() {};
00110 
00111 private slots:
00112   void           keyEvent( QKeyEvent* );
00113   void           mouseEvent( QMouseEvent* );
00114   void           wheelEvent( QWheelEvent* );
00115 
00116 private:
00117   void           createActions();
00118   void           createToolBar();
00119 };
00120 
00121 
00122 #ifdef WIN32
00123 #pragma warning ( default:4251 )
00124 #endif
00125 
00126 #endif