Main Page   Namespace List   Class Hierarchy   Compound List   Namespace Members   Compound Members   Related Pages  

ProximitySensor Class Reference

Represents ProximitySensor node instances. More...

Inheritance diagram for ProximitySensor:

AbstractChild AbstractBase ChildNode Node Node List of all members.

Public Methods

 ProximitySensor (const NodeType &nodeType, const ScopePtr &scope)
 Constructor.

virtual ~ProximitySensor () throw ()
 Destructor.

virtual void render (Viewer &viewer, VrmlRenderContext context)
 Render the node: generate proximity events.


Private Methods

void processSet_center (const FieldValue &sfvec3f, double timestamp) throw (std::bad_cast)
 set_center eventIn handler.

void processSet_size (const FieldValue &sfvec3f, double timestamp) throw (std::bad_cast)
 set_size eventIn handler.

void processSet_enabled (const FieldValue &sfbool, double timestamp) throw (std::bad_cast)
 set_enabled eventIn handler.


Private Attributes

SFVec3f center
 center exposedField.

SFBool enabled
 enabled exposedField.

SFVec3f size
 size exposedField.

SFBool active
 isActive eventOut.

SFVec3f position
 position_changed eventOut.

SFRotation orientation
 orientation_changed eventOut.

SFTime enterTime
 enterTime eventOut.

SFTime exitTime
 exitTime eventOut.


Friends

class ProximitySensorClass
 Class object for ProximitySensor instances.


Detailed Description

Represents ProximitySensor node instances.


Constructor & Destructor Documentation

ProximitySensor const NodeType   nodeType,
const ScopePtr   scope
 

Constructor.

Parameters:
nodeType the NodeType associated with the node.
scope the Scope to which the node belongs.

~ProximitySensor   throw () [virtual]
 

Destructor.


Member Function Documentation

void processSet_center const FieldValue   sfvec3f,
double    timestamp
throw (std::bad_cast) [private]
 

set_center eventIn handler.

Parameters:
sfvec3f an SFVec3f value.
timestamp the current time.
Exceptions:
std::bad_cast if sfvec3f is not an SFVec3f.

void processSet_enabled const FieldValue   sfbool,
double    timestamp
throw (std::bad_cast) [private]
 

set_enabled eventIn handler.

Parameters:
sfbool an SFBool value.
timestamp the current time.
Exceptions:
std::bad_cast if sfbool is not an SFBool.

void processSet_size const FieldValue   sfvec3f,
double    timestamp
throw (std::bad_cast) [private]
 

set_size eventIn handler.

Parameters:
sfvec3f an SFVec3f value.
timestamp the current time.
Exceptions:
std::bad_cast if sfvec3f is not an SFVec3f.

void render Viewer   viewer,
VrmlRenderContext    context
[virtual]
 

Render the node: generate proximity events.

If necessary, events prior to the current time are generated due to interpolation of enterTimes and exitTimes. The timestamp should never be increased.

This is in a render() method since the it needs the viewer position with respect to the local coordinate system. Could do this with Node::inverseTransform(double [4][4]) now...

The positions and times are not interpolated to report the exact place and time of entries and exits from the sensor regions as required by the spec, since that would require the last viewer position to be stored in the node, which is problematic in the presence of DEF/USEd nodes... I suppose the scene could keep the last viewer position in the global coordinate system and it could be transformed all the way down the scenegraph, but that sounds painful.

Parameters:
viewer a Viewer.
context a rendering context.

Reimplemented from Node.


Friends And Related Function Documentation

ProximitySensorClass [friend]
 

Class object for ProximitySensor instances.


Member Data Documentation

SFBool active [private]
 

isActive eventOut.

SFVec3f center [private]
 

center exposedField.

SFBool enabled [private]
 

enabled exposedField.

SFTime enterTime [private]
 

enterTime eventOut.

SFTime exitTime [private]
 

exitTime eventOut.

SFVec3f orientation [private]
 

orientation_changed eventOut.

SFVec3f position [private]
 

position_changed eventOut.

SFVec3f size [private]
 

size exposedField.