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

openvrml::node_class Class Reference

A class object for node instances. More...

Inheritance diagram for openvrml::node_class:

Inheritance graph
[legend]
Collaboration diagram for openvrml::node_class:

Collaboration graph
[legend]
List of all members.

Public Member Functions

virtual ~node_class ()=0 throw ()
 Destructor.

virtual void initialize (viewpoint_node *initial_viewpoint, double time) 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 &interfaces)=0 throw (unsupported_interface, std::bad_alloc)
 Create a new node_type.


Public Attributes

openvrml::browserbrowser
 The browser associated with this node_class.


Protected Member Functions

 node_class (openvrml::browser &b) throw ()
 Constructor.


Detailed Description

A class object for node instances.

node_class can be thought of as a "supertype" of sorts. A given node implementation can support as many node types as there are unique combinations of the interfaces it supports. The most readily apparent role of the node_class object for a node implementation is to serve as a factory for these node_types.


Constructor & Destructor Documentation

openvrml::node_class::node_class openvrml::browser b  )  throw () [explicit, protected]
 

Constructor.

A node_class is constructed using a browser. All node instances that share a particular node_class "belong to" the browser associated with the node_class.

Parameters:
b the browser to be associated with the node_class.

Member Function Documentation

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

Create a new node_type.

node_types can be said to subset the master type provided by the node_class. Each node_class instance can support certain node interfaces; the node_interface_set passed to createType must be a subset of those supported interfaces.

Parameters:
id the name for the new node_type.
interfaces a node_interface_set containing the interfaces for the new type.
Returns:
a node_type_ptr to the newly created node_type.
Exceptions:
std::invalid_argument if the node_class cannot support one of the node_interfaces in interfaces.
std::bad_alloc if memory allocation fails.

Implemented in openvrml::script_node_class, openvrml::vrml97_node::group_class, openvrml::vrml97_node::anchor_class, openvrml::vrml97_node::appearance_class, openvrml::vrml97_node::audio_clip_class, openvrml::vrml97_node::background_class, openvrml::vrml97_node::billboard_class, openvrml::vrml97_node::box_class, openvrml::vrml97_node::collision_class, openvrml::vrml97_node::color_class, openvrml::vrml97_node::color_interpolator_class, openvrml::vrml97_node::cone_class, openvrml::vrml97_node::coordinate_class, openvrml::vrml97_node::coordinate_interpolator_class, openvrml::vrml97_node::cylinder_class, openvrml::vrml97_node::cylinder_sensor_class, openvrml::vrml97_node::directional_light_class, openvrml::vrml97_node::elevation_grid_class, openvrml::vrml97_node::extrusion_class, openvrml::vrml97_node::fog_class, openvrml::vrml97_node::font_style_class, openvrml::vrml97_node::image_texture_class, openvrml::vrml97_node::indexed_face_set_class, openvrml::vrml97_node::indexed_line_set_class, openvrml::vrml97_node::inline_class, openvrml::vrml97_node::lod_class, openvrml::vrml97_node::material_class, openvrml::vrml97_node::movie_texture_class, openvrml::vrml97_node::navigation_info_class, openvrml::vrml97_node::normal_class, openvrml::vrml97_node::normal_interpolator_class, openvrml::vrml97_node::orientation_interpolator_class, openvrml::vrml97_node::pixel_texture_class, openvrml::vrml97_node::plane_sensor_class, openvrml::vrml97_node::point_light_class, openvrml::vrml97_node::point_set_class, openvrml::vrml97_node::position_interpolator_class, openvrml::vrml97_node::proximity_sensor_class, openvrml::vrml97_node::scalar_interpolator_class, openvrml::vrml97_node::shape_class, openvrml::vrml97_node::sound_class, openvrml::vrml97_node::sphere_class, openvrml::vrml97_node::sphere_sensor_class, openvrml::vrml97_node::spot_light_class, openvrml::vrml97_node::switch_class, openvrml::vrml97_node::text_class, openvrml::vrml97_node::texture_coordinate_class, openvrml::vrml97_node::texture_transform_class, openvrml::vrml97_node::time_sensor_class, openvrml::vrml97_node::touch_sensor_class, openvrml::vrml97_node::transform_class, openvrml::vrml97_node::viewpoint_class, openvrml::vrml97_node::visibility_sensor_class, and openvrml::vrml97_node::world_info_class.

void openvrml::node_class::initialize viewpoint_node initial_viewpoint,
double  time
throw () [virtual]
 

node_class-specific initialization.

This method is called during initialization of a browser object with a new root Scene. It is called after the individual node instances have been initialized, and before the world starts running.

Parameters:
initial_viewpoint the viewpoint_node that should be bound initially; or 0 if the default viewpoint_node should be bound.
time the current time.

Reimplemented in openvrml::vrml97_node::background_class, openvrml::vrml97_node::fog_class, and openvrml::vrml97_node::viewpoint_class.

void openvrml::node_class::render openvrml::viewer viewer  )  throw () [virtual]
 

node_class-specific rendering.

The default implementation of this method does nothing.

Parameters:
viewer the viewer to render to.

Reimplemented in openvrml::vrml97_node::background_class, and openvrml::vrml97_node::fog_class.