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

Switch Class Reference

Switch node instances. More...

Inheritance diagram for Switch:

AbstractChild AbstractBase ChildNode Node Node List of all members.

Public Methods

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

virtual ~Switch () throw ()
 Destructor.

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

virtual void updateModified (NodePath &path, int flags=0x003)
 Propagate the bvolume dirty flag from children to parents.

virtual void render (Viewer &viewer, VrmlRenderContext context)
 Render the node.

virtual const BVolumegetBVolume () const
 Get the bounding volume.


Private Methods

void processSet_choice (const FieldValue &mfnode, double timestamp) throw (std::bad_cast, std::bad_alloc)
 set_choice eventIn handler.

void processSet_whichChoice (const FieldValue &sfint32, 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.

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


Friends

class SwitchClass
 Class object for Switch instances.


Detailed Description

Switch node instances.


Constructor & Destructor Documentation

Switch const NodeType   nodeType,
const ScopePtr   scope
 

Constructor.

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

~Switch   throw () [virtual]
 

Destructor.


Member Function Documentation

const BVolume * getBVolume   const [virtual]
 

Get the bounding volume.

Returns:
the bounding volume associated with the node.

Reimplemented from Node.

bool isModified   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 Node.

void processSet_choice const FieldValue   mfnode,
double    timestamp
throw (std::bad_cast, std::bad_alloc) [private]
 

set_choice eventIn handler.

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

void processSet_whichChoice const FieldValue   sfint32,
double    timestamp
throw (std::bad_cast) [private]
 

set_whichChoice eventIn handler.

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

void recalcBSphere   [private, virtual]
 

Recalculate the bounding volume.

void render Viewer   viewer,
VrmlRenderContext    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 Node.

void updateModified NodePath &    path,
int    flags = 0x003
[virtual]
 

Propagate the bvolume dirty flag from children to parents.

Parameters:
path stack of ancestor nodes.
flags 1 indicates normal modified flag, 2 indicates the bvolume dirty flag, 3 indicates both.

Reimplemented from Node.


Friends And Related Function Documentation

SwitchClass [friend]
 

Class object for Switch instances.


Member Data Documentation

BSphere bsphere [private]
 

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

MFNode choice [private]
 

choice exposedField.

SFInt32 whichChoice [private]
 

whichChoice exposedField.