Open Inventor Reference
SoAlarmSensor.h
Go to the documentation of this file.
1/*
2 *
3 * Copyright (C) 2000 Silicon Graphics, Inc. All Rights Reserved.
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * Further, this software is distributed without any warranty that it is
16 * free of the rightful claim of any third person regarding infringement
17 * or the like. Any license provided herein, whether implied or
18 * otherwise, applies only to this software file. Patent licenses, if
19 * any, provided herein do not apply to combinations of this program with
20 * other software, or any other product whatsoever.
21 *
22 * You should have received a copy of the GNU Lesser General Public
23 * License along with this library; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 *
26 * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
27 * Mountain View, CA 94043, or:
28 *
29 * http://www.sgi.com
30 *
31 * For further information regarding this notice, see:
32 *
33 * http://oss.sgi.com/projects/GenInfo/NoticeExplan/
34 *
35 */
36
37
38/*
39 * Copyright (C) 1990,91,92 Silicon Graphics, Inc.
40 *
41 _______________________________________________________________________
42 ______________ S I L I C O N G R A P H I C S I N C . ____________
43 |
44 | $Revision: 1.1.1.1 $
45 |
46 | Description:
47 | Timer queue sensor that is scheduled to be triggered at a specific
48 | time, which is specified either absolutely (e.g., 2pm) or
49 | relatively (e.g., 5 minutes from now). Once an alarm sensor is
50 | triggered, it is not rescheduled.
51 |
52 | Author(s) : Gavin Bell, Paul Strauss
53 |
54 ______________ S I L I C O N G R A P H I C S I N C . ____________
55 _______________________________________________________________________
56 */
57
58#ifndef _SO_ALARM_SENSOR_
59#define _SO_ALARM_SENSOR_
60
63
66
79
81
82 public:
83
89 SoAlarmSensor(SoSensorCB *func, void *data);
90
93 virtual ~SoAlarmSensor();
94
100 void setTime(const SbTime &absTime);
107 void setTimeFromNow(const SbTime &relTime);
108
113 const SbTime & getTime() const { return time; }
114
117 virtual void schedule();
118
119 private:
120 SbTime time;
121 bool timeSet;
122};
123
124#endif /* _SO_ALARM_SENSOR_ */
#define INVENTOR_API
Disable some annoying warnings on MSVC 6.
Definition SbSystem.h:77
void SoSensorCB(void *data, SoSensor *sensor)
This typedef defines the calling sequence for all callbacks from sensors.
Definition SoSensor.h:89
Class for representation of a time.
Definition SbTime.h:89
Triggers a callback once sometime in the future.
SoAlarmSensor()
Creation methods.
SoAlarmSensor(SoSensorCB *func, void *data)
Creation methods.
const SbTime & getTime() const
Returns the time the sensor is scheduled to be triggered.
virtual ~SoAlarmSensor()
Destroys the sensor, freeing up any memory associated with it after unscheduling it.
virtual void schedule()
Overrides the regular schedule() method because we have to set up the trigger time first.
void setTimeFromNow(const SbTime &relTime)
Sets the sensor to go off the given amount of time from now.
void setTime(const SbTime &absTime)
Sets the sensor to go off at the specified time.
Abstract base class for sensors dependent on time.