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

openvrml::vrml97_node::viewpoint_class Class Reference

Class object for Viewpoint nodes. More...

Inheritance diagram for openvrml::vrml97_node::viewpoint_class:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

 viewpoint_class (openvrml::browser &browser)
 Construct.

virtual ~viewpoint_class () throw ()
 Destroy.

void set_first (viewpoint_node &viewpoint) throw ()
 Set the first Viewpoint node in the world.

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

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

void unbind (viewpoint_node &viewpoint, double timestamp) throw ()
 Remove a Viewpoint from the bound node stack.

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

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< viewpoint_node * > bound_nodes_t
 A stack of bound Viewpoint nodes.


Private Attributes

viewpoint_nodefirst
 The first Viewpoint node in the initial scene graph.

bound_nodes_t bound_nodes
 The stack of bound Viewpoint nodes.


Detailed Description

Class object for Viewpoint nodes.


Member Typedef Documentation

openvrml::vrml97_node::viewpoint_class::bound_nodes_t [private]
 

A stack of bound Viewpoint nodes.


Constructor & Destructor Documentation

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

Construct.

Parameters:
browser the browser associated with this node_class.

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

Destroy.


Member Function Documentation

void openvrml::vrml97_node::viewpoint_class::bind viewpoint_node viewpoint,
double  timestamp
throw (std::bad_alloc)
 

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

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

const node_type_ptr openvrml::vrml97_node::viewpoint_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 Viewpoint nodes.
Exceptions:
unsupported_interface if interfaces includes an interface not supported by viewpoint_class.
std::bad_alloc if memory allocation fails.

Implements openvrml::node_class.

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

Check to see if the first node has been set.

This method is used by viewpoint_node::do_initialize.

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

void openvrml::vrml97_node::viewpoint_class::initialize openvrml::viewpoint_node initial_viewpoint,
double  timestamp
throw () [virtual]
 

node_class-specific initialization.

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

Reimplemented from openvrml::node_class.

void openvrml::vrml97_node::viewpoint_class::set_first viewpoint_node viewpoint  )  throw ()
 

Set the first Viewpoint node in the world.

The first Viewpoint node in the world is used as the initial viewpoint. This method is used by viewpoint_node::do_initialize.

Parameters:
viewpoint a Viewpoint node.

void openvrml::vrml97_node::viewpoint_class::unbind viewpoint_node viewpoint,
double  timestamp
throw ()
 

Remove a Viewpoint from the bound node stack.

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

Member Data Documentation

viewpoint_class::bound_nodes_t openvrml::vrml97_node::viewpoint_class::bound_nodes [private]
 

The stack of bound Viewpoint nodes.

viewpoint_node * openvrml::vrml97_node::viewpoint_class::first [private]
 

The first Viewpoint node in the initial scene graph.