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

openvrml::vrml97_node::switch_node Class Reference

Switch node instances. More...

Inheritance diagram for openvrml::vrml97_node::switch_node:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

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

virtual ~switch_node () throw ()
 Destroy.

virtual bool modified () const
 Determine whether the node has been modified.

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

virtual const openvrml::bounding_volume & bounding_volume () const
 Get the bounding volume.

virtual const std::vector<
node_ptr > & 
children () const throw ()
 Get the children in the scene graph.

virtual void activate (double timestamp, bool over, bool active, double *p)

Private Member Functions

void process_set_choice (const field_value &value, double timestamp) throw (std::bad_cast, std::bad_alloc)
 set_choice eventIn handler.

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

virtual void recalcBSphere ()
 Recalculate the bounding volume.


Private Attributes

mfnode choice
 choice exposedField.

sfint32 whichChoice
 whichChoice exposedField.

mfnode children_
 The children currently in the scene graph.

bounding_sphere bsphere
 Cached copy of the bsphere enclosing this node's children.


Friends

class switch_class
 Class object for Switch instances.


Detailed Description

Switch node instances.


Constructor & Destructor Documentation

openvrml::vrml97_node::switch_node::switch_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.

openvrml::vrml97_node::switch_node::~switch_node  )  throw () [virtual]
 

Destroy.


Member Function Documentation

void openvrml::vrml97_node::switch_node::activate double  timestamp,
bool  over,
bool  active,
double *  p
[virtual]
 

Pass on to enabled touchsensor child.

Implements openvrml::grouping_node.

const bounding_volume & openvrml::vrml97_node::switch_node::bounding_volume  )  const [virtual]
 

Get the bounding volume.

Returns:
the bounding volume associated with the node.

Reimplemented from openvrml::node.

const std::vector< node_ptr > & openvrml::vrml97_node::switch_node::children  )  const throw () [virtual]
 

Get the children in the scene graph.

Returns:
the child nodes in the scene graph.

Implements openvrml::grouping_node.

bool openvrml::vrml97_node::switch_node::modified  )  const [virtual]
 

Determine whether the node has been modified.

Returns:
true if the node or one of its children has been modified, false otherwise.

Reimplemented from openvrml::node.

void openvrml::vrml97_node::switch_node::process_set_choice const field_value value,
double  timestamp
throw (std::bad_cast, std::bad_alloc) [private]
 

set_choice eventIn handler.

Parameters:
value an mfnode value.
timestamp the current time.
Exceptions:
std::bad_cast if value is not an mfnode.
std::bad_alloc if memory allocation fails.

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

set_whichChoice eventIn handler.

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

void openvrml::vrml97_node::switch_node::recalcBSphere  )  [private, virtual]
 

Recalculate the bounding volume.

void openvrml::vrml97_node::switch_node::render openvrml::viewer viewer,
rendering_context  context
[virtual]
 

Render the node.

The child corresponding to whichChoice is rendered. Nothing is rendered if whichChoice is -1.

Parameters:
viewer a Viewer.
context a rendering context.

Reimplemented from openvrml::node.


Friends And Related Function Documentation

openvrml::vrml97_node::switch_node::switch_class [friend]
 

Class object for Switch instances.


Member Data Documentation

bounding_sphere openvrml::vrml97_node::switch_node::bsphere [private]
 

Cached copy of the bsphere enclosing this node's children.

mfnode openvrml::vrml97_node::switch_node::children_ [private]
 

The children currently in the scene graph.

mfnode openvrml::vrml97_node::switch_node::choice [private]
 

choice exposedField.

sfint32 openvrml::vrml97_node::switch_node::whichChoice [private]
 

whichChoice exposedField.