Coin Logo http://www.sim.no
http://www.coin3d.org

SoSensorManager.h
1 #ifndef COIN_SOSENSORMANAGER_H
2 #define COIN_SOSENSORMANAGER_H
3 
4 /**************************************************************************\
5  *
6  * This file is part of the Coin 3D visualization library.
7  * Copyright (C) 1998-2007 by Systems in Motion. All rights reserved.
8  *
9  * This library is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU General Public License
11  * ("GPL") version 2 as published by the Free Software Foundation.
12  * See the file LICENSE.GPL at the root directory of this source
13  * distribution for additional information about the GNU GPL.
14  *
15  * For using Coin with software that can not be combined with the GNU
16  * GPL, and for taking advantage of the additional benefits of our
17  * support services, please contact Systems in Motion about acquiring
18  * a Coin Professional Edition License.
19  *
20  * See http://www.coin3d.org/ for more information.
21  *
22  * Systems in Motion, Postboks 1283, Pirsenteret, 7462 Trondheim, NORWAY.
23  * http://www.sim.no/ sales@sim.no coin-support@coin3d.org
24  *
25 \**************************************************************************/
26 
27 #include <Inventor/SbBasic.h>
28 
29 class SoDelayQueueSensor;
30 class SoTimerQueueSensor;
31 class SoTimerSensor;
32 class SbTime;
33 
34 class COIN_DLL_API SoSensorManager {
35 public:
36  SoSensorManager(void);
37  ~SoSensorManager();
38 
39  void insertDelaySensor(SoDelayQueueSensor * s);
40  void insertTimerSensor(SoTimerQueueSensor * s);
41  void removeDelaySensor(SoDelayQueueSensor * s);
42  void removeTimerSensor(SoTimerQueueSensor * s);
43 
44  void setChangedCallback(void (*sensorQueueChangedCB)(void *), void * data);
45 
46  void rescheduleTimer(SoTimerSensor * s);
47  void removeRescheduledTimer(SoTimerQueueSensor * s);
48 
49  void processDelayQueue(SbBool isidle);
50  void processImmediateQueue(void);
51  void processTimerQueue(void);
52 
53  SbBool isDelaySensorPending(void);
54  SbBool isTimerSensorPending(SbTime & tm);
55 
56  void setDelaySensorTimeout(const SbTime & t);
57  const SbTime & getDelaySensorTimeout(void);
58 
59  int doSelect(int nfds, void * readfds, void * writefds,
60  void * exceptfds, struct timeval * userTimeOut);
61 
62 private:
63  void notifyChanged(void);
64 
65  int mergeTimerQueues(void);
66  int mergeDelayQueues(void);
67 
68  class SoSensorManagerP * pimpl;
69  friend class SoSensorManagerP;
70 };
71 
72 #endif // !COIN_SOSENSORMANAGER_H
The SoDelayQueueSensor class is the abstract base class for priority scheduled sensors.Delay queue sensors are invoked upon various events not related to time occurrences. See documentation of subclasses to see which types of events can be surveilled by the builtin sensor types.
Definition: SoDelayQueueSensor.h:31
The SoTimerQueueSensor class is the abstract base class for sensors triggering on certain timer event...
Definition: SoTimerQueueSensor.h:30
The SoTimerSensor class is a sensor which will trigger at given intervals.Use sensors of this class w...
Definition: SoTimerSensor.h:29
The SbTime class instances represents time values.SbTime is a convenient way of doing system independ...
Definition: SbTime.h:41
The SoSensorManager class handles the sensor queues.There are two major sensor types in Coin...
Definition: SoSensorManager.h:34

Copyright © 1998-2007 by Systems in Motion AS. All rights reserved.

Generated on Fri Jul 20 2018 for Coin by Doxygen. 1.8.14