Main Page | Modules | Namespace List | Class Hierarchy | Class List | Namespace Members | Class Members | Related Pages

openvrml::vrml97_node::proximity_sensor_node Class Reference

Represents ProximitySensor node instances. More...

Inheritance diagram for openvrml::vrml97_node::proximity_sensor_node:

Inheritance graph
[legend]
Collaboration diagram for openvrml::vrml97_node::proximity_sensor_node:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 proximity_sensor_node (const node_type &type, const scope_ptr &scope)
 Construct.

virtual ~proximity_sensor_node () throw ()
 Destroy.

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


Private Member Functions

void process_set_center (const field_value &value, double timestamp) throw (std::bad_cast)
 set_center eventIn handler.

void process_set_size (const field_value &value, double timestamp) throw (std::bad_cast)
 set_size eventIn handler.

void process_set_enabled (const field_value &value, 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 proximity_sensor_class
 Class object for ProximitySensor instances.


Detailed Description

Represents ProximitySensor node instances.


Constructor & Destructor Documentation

openvrml::vrml97_node::proximity_sensor_node::proximity_sensor_node const node_type type,
const scope_ptr scope
 

Construct.

Parameters:
type the node_type associated with the node.
scope the scope to which the node belongs.

Member Function Documentation

void openvrml::vrml97_node::proximity_sensor_node::process_set_center const field_value value,
double  timestamp
throw (std::bad_cast) [private]
 

set_center eventIn handler.

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

void openvrml::vrml97_node::proximity_sensor_node::process_set_enabled const field_value value,
double  timestamp
throw (std::bad_cast) [private]
 

set_enabled eventIn handler.

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

void openvrml::vrml97_node::proximity_sensor_node::process_set_size const field_value value,
double  timestamp
throw (std::bad_cast) [private]
 

set_size eventIn handler.

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

void openvrml::vrml97_node::proximity_sensor_node::render openvrml::viewer viewer,
rendering_context  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 openvrml::node.