.TH "SoSensor" 3 "Sat Oct 12 2013" "Version 4.0.0a" "Coin" \" -*- nroff -*- .ad l .nh .SH NAME SoSensor \- .PP The \fBSoSensor\fP class is the abstract base class for all sensors\&. .PP Sensors is a mechanism in Coin for scheduling jobs to be run upon specific events\&. The events in question could be particular points in time, or changes to entities in the scene graph\&. .SH SYNOPSIS .br .PP .PP \fC#include \fP .PP Inherited by \fBSoDelayQueueSensor\fP, and \fBSoTimerQueueSensor\fP\&. .SS "Public Member Functions" .in +1c .ti -1c .RI "\fBSoSensor\fP (void)" .br .ti -1c .RI "\fBSoSensor\fP (\fBSoSensorCB\fP *\fBfunc\fP, void *data)" .br .ti -1c .RI "virtual \fB~SoSensor\fP (void)" .br .ti -1c .RI "void \fBsetFunction\fP (\fBSoSensorCB\fP *callbackfunction)" .br .ti -1c .RI "SoSensorCBPtr \fBgetFunction\fP (void) const " .br .ti -1c .RI "void \fBsetData\fP (void *callbackdata)" .br .ti -1c .RI "void * \fBgetData\fP (void) const " .br .ti -1c .RI "virtual void \fBschedule\fP (void)=0" .br .ti -1c .RI "virtual void \fBunschedule\fP (void)=0" .br .ti -1c .RI "virtual SbBool \fBisScheduled\fP (void) const =0" .br .ti -1c .RI "virtual void \fBtrigger\fP (void)" .br .ti -1c .RI "virtual SbBool \fBisBefore\fP (const \fBSoSensor\fP *s) const =0" .br .ti -1c .RI "void \fBsetNextInQueue\fP (\fBSoSensor\fP *next)" .br .ti -1c .RI "\fBSoSensor\fP * \fBgetNextInQueue\fP (void) const " .br .in -1c .SS "Static Public Member Functions" .in +1c .ti -1c .RI "static void \fBinitClass\fP (void)" .br .in -1c .SS "Protected Attributes" .in +1c .ti -1c .RI "\fBSoSensorCB\fP * \fBfunc\fP" .br .ti -1c .RI "void * \fBfuncData\fP" .br .in -1c .SH "Detailed Description" .PP The \fBSoSensor\fP class is the abstract base class for all sensors\&. .PP Sensors is a mechanism in Coin for scheduling jobs to be run upon specific events\&. The events in question could be particular points in time, or changes to entities in the scene graph\&. See documentation of subclasses for insight into exactly for what types of events we can trigger sensor callbacks\&. .PP For most tasks where application programmers can use sensors, it is also possible to achieve the same results by using engines\&. There are a few important differences between sensors and engines, though: .PP Engines are considered part of the scene graph, and is written to file upon \fBSoWriteAction\fP export operations\&. Sensors, on the other hand, are not included in export operations\&. .PP Engines basically connects fields (and comes with a lot of builtin functionality for combining and converting inputs and outputs), you just decide which engine you want, connect inputs and output and forgets about it\&. Sensors are a lot more flexible in what you can do when they trigger, as control is transfered internally from Coin to your registered callback functions\&. .PP \fBSee Also:\fP .RS 4 \fBSoSensorManager\fP, \fBSoEngine\fP .RE .PP .SH "Constructor & Destructor Documentation" .PP .SS "SoSensor::SoSensor (void)" Constructor\&. .SS "SoSensor::SoSensor (\fBSoSensorCB\fP *funcptr, void *data)" Constructor taking as parameters the sensor callback function \fIfunc\fP and the user \fIdata\fP pointer which will be passed the callback\&. .PP \fBSee Also:\fP .RS 4 \fBsetFunction()\fP, \fBsetData()\fP .RE .PP .SS "SoSensor::~SoSensor (void)\fC [virtual]\fP" Destructor\&. .SH "Member Function Documentation" .PP .SS "void SoSensor::setFunction (\fBSoSensorCB\fP *callbackfunction)" Set the callback function pointer which will be used when the sensor is triggered\&. .PP \fBSee Also:\fP .RS 4 \fBgetFunction()\fP, \fBsetData()\fP .RE .PP .SS "\fBSoSensorCB\fP * SoSensor::getFunction (void) const" Returns the callback function pointer\&. .PP \fBSee Also:\fP .RS 4 \fBsetFunction()\fP .RE .PP .SS "void SoSensor::setData (void *callbackdata)" Set the user-supplied data pointer which will be used as the first argument to the sensor callback function\&. .PP \fBSee Also:\fP .RS 4 \fBgetData()\fP, \fBsetFunction()\fP .RE .PP .SS "void * SoSensor::getData (void) const" Returns the user-supplied callback function data pointer\&. .PP \fBSee Also:\fP .RS 4 \fBsetData()\fP .RE .PP .SS "void SoSensor::schedule (void)\fC [pure virtual]\fP" Put the sensor in a queue to be triggered at a later time\&. .PP \fBSee Also:\fP .RS 4 \fBunschedule()\fP, \fBisScheduled()\fP .RE .PP .PP Implemented in \fBSoDelayQueueSensor\fP, \fBSoTimerSensor\fP, \fBSoAlarmSensor\fP, and \fBSoTimerQueueSensor\fP\&. .SS "void SoSensor::unschedule (void)\fC [pure virtual]\fP" Remove sensor from queue\&. The sensor will not be triggered unless it is later rescheduled\&. .PP \fBSee Also:\fP .RS 4 \fBschedule()\fP, \fBisScheduled()\fP .RE .PP .PP Implemented in \fBSoDelayQueueSensor\fP, \fBSoTimerSensor\fP, and \fBSoTimerQueueSensor\fP\&. .SS "SbBool SoSensor::isScheduled (void) const\fC [pure virtual]\fP" Check if this sensor is scheduled for triggering\&. .PP \fBSee Also:\fP .RS 4 \fBschedule()\fP, \fBunschedule()\fP .RE .PP .PP Implemented in \fBSoDelayQueueSensor\fP, and \fBSoTimerQueueSensor\fP\&. .SS "void SoSensor::trigger (void)\fC [virtual]\fP" Trigger the sensor's callback function\&. .PP Reimplemented in \fBSoDataSensor\fP, \fBSoDelayQueueSensor\fP, \fBSoTimerQueueSensor\fP, and \fBSoFieldSensor\fP\&. .SS "SbBool SoSensor::isBefore (const \fBSoSensor\fP *s) const\fC [pure virtual]\fP" Returns \fCTRUE\fP if this sensor should precede sensor \fIs\fP in its sensor queue\&. .SS "void SoSensor::setNextInQueue (\fBSoSensor\fP *next)" \fIThis API member is considered internal to the library, as it is not likely to be of interest to the application programmer\&.\fP .PP Open Inventor function not implemented in Coin\&. .SS "\fBSoSensor\fP * SoSensor::getNextInQueue (void) const" \fIThis API member is considered internal to the library, as it is not likely to be of interest to the application programmer\&.\fP .PP Open Inventor function not implemented in Coin\&. .SS "void SoSensor::initClass (void)\fC [static]\fP" Sets up initialization for static data for the sensors\&. Called by \fBSoDB::init()\fP\&. .SH "Member Data Documentation" .PP .SS "\fBSoSensorCB\fP * SoSensor::func\fC [protected]\fP" Function to be called when a sensor triggers\&. .SS "void * SoSensor::funcData\fC [protected]\fP" Data passed to the callback function\&. .SH "Author" .PP Generated automatically by Doxygen for Coin from the source code\&.