Open Inventor Release 2024.1.3
 
Loading...
Searching...
No Matches
SoQtSensorHandler.h
1/*=======================================================================
2 *** THE CONTENT OF THIS WORK IS PROPRIETARY TO FEI S.A.S, (FEI S.A.S.), ***
3 *** AND IS DISTRIBUTED UNDER A LICENSE AGREEMENT. ***
4 *** ***
5 *** REPRODUCTION, DISCLOSURE, OR USE, IN WHOLE OR IN PART, OTHER THAN AS ***
6 *** SPECIFIED IN THE LICENSE ARE NOT TO BE UNDERTAKEN EXCEPT WITH PRIOR ***
7 *** WRITTEN AUTHORIZATION OF FEI S.A.S. ***
8 *** ***
9 *** RESTRICTED RIGHTS LEGEND ***
10 *** USE, DUPLICATION, OR DISCLOSURE BY THE GOVERNMENT OF THE CONTENT OF THIS ***
11 *** WORK OR RELATED DOCUMENTATION IS SUBJECT TO RESTRICTIONS AS SET FORTH IN ***
12 *** SUBPARAGRAPH (C)(1) OF THE COMMERCIAL COMPUTER SOFTWARE RESTRICTED RIGHT ***
13 *** CLAUSE AT FAR 52.227-19 OR SUBPARAGRAPH (C)(1)(II) OF THE RIGHTS IN ***
14 *** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 52.227-7013. ***
15 *** ***
16 *** COPYRIGHT (C) 1996-2017 BY FEI S.A.S, ***
17 *** BORDEAUX, FRANCE ***
18 *** ALL RIGHTS RESERVED ***
19**=======================================================================*/
20/*=======================================================================
21** Author : VSG (MMM YYYY)
22**=======================================================================*/
23
24#include <Inventor/Qt/OivQtCompat.h>
25#include <Inventor/SbBasic.h>
26#include <Inventor/SbTime.h>
27
28#include <QObject>
29#include <QPointer>
30
31class QTimer;
32class SoTimerThread;
33
38{
39 Q_OBJECT
40
41 public:
42 SoQtSensorHandler();
43 ~SoQtSensorHandler();
44
45 protected Q_SLOTS:
46 void processNextTimerSensor();
47 void processNextDelaySensor();
48 void processNextDelaySensorTimeout();
49
50 private:
51
52 // Callback for changes to the sensor manager
53 static void sensorManagerChangedCallback(void *data);
54
55 void setUpPendingTimers();
56 void setUpTimerSensor();
57 void setUpDelaySensor();
58 void setUpDelaySensorTimeout();
59
60 // Allows timer thread to post timeout events
61 void customEvent( );
62
63 QPointer<QTimer> timedSensorTimer;
64 QPointer<QTimer> delaySensorTimer;
65 QPointer<QTimer> delaySensorTimeout;
66
67 // Internal class for managing timer in separate thread
68 SoTimerThread *m_timerThread;
69
70 // Internal deadline to decide if we have to reschedule or not the sensor
71 SbTime currentDeadLine;
72};
73
74
Class for representation of a time.
Definition SbTime.h:91