Back to index

salome-gui  6.5.0
VTKViewer_RenderWindow.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 #ifndef VTKVIEWER_RENDERWINDOW_H
00024 #define VTKVIEWER_RENDERWINDOW_H
00025 
00026 #include "VTKViewer.h"
00027 
00028 #include <vtkRenderWindow.h>
00029 
00030 #include <QWidget>
00031 
00032 class VTKVIEWER_EXPORT VTKViewer_RenderWindow : public QWidget 
00033 {
00034   Q_OBJECT 
00035 
00036 public:
00037   /* popup management */
00038   //void                     onCreatePopup();
00039 
00040 //  const char *GetClassName() {return "VTKViewer_RenderWindow";};
00041 
00042 public:
00043   VTKViewer_RenderWindow(QWidget *parent, const char *name);
00044   virtual ~VTKViewer_RenderWindow() ;
00045   
00047   vtkRenderWindow* getRenderWindow() { return myRW; }
00048 
00049   virtual QPaintEngine* paintEngine() const;
00050 
00051  protected:
00052   virtual void mouseMoveEvent( QMouseEvent* );
00053   virtual void mousePressEvent( QMouseEvent* );
00054   virtual void mouseReleaseEvent( QMouseEvent* );
00055   virtual void mouseDoubleClickEvent( QMouseEvent* );
00056   virtual void wheelEvent( QWheelEvent* );
00057   virtual void keyPressEvent( QKeyEvent* );
00058   virtual void keyReleaseEvent( QKeyEvent* );
00059   virtual void paintEvent( QPaintEvent* );
00060   virtual void resizeEvent( QResizeEvent* );
00061   virtual void onChangeBackgroundColor();
00062   virtual void contextMenuEvent( QContextMenuEvent * e );
00063 
00064  signals:
00066   void MouseMove( QMouseEvent* );
00068   void MouseButtonPressed( QMouseEvent* );
00070   void MouseButtonReleased( QMouseEvent* );
00072   void MouseDoubleClicked( QMouseEvent* );
00074   void WheelMoved( QWheelEvent* );
00076   void LeftButtonPressed(const QMouseEvent *event) ;
00078   void LeftButtonReleased(const QMouseEvent *event) ;
00080   void MiddleButtonPressed(const QMouseEvent *event) ;
00082   void MiddleButtonReleased(const QMouseEvent *event) ;
00084   void RightButtonPressed(const QMouseEvent *event) ;
00086   void RightButtonReleased(const QMouseEvent *event) ;
00087   
00089   void ButtonPressed(const QMouseEvent *event);
00091   void ButtonReleased(const QMouseEvent *event);
00093   void KeyPressed( QKeyEvent* );
00095   void KeyReleased( QKeyEvent* );
00097   void contextMenuRequested( QContextMenuEvent *e );
00098 
00099  protected:
00100   vtkRenderWindow* myRW;
00101 };
00102 
00103 #endif