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

osg::Switch Class Reference

Switch is a Group node which allows switching between children. More...

Inheritance diagram for osg::Switch:

Inheritance graph
[legend]
List of all members.

Public Types

enum  SwitchType { ALL_CHILDREN_ON = -1, ALL_CHILDREN_OFF = -2 }
 Special mode values for the Switch. More...


Public Methods

 Switch ()
 Switch (const Switch &, const CopyOp &copyop=CopyOp::SHALLOW_COPY)
 Copy constructor using CopyOp to manage deep vs shallow copy.

 META_Node (osg, Switch)
virtual void traverse (NodeVisitor &nv)
 Traverse downwards : calls children's accept method with NodeVisitor.

void setValue (const int value)
 Selects the active child Node or enables a special SwitchType mode.

const int getValue () const
 Returns the number of the active child Node or the SwitchType.


Protected Methods

virtual ~Switch ()

Protected Attributes

int _value
 The current Switch value.


Detailed Description

Switch is a Group node which allows switching between children.

Typical uses would be for objects which might need to be rendered differently at different times, for instance a switch could be used to represent the different states of a traffic light.


Member Enumeration Documentation

enum osg::Switch::SwitchType
 

Special mode values for the Switch.

Use these if you want to turn on/off all child nodes.

Enumeration values:
ALL_CHILDREN_ON  Turn on all children.
ALL_CHILDREN_OFF  Turn off all children.


Constructor & Destructor Documentation

osg::Switch::Switch  
 

osg::Switch::Switch const Switch &   ,
const CopyOp   copyop = CopyOp::SHALLOW_COPY
 

Copy constructor using CopyOp to manage deep vs shallow copy.

virtual osg::Switch::~Switch   [inline, protected, virtual]
 


Member Function Documentation

const int osg::Switch::getValue   const [inline]
 

Returns the number of the active child Node or the SwitchType.

osg::Switch::META_Node osg   ,
Switch   
 

Reimplemented in osg::Sequence.

void osg::Switch::setValue const int    value [inline]
 

Selects the active child Node or enables a special SwitchType mode.

Parameters:
value  the number of the active child (first child == number 0) or SwitchType. Invalid values will be ignored.

virtual void osg::Switch::traverse NodeVisitor   nv [virtual]
 

Traverse downwards : calls children's accept method with NodeVisitor.

Reimplemented from osg::Group.

Reimplemented in osg::Sequence.


Member Data Documentation

int osg::Switch::_value [protected]
 

The current Switch value.


The documentation for this class was generated from the following file:
Generated at Wed Sep 18 13:55:43 2002 for the Open Scene Graph by doxygen 1.2.16.