Back to index

salome-gui  6.5.0
SVTK_GenericRenderWindowInteractor.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 //  SALOME VTKViewer : build VTK viewer into Salome desktop
00024 //  File   : 
00025 //  Author : 
00026 
00027 #ifndef SVTK_GenericRenderWindowInteractor_h
00028 #define SVTK_GenericRenderWindowInteractor_h
00029 
00030 #include "SVTK.h"
00031 
00032 #include <QObject>
00033 #include <vtkGenericRenderWindowInteractor.h>
00034 #include <vtkSmartPointer.h>
00035 
00036 class QTimer;
00037 class QWidget;
00038 
00039 class SVTK_Selector;
00040 //class SVTK_Renderer;
00041 
00042 #ifdef WIN32
00043 #pragma warning ( disable:4251 )
00044 #endif
00045 
00057 class SVTK_EXPORT QVTK_GenericRenderWindowInteractor: 
00058  public QObject,
00059  public vtkGenericRenderWindowInteractor
00060 {
00061   Q_OBJECT;
00062 
00063  public:
00064   static QVTK_GenericRenderWindowInteractor* New();
00065   vtkTypeMacro(QVTK_GenericRenderWindowInteractor,vtkGenericRenderWindowInteractor);
00066 
00068   virtual
00069   int
00070   CreateTimer( int ) ; 
00071 
00073   virtual
00074   int
00075   DestroyTimer() ; 
00076 
00077  protected slots:
00079   void
00080   OnTimeOut();
00081 
00082  protected:
00083   QVTK_GenericRenderWindowInteractor(); 
00084   ~QVTK_GenericRenderWindowInteractor(); 
00085 
00086   QTimer* myTimer; 
00087 };
00088 
00089 
00097 class SVTK_EXPORT SVTK_GenericRenderWindowInteractor: public QVTK_GenericRenderWindowInteractor
00098 {
00099  public:
00100   static SVTK_GenericRenderWindowInteractor* New();
00101   vtkTypeMacro(SVTK_GenericRenderWindowInteractor,QVTK_GenericRenderWindowInteractor);
00102 
00104   SVTK_Selector* 
00105   GetSelector(); 
00106 
00108   void
00109   SetSelector(SVTK_Selector* theSelector);
00110 
00112   QWidget*
00113   GetRenderWidget();
00114 
00116   void
00117   SetRenderWidget(QWidget* theRenderWidget);
00118 
00119  protected:
00120   SVTK_GenericRenderWindowInteractor();
00121   ~SVTK_GenericRenderWindowInteractor();
00122 
00123   SVTK_Selector* mySelector; 
00124   QWidget* myRenderWidget; 
00125 };
00126 
00127 #ifdef WIN32
00128 #pragma warning ( default:4251 )
00129 #endif
00130 
00131 #endif