.TH "SoVRMLProximitySensor" 3 "Thu May 29 2014" "Version 4.0.0a" "Coin" \" -*- nroff -*- .ad l .nh .SH NAME SoVRMLProximitySensor \- .PP The \fBSoVRMLProximitySensor\fP class is used to generate events when the viewer enters or exits a region\&. .PP \fBThe detailed class documentation is taken verbatim from the VRML97 standard (ISO/IEC 14772-1:1997)\&. It is copyright The Web3D Consortium, and is used by permission of the Consortium:\fP .SH SYNOPSIS .br .PP .PP \fC#include \fP .PP Inherits \fBSoNode\fP\&. .SS "Public Member Functions" .in +1c .ti -1c .RI "virtual \fBSoType\fP \fBgetTypeId\fP (void) const " .br .RI "\fIReturns the type identification of an object derived from a class inheriting \fBSoBase\fP\&. This is used for run-time type checking and 'downward' casting\&. \fP" .ti -1c .RI "\fBSoVRMLProximitySensor\fP (void)" .br .ti -1c .RI "virtual SbBool \fBaffectsState\fP (void) const " .br .ti -1c .RI "virtual void \fBdoAction\fP (\fBSoAction\fP *action)" .br .ti -1c .RI "virtual void \fBGLRender\fP (\fBSoGLRenderAction\fP *action)" .br .ti -1c .RI "virtual void \fBcallback\fP (\fBSoCallbackAction\fP *action)" .br .ti -1c .RI "virtual void \fBrayPick\fP (\fBSoRayPickAction\fP *action)" .br .ti -1c .RI "virtual void \fBgetBoundingBox\fP (\fBSoGetBoundingBoxAction\fP *action)" .br .in -1c .SS "Static Public Member Functions" .in +1c .ti -1c .RI "static \fBSoType\fP \fBgetClassTypeId\fP (void)" .br .ti -1c .RI "static void \fBinitClass\fP (void)" .br .in -1c .SS "Public Attributes" .in +1c .ti -1c .RI "\fBSoSFVec3f\fP \fBcenter\fP" .br .ti -1c .RI "\fBSoSFVec3f\fP \fBsize\fP" .br .ti -1c .RI "\fBSoSFBool\fP \fBenabled\fP" .br .ti -1c .RI "\fBSoSFBool\fP \fBisActive\fP" .br .ti -1c .RI "\fBSoSFVec3f\fP \fBposition_changed\fP" .br .ti -1c .RI "\fBSoSFRotation\fP \fBorientation_changed\fP" .br .ti -1c .RI "\fBSoSFTime\fP \fBenterTime\fP" .br .ti -1c .RI "\fBSoSFTime\fP \fBexitTime\fP" .br .in -1c .SS "Protected Member Functions" .in +1c .ti -1c .RI "virtual const \fBSoFieldData\fP * \fBgetFieldData\fP (void) const " .br .ti -1c .RI "virtual \fB~SoVRMLProximitySensor\fP ()" .br .ti -1c .RI "virtual void \fBnotify\fP (\fBSoNotList\fP *list)" .br .in -1c .SS "Static Protected Member Functions" .in +1c .ti -1c .RI "static const \fBSoFieldData\fP ** \fBgetFieldDataPtr\fP (void)" .br .in -1c .SS "Additional Inherited Members" .SH "Detailed Description" .PP The \fBSoVRMLProximitySensor\fP class is used to generate events when the viewer enters or exits a region\&. .PP \fBThe detailed class documentation is taken verbatim from the VRML97 standard (ISO/IEC 14772-1:1997)\&. It is copyright The Web3D Consortium, and is used by permission of the Consortium:\fP .PP .nf ProximitySensor { exposedField SFVec3f center 0 0 0 # (-,) exposedField SFVec3f size 0 0 0 # [0,) exposedField SFBool enabled TRUE eventOut SFBool isActive eventOut SFVec3f position_changed eventOut SFRotation orientation_changed eventOut SFTime enterTime eventOut SFTime exitTime } .fi .PP .PP The ProximitySensor node generates events when the viewer enters, exits, and moves within a region in space (defined by a box)\&. .PP A proximity sensor is enabled or disabled by sending it an enabled event with a value of TRUE or FALSE\&. A disabled sensor does not send events\&. .PP A ProximitySensor node generates isActive TRUE/FALSE events as the viewer enters and exits the rectangular box defined by its center and size fields\&. Browsers shall interpolate viewer positions and timestamp the isActive events with the exact time the viewer first intersected the proximity region\&. .PP The \fIcenter\fP field defines the centre point of the proximity region in object space\&. The \fIsize\fP field specifies a vector which defines the width (x), height (y), and depth (z) of the box bounding the region\&. The components of the size field shall be greater than or equal to zero\&. ProximitySensor nodes are affected by the hierarchical transformations of their parents\&. .PP The \fIenterTime\fP event is generated whenever the isActive TRUE event is generated (user enters the box), and \fIexitTime\fP events are generated whenever an isActive FALSE event is generated (user exits the box)\&. .PP The \fIposition_changed\fP and \fIorientation_changed\fP eventOuts send events whenever the user is contained within the proximity region and the position and orientation of the viewer changes with respect to the ProximitySensor node's coordinate system including enter and exit times\&. .PP The viewer movement may be a result of a variety of circumstances resulting from browser navigation, ProximitySensor node's coordinate system changes, or bound Viewpoint node's position or orientation changes\&. .PP Each ProximitySensor node behaves independently of all other ProximitySensor nodes\&. Every enabled ProximitySensor node that is affected by the viewer's movement receives and sends events, possibly resulting in multiple .PP ProximitySensor nodes receiving and sending events simultaneously\&. Unlike TouchSensor nodes, there is no notion of a ProximitySensor node lower in the scene graph 'grabbing' events\&. .PP Instanced (DEF/USE) ProximitySensor nodes use the union of all the boxes to check for enter and exit\&. A multiply instanced ProximitySensor node will detect enter and exit for all instances of the box and send enter/exit events appropriately\&. However, the results are undefined if the any of the boxes of a multiply instanced ProximitySensor node overlap\&. .PP A ProximitySensor node that surrounds the entire world has an enterTime equal to the time that the world was entered and can be used to start up animations or behaviours as soon as a world is loaded\&. .PP A ProximitySensor node with a box containing zero volume (i\&.e\&., any size field element of 0\&.0) cannot generate events\&. This is equivalent to setting the enabled field to FALSE\&. .PP A ProximitySensor read from a VRML file shall generate isActive TRUE, position_changed, orientation_changed and enterTime events if the sensor is enabled and the viewer is inside the proximity region\&. .PP A ProximitySensor inserted into the transformation hierarchy shall generate isActive TRUE, position_changed, orientation_changed and enterTime events if the sensor is enabled and the viewer is inside the proximity region\&. .PP A ProximitySensor removed from the transformation hierarchy shall generate isActive FALSE, position_changed, orientation_changed and exitTime events if the sensor is enabled and the viewer is inside the proximity region\&. .SH "Constructor & Destructor Documentation" .PP .SS "SoVRMLProximitySensor::SoVRMLProximitySensor (void)" Constructor\&. .SS "SoVRMLProximitySensor::~SoVRMLProximitySensor ()\fC [protected]\fP, \fC [virtual]\fP" Destructor\&. .SH "Member Function Documentation" .PP .SS "\fBSoType\fP SoVRMLProximitySensor::getTypeId (void) const\fC [virtual]\fP" .PP Returns the type identification of an object derived from a class inheriting \fBSoBase\fP\&. This is used for run-time type checking and 'downward' casting\&. Usage example: .PP .PP .nf void foo(SoNode * node) { if (node->getTypeId() == SoFile::getClassTypeId()) { SoFile * filenode = (SoFile *)node; // safe downward cast, knows the type } } .fi .PP .PP For application programmers wanting to extend the library with new nodes, engines, nodekits, draggers or others: this method needs to be overridden in \fIall\fP subclasses\&. This is typically done as part of setting up the full type system for extension classes, which is usually accomplished by using the pre-defined macros available through for instance \fBInventor/nodes/SoSubNode\&.h\fP (SO_NODE_INIT_CLASS and SO_NODE_CONSTRUCTOR for node classes), Inventor/engines/SoSubEngine\&.h (for engine classes) and so on\&. .PP For more information on writing Coin extensions, see the class documentation of the toplevel superclasses for the various class groups\&. .PP Implements \fBSoBase\fP\&. .SS "const \fBSoFieldData\fP * SoVRMLProximitySensor::getFieldData (void) const\fC [protected]\fP, \fC [virtual]\fP" Returns a pointer to the class-wide field data storage object for this instance\&. If no fields are present, returns \fCNULL\fP\&. .PP Reimplemented from \fBSoFieldContainer\fP\&. .SS "SbBool SoVRMLProximitySensor::affectsState (void) const\fC [virtual]\fP" Returns \fCTRUE\fP if the node could have any effect on the state during traversal\&. .PP If it returns \fCFALSE\fP, no data in the traversal-state will change from the pre-traversal state to the post-traversal state\&. The \fBSoSeparator\fP node will for instance return \fCFALSE\fP, as it pushes and pops the state before and after traversal of its children\&. All \fBSoShape\fP nodes will also return \fCFALSE\fP, as just pushing out geometry data to the rendering engine won't affect the actual rendering state\&. .PP The default method returns \fCTRUE\fP, on a 'better safe than sorry' philosophy\&. .PP Reimplemented from \fBSoNode\fP\&. .SS "void SoVRMLProximitySensor::doAction (\fBSoAction\fP *action)\fC [virtual]\fP" This function performs the typical operation of a node for any action\&. .PP Reimplemented from \fBSoNode\fP\&. .SS "void SoVRMLProximitySensor::GLRender (\fBSoGLRenderAction\fP *action)\fC [virtual]\fP" Action method for the \fBSoGLRenderAction\fP\&. .PP This is called during rendering traversals\&. Nodes influencing the rendering state in any way or who wants to throw geometry primitives at OpenGL overrides this method\&. .PP Reimplemented from \fBSoNode\fP\&. .SS "void SoVRMLProximitySensor::callback (\fBSoCallbackAction\fP *action)\fC [virtual]\fP" Action method for \fBSoCallbackAction\fP\&. .PP Simply updates the state according to how the node behaves for the render action, so the application programmer can use the \fBSoCallbackAction\fP for extracting information about the scene graph\&. .PP Reimplemented from \fBSoNode\fP\&. .SS "void SoVRMLProximitySensor::rayPick (\fBSoRayPickAction\fP *action)\fC [virtual]\fP" Action method for \fBSoRayPickAction\fP\&. .PP Checks the ray specification of the \fIaction\fP and tests for intersection with the data of the node\&. .PP Nodes influencing relevant state variables for how picking is done also overrides this method\&. .PP Reimplemented from \fBSoNode\fP\&. .SS "void SoVRMLProximitySensor::getBoundingBox (\fBSoGetBoundingBoxAction\fP *action)\fC [virtual]\fP" Action method for the \fBSoGetBoundingBoxAction\fP\&. .PP Calculates bounding box and center coordinates for node and modifies the values of the \fIaction\fP to encompass the bounding box for this node and to shift the center point for the scene more towards the one for this node\&. .PP Nodes influencing how geometry nodes calculates their bounding box also overrides this method to change the relevant state variables\&. .PP Reimplemented from \fBSoNode\fP\&. .SS "void SoVRMLProximitySensor::notify (\fBSoNotList\fP *l)\fC [protected]\fP, \fC [virtual]\fP" Notifies all auditors for this instance when changes are made\&. .PP Reimplemented from \fBSoNode\fP\&. .SH "Member Data Documentation" .PP .SS "\fBSoSFVec3f\fP SoVRMLProximitySensor::center" The center of the region\&. Default value is (0,0,0)\&. .SS "\fBSoSFVec3f\fP SoVRMLProximitySensor::size" The region size\&. Default value is (0, 0, 0)\&. .SS "\fBSoSFBool\fP SoVRMLProximitySensor::enabled" Enable/disable sensor\&. Default value is TRUE\&. .SS "\fBSoSFBool\fP SoVRMLProximitySensor::isActive" An eventOut that is sent every time the sensor changes state\&. .SS "\fBSoSFVec3f\fP SoVRMLProximitySensor::position_changed" An eventOut that is sent when the viewer is inside the region and the viewer position or orientation is changed\&. .SS "\fBSoSFRotation\fP SoVRMLProximitySensor::orientation_changed" An eventOut that is sent when the viewer is inside the region and the viewer position or orientation is changed\&. .SS "\fBSoSFTime\fP SoVRMLProximitySensor::enterTime" An eventOut that is sent when the viewer enters the region\&. .SS "\fBSoSFTime\fP SoVRMLProximitySensor::exitTime" An eventOut that is sent when the viewer exits the region\&. .SH "Author" .PP Generated automatically by Doxygen for Coin from the source code\&.