Class SoSensor
- java.lang.Object
-
- com.openinventor.inventor.Inventor
-
- com.openinventor.inventor.sensors.SoSensor
-
- Direct Known Subclasses:
SoDelayQueueSensor
,SoTimerQueueSensor
public class SoSensor extends Inventor
Abstract base class for Open Inventor sensors. Sensors detect changes either to time or to Open Inventor objects in a scene graph, and call a user-defined callback function. Sensors are scheduled when the thing they are attached to changes, and sometime after they are scheduled they are triggered , calling the user's callback function.- See Also:
SoAlarmSensor
,SoDataSensor
,SoFieldSensor
,SoIdleSensor
,SoNodeSensor
,SoPathSensor
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.openinventor.inventor.Inventor
Inventor.ConstructorCommand
-
-
Field Summary
-
Fields inherited from class com.openinventor.inventor.Inventor
VERBOSE_LEVEL, ZeroHandle
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isScheduled()
Returns true if this sensor has been scheduled and is waiting in a sensor queue to be triggered.void
schedule()
void
setTask(java.lang.Runnable task)
Sets the task to be executed when the sensor is triggered.void
unschedule()
-
Methods inherited from class com.openinventor.inventor.Inventor
dispose, getNativeResourceHandle
-
-
-
-
Method Detail
-
setTask
public void setTask(java.lang.Runnable task)
Sets the task to be executed when the sensor is triggered. Execute the task means simply call its run method.
-
schedule
public void schedule()
-
unschedule
public void unschedule()
-
isScheduled
public boolean isScheduled()
Returns true if this sensor has been scheduled and is waiting in a sensor queue to be triggered. Sensors are removed from the queue before their callback function is triggered.
-
-