1 // SALOME VTKViewer : build VTK viewer into Salome desktop
3 // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
29 #include "SVTK_GenericRenderWindowInteractor.h"
30 #include "SVTK_Selector.h"
32 #include <vtkObjectFactory.h>
33 #include <vtkCommand.h>
39 vtkStandardNewMacro(QVTK_GenericRenderWindowInteractor);
44 QVTK_GenericRenderWindowInteractor
45 ::QVTK_GenericRenderWindowInteractor()
47 myTimer = new QTimer( ) ;
48 connect(myTimer, SIGNAL(timeout()), this, SLOT(OnTimeOut())) ;
54 QVTK_GenericRenderWindowInteractor
55 ::~QVTK_GenericRenderWindowInteractor()
61 The slot connects to QTimer::timeout signal to invoke vtkCommand::TimerEvent
64 QVTK_GenericRenderWindowInteractor
68 this->InvokeEvent(vtkCommand::TimerEvent,NULL);
73 Starts the QTimer instance on defined microseconds
76 QVTK_GenericRenderWindowInteractor
77 ::CreateTimer(int vtkNotUsed(timertype))
80 // Start a one-shot timer for <DELAY> ms.
83 myTimer->start(DELAY,TRUE);
88 Stops the QTimer instance
91 QVTK_GenericRenderWindowInteractor
95 // :TRICKY: Tue May 2 00:17:32 2000 Pagey
97 // QTimer will automatically expire after 10ms. So
98 // we do not need to do anything here. In fact, we
99 // should not even Stop() the QTimer here because doing
100 // this will skip some of the processing that the TimerFunc()
101 // does and will result in undesirable effects. For
102 // example, this will result in vtkLODActor to leave
103 // the models in low-res mode after the mouse stops
110 vtkStandardNewMacro(SVTK_GenericRenderWindowInteractor);
115 SVTK_GenericRenderWindowInteractor
116 ::SVTK_GenericRenderWindowInteractor():
124 SVTK_GenericRenderWindowInteractor
125 ::~SVTK_GenericRenderWindowInteractor()
130 To get access to SVTK_Selector
133 SVTK_GenericRenderWindowInteractor
136 return mySelector.GetPointer();
140 To initialize mySelector field
141 \param theSelector - new selector
144 SVTK_GenericRenderWindowInteractor
145 ::SetSelector(SVTK_Selector* theSelector)
147 mySelector = theSelector;
151 To get access to QWidget, where vtkRenderWindow maps to.
154 SVTK_GenericRenderWindowInteractor
157 return myRenderWidget;
161 To initialize myRenderWidget field.
164 SVTK_GenericRenderWindowInteractor
165 ::SetRenderWidget(QWidget* theRenderWidget)
167 myRenderWidget = theRenderWidget;