Home | Download | Screen shots | Discussion | Documentation
--- | --- | --- | --- | ---

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

# openvrml::vrml97_node::viewpoint_class Class Reference

Inheritance diagram for openvrml::vrml97_node::viewpoint_class:

[legend]
List of all members.

## Detailed Description

Class object for Viewpoint nodes.

## 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 | do_initialize (openvrml::viewpoint_node *initial_viewpoint, double timestamp) throw ()
| node_class-specific initialization.

## Private Types

typedef std::vector< viewpoint_node * > | bound_nodes_t
| A stack of bound Viewpoint nodes.

## Private Member Functions

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

## Private Attributes

viewpoint_node * | first
| The first Viewpoint node in the initial scene graph.
bound_nodes_t | bound_nodes
| The stack of bound 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::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.

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::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.

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.

void openvrml::vrml97_node::viewpoint_class::do_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.

const node_type_ptr openvrml::vrml97_node::viewpoint_class::do_create_type | ( | const std::string & | id,
|  | const node_interface_set & | interfaces
| ) | const throw (unsupported_interface, std::bad_alloc)`[private, 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.

## Member Data Documentation

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

| The first Viewpoint node in the initial scene graph.

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

| The stack of bound Viewpoint nodes.