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

openvrml::vrml97_node::background_class Class Reference

Class object for Background nodes. More...

Inheritance diagram for openvrml::vrml97_node::background_class:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

 background_class (openvrml::browser &browser)
 Construct.

virtual ~background_class () throw ()
 Destroy.

void set_first (background_node &background) throw ()
 Set the first Background node in the world.

bool has_first () const throw ()
 Check to see if the first node has been set.

void bind (background_node &background, double timestamp) throw (std::bad_alloc)
 Push a background_node on the top of the bound node stack.

void unbind (background_node &background, double timestamp) throw ()
 Remove a background_node from the bound node stack.

virtual void initialize (viewpoint_node *initialViewpoint, double timestamp) throw ()
 node_class-specific initialization.

virtual void render (openvrml::viewer &viewer) throw ()
 node_class-specific rendering.

virtual const node_type_ptr create_type (const std::string &id, const node_interface_set &) throw (unsupported_interface, std::bad_alloc)
 Create a node_type.


Private Types

typedef std::vector< background_node * > bound_nodes_t
 A bound Background node stack.


Private Attributes

background_nodefirst
 The first Background node in the initial scene graph.

bound_nodes_t bound_nodes
 The bound Background node stack.


Detailed Description

Class object for Background nodes.


Constructor & Destructor Documentation

openvrml::vrml97_node::background_class::background_class openvrml::browser browser  )  [explicit]
 

Construct.

Parameters:
browser the browser associated with this class object.

Member Function Documentation

void openvrml::vrml97_node::background_class::bind background_node background,
double  timestamp
throw (std::bad_alloc)
 

Push a background_node on the top of the bound node stack.

Parameters:
background the node to bind.
timestamp the current time.
Exceptions:
std::bad_alloc if memory allocation fails.

const node_type_ptr openvrml::vrml97_node::background_class::create_type const std::string &  id,
const node_interface_set interfaces
throw (unsupported_interface, std::bad_alloc) [virtual]
 

Create a node_type.

Parameters:
id the name for the new node_type.
interfaces the interfaces for the new node_type.
Returns:
a node_type_ptr to a node_type capable of creating Background nodes.
Exceptions:
unsupported_interface if interfaces includes an interface not supported by background_class.
std::bad_alloc if memory allocation fails.

Implements openvrml::node_class.

bool openvrml::vrml97_node::background_class::has_first  )  const throw ()
 

Check to see if the first node has been set.

This method is used by background_node::do_initialize.

Returns:
true if the first node has already been set; false otherwise.

void openvrml::vrml97_node::background_class::initialize openvrml::viewpoint_node initialViewpoint,
double  timestamp
throw () [virtual]
 

node_class-specific initialization.

Parameters:
initialViewpoint the viewpoint_node that should be bound initially.
timestamp the current time.

Reimplemented from openvrml::node_class.

void openvrml::vrml97_node::background_class::render openvrml::viewer viewer  )  throw () [virtual]
 

node_class-specific rendering.

Render the active Background node.

Parameters:
viewer a Viewer.

Reimplemented from openvrml::node_class.

void openvrml::vrml97_node::background_class::set_first background_node background  )  throw ()
 

Set the first Background node in the world.

The first Background node in the world is used as the initial background. This method is used by Background::do_initialize.

Parameters:
background a Background node.

void openvrml::vrml97_node::background_class::unbind background_node background,
double  timestamp
throw ()
 

Remove a background_node from the bound node stack.

Parameters:
background the node to unbind.
timestamp the current time.