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

openvrml::vrml97_node::spot_light_node Class Reference

SpotLight node instances. More...

Inheritance diagram for openvrml::vrml97_node::spot_light_node:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

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

virtual ~spot_light_node () throw ()
 Destroy.

virtual spot_light_node * to_spot_light () const
 Cast to a spot_light_node.

virtual void renderScoped (openvrml::viewer &viewer)
 Render the scoped light.


Private Member Functions

virtual void do_initialize (double timestamp) throw (std::bad_alloc)
 Initialize.

virtual void do_shutdown (double timestamp) throw ()
 Shut down.

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

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

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

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

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

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


Private Attributes

sfvec3f attenuation
 attenuation exposedField.

sffloat beamWidth
 beamWidth exposedField.

sffloat cutOffAngle
 cutOffAngle exposedField.

sfvec3f direction
 direction exposedField.

sfvec3f location
 location exposedField.

sffloat radius
 radius exposedField.


Friends

class spot_light_class
 Class object for SpotLight instances.


Detailed Description

SpotLight node instances.


Constructor & Destructor Documentation

openvrml::vrml97_node::spot_light_node::spot_light_node (  const node_type &  type,
const scope_ptr &  scope
) 
 

Construct.

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

Member Function Documentation

void openvrml::vrml97_node::spot_light_node::do_initialize (  double  timestamp  )  throw (std::bad_alloc) [private, virtual]
 

Initialize.

Parameters:
timestamp the current time.
Exceptions:
std::bad_alloc if memory allocation fails.

Reimplemented from openvrml::node.

void openvrml::vrml97_node::spot_light_node::do_shutdown (  double  timestamp  )  throw () [private, virtual]
 

Shut down.

Parameters:
timestamp the current time.

Reimplemented from openvrml::node.

void openvrml::vrml97_node::spot_light_node::process_set_attenuation (  const field_value &  value,
double  timestamp
)  throw (std::bad_cast) [private]
 

set_attenuation eventIn handler.

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

void openvrml::vrml97_node::spot_light_node::process_set_beamWidth (  const field_value &  value,
double  timestamp
)  throw (std::bad_cast) [private]
 

set_beamWidth eventIn handler.

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

void openvrml::vrml97_node::spot_light_node::process_set_cutOffAngle (  const field_value &  value,
double  timestamp
)  throw (std::bad_cast) [private]
 

set_cutOffAngle eventIn handler.

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

void openvrml::vrml97_node::spot_light_node::process_set_direction (  const field_value &  value,
double  timestamp
)  throw (std::bad_cast) [private]
 

set_direction eventIn handler.

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

void openvrml::vrml97_node::spot_light_node::process_set_location (  const field_value &  value,
double  timestamp
)  throw (std::bad_cast) [private]
 

set_location eventIn handler.

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

void openvrml::vrml97_node::spot_light_node::process_set_radius (  const field_value &  value,
double  timestamp
)  throw (std::bad_cast) [private]
 

set_radius eventIn handler.

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

void openvrml::vrml97_node::spot_light_node::renderScoped (  openvrml::viewer &  viewer  )  [virtual]
 

Render the scoped light.

Parameters:
viewer a Viewer.

Todo:
This should be called before rendering any geometry in the scene. Since this is called from Scene::render before traversing the scene graph, the proper transformation matrix hasn't been set up. Somehow it needs to figure out the accumulated xforms of its parents and apply them before rendering. This is not easy with DEF/USEd nodes...

Reimplemented from openvrml::vrml97_node::abstract_light_node.

spot_light_node * openvrml::vrml97_node::spot_light_node::to_spot_light (   )  const [virtual]
 

Cast to a spot_light_node.

Returns:
a pointer to the node.

Reimplemented from openvrml::node.