.TH "SoSensor" 3 "Tue Dec 26 2023 17:59:22" "Version 4.0.2" "Coin" \" -*- nroff -*- .ad l .nh .SH NAME SoSensor \- The \fBSoSensor\fP class is the abstract base class for all sensors\&. .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 (\fBvoid\fP)" .br .ti -1c .RI "\fBSoSensor\fP (SoSensorCB *\fBfunc\fP, \fBvoid\fP *data)" .br .ti -1c .RI "\fBvirtual\fP \fB~SoSensor\fP (\fBvoid\fP)" .br .ti -1c .RI "\fBvoid\fP \fBsetFunction\fP (SoSensorCB *\fBcallbackfunction\fP)" .br .ti -1c .RI "SoSensorCBPtr \fBgetFunction\fP (\fBvoid\fP) \fBconst\fP" .br .ti -1c .RI "\fBvoid\fP \fBsetData\fP (\fBvoid\fP *\fBcallbackdata\fP)" .br .ti -1c .RI "\fBvoid\fP * \fBgetData\fP (\fBvoid\fP) \fBconst\fP" .br .ti -1c .RI "\fBvirtual\fP \fBvoid\fP \fBschedule\fP (\fBvoid\fP)=0" .br .ti -1c .RI "\fBvirtual\fP \fBvoid\fP \fBunschedule\fP (\fBvoid\fP)=0" .br .ti -1c .RI "\fBvirtual\fP SbBool \fBisScheduled\fP (\fBvoid\fP) \fBconst\fP =0" .br .ti -1c .RI "\fBvirtual\fP \fBvoid\fP \fBtrigger\fP (\fBvoid\fP)" .br .ti -1c .RI "\fBvirtual\fP SbBool \fBisBefore\fP (\fBconst\fP \fBSoSensor\fP *s) \fBconst\fP =0" .br .ti -1c .RI "\fBvoid\fP \fBsetNextInQueue\fP (\fBSoSensor\fP *next)" .br .ti -1c .RI "\fBSoSensor\fP * \fBgetNextInQueue\fP (\fBvoid\fP) \fBconst\fP" .br .in -1c .SS "Static Public Member Functions" .in +1c .ti -1c .RI "\fBstatic\fP \fBvoid\fP \fBinitClass\fP (\fBvoid\fP)" .br .in -1c .SS "Protected Attributes" .in +1c .ti -1c .RI "SoSensorCB * \fBfunc\fP" .br .ti -1c .RI "\fBvoid\fP * \fBfuncData\fP" .br .in -1c .SH "Detailed Description" .PP The \fBSoSensor\fP class is the abstract base class for all sensors\&. 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\&. .PP 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 are 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 come with a lot of built-in functionality for combining and converting inputs and outputs), you just decide which engine you want, connect inputs and output and forget about it\&. Sensors are a lot more flexible in what you can do when they trigger, as control is transferred 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 (\fBvoid\fP)" Constructor\&. .SS "SoSensor::SoSensor (SoSensorCB * funcptr, \fBvoid\fP * data)" Constructor taking as parameters the sensor callback function \fIfunc\fP and the user \fIdata\fP pointer which will be passed to the callback\&. .PP \fBSee also\fP .RS 4 \fBsetFunction()\fP, \fBsetData()\fP .RE .PP .SS "SoSensor::~SoSensor (\fBvoid\fP)\fC [virtual]\fP" Destructor\&. .SH "Member Function Documentation" .PP .SS "\fBvoid\fP SoSensor::setFunction (SoSensorCB * 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 "SoSensorCB * SoSensor::getFunction (\fBvoid\fP) const" Returns the callback function pointer\&. .PP \fBSee also\fP .RS 4 \fBsetFunction()\fP .RE .PP .SS "\fBvoid\fP SoSensor::setData (\fBvoid\fP * 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 "\fBvoid\fP * SoSensor::getData (\fBvoid\fP) const" Returns the user supplied callback function data pointer\&. .PP \fBSee also\fP .RS 4 \fBsetData()\fP .RE .PP .SS "\fBvoid\fP SoSensor::schedule (\fBvoid\fP)\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 \fBSoAlarmSensor\fP, \fBSoDelayQueueSensor\fP, \fBSoTimerQueueSensor\fP, and \fBSoTimerSensor\fP\&. .SS "\fBvoid\fP SoSensor::unschedule (\fBvoid\fP)\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, \fBSoTimerQueueSensor\fP, and \fBSoTimerSensor\fP\&. .SS "SbBool SoSensor::isScheduled (\fBvoid\fP) 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 "\fBvoid\fP SoSensor::trigger (\fBvoid\fP)\fC [virtual]\fP" Trigger the sensor's callback function\&. .PP Reimplemented in \fBSoDataSensor\fP, \fBSoDelayQueueSensor\fP, \fBSoFieldSensor\fP, and \fBSoTimerQueueSensor\fP\&. .SS "SbBool SoSensor::isBefore (\fBconst\fP \fBSoSensor\fP * s) const\fC [pure virtual]\fP" Returns \fCTRUE\fP if this sensor should precede sensor \fIs\fP in its sensor queue\&. .SS "\fBvoid\fP 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 .br .br Open Inventor function not implemented in Coin\&. .SS "\fBSoSensor\fP * SoSensor::getNextInQueue (\fBvoid\fP) const" \fIThis API member is considered internal to the library, as it is not likely to be of interest to the application programmer\&.\fP .br .br Open Inventor function not implemented in Coin\&. .SS "\fBvoid\fP SoSensor::initClass (\fBvoid\fP)\fC [static]\fP" Sets up initialization for static data for the sensors\&. Called by \fBSoDB::init()\fP\&. .SH "Member Data Documentation" .PP .SS "SoSensorCB * SoSensor::func\fC [protected]\fP" Function to be called when a sensor triggers\&. .SS "\fBvoid\fP * SoSensor::funcData\fC [protected]\fP" Data passed to the callback function\&. .SH "Author" .PP Generated automatically by Doxygen for Coin from the source code\&.