Home | Download | Screen shots | Discussion | Documentation |
---|
A class object for node instances. More...
#include <openvrml/node.h>
Public Member Functions | |
virtual | ~node_metatype ()=0 throw () |
Destructor. | |
const node_metatype_id & | id () const throw () |
Identifier. | |
openvrml::browser & | browser () const throw () |
The browser associated with this node_metatype . | |
void | initialize (viewpoint_node *initial_viewpoint, double time) throw () |
node_metatype -specific initialization. | |
void | render (viewer &v) const throw () |
node_metatype -specific rendering. | |
const boost::shared_ptr < node_type > | create_type (const std::string &id, const node_interface_set &interfaces) throw ( unsupported_interface , std::bad_alloc ) |
Create a new node_type . | |
void | shutdown (double time) throw () |
Shut down. |
Protected Member Functions | |
node_metatype (const node_metatype_id &id, openvrml::browser &b) throw () | |
Constructor. |
Private Member Functions | |
virtual void | do_initialize (viewpoint_node *initial_viewpoint, double time) throw () |
node_metatype -specific initialization. | |
virtual void | do_render (viewer &v) const throw () |
node_metatype -specific rendering. | |
virtual const boost::shared_ptr< node_type > | do_create_type (const std::string &id, const node_interface_set &interfaces) const =0 throw ( unsupported_interface , std::bad_alloc ) |
Create a new node_type . | |
virtual void | do_shutdown (double time) throw () |
Shut down. |
A class object for node instances.
node_metatype
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_metatype
object for a node implementation is to serve as a factory for these node_types
.
|
pure virtual |
Destructor.
|
explicitprotected |
Constructor.
A node_metatype
is constructed using a browser
. All node
instances that share a particular node_metatype
“belong to” the browser
associated with the node_metatype
.
[in] | id | an identifier unique to b . |
[in] | b | the browser to be associated with the node_metatype . |
const openvrml::node_metatype_id & openvrml::node_metatype::id | ( | ) | const throw () |
Identifier.
node_metatype
identifier. openvrml::browser & openvrml::node_metatype::browser | ( | ) | const throw () |
The browser
associated with this node_metatype
.
browser
associated with this node_metatype
. void openvrml::node_metatype::initialize | ( | viewpoint_node * | initial_viewpoint, |
double | time | ||
) | throw () |
node_metatype
-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. It delegates to do_initialize
.
[in,out] | initial_viewpoint | the viewpoint_node that should be bound initially; or 0 if the default viewpoint_node should be bound. |
[in] | time | the current time. |
void openvrml::node_metatype::render | ( | viewer & | v | ) | const throw () |
node_metatype
-specific rendering.
This function delegates to do_render
.
[in,out] | v | the viewer to which to render. |
const boost::shared_ptr< openvrml::node_type > openvrml::node_metatype::create_type | ( | const std::string & | id, |
const node_interface_set & | interfaces | ||
) | throw ( unsupported_interface , std::bad_alloc ) |
Create a new node_type
.
node_types
can be said to subset the master type provided by the node_metatype
. Each node_metatype
instance can support certain node
interfaces; the node_interface_set
passed to create_type
must be a subset of those supported interfaces.
This function delegates to do_create_type
.
[in] | id | the name for the new node_type . |
[in] | interfaces | a node_interface_set containing the interfaces for the new type. |
node_type
.unsupported_interface | if the node_metatype cannot support one of the node_interfaces in interfaces . |
std::bad_alloc | if memory allocation fails. |
void openvrml::node_metatype::shutdown | ( | double | time | ) | throw () |
Shut down.
This function is called during destruction of the browser
, after the root scene
has been shut down. This function delegates to do_shutdown
.
[in] | time | the current time. |
|
privatevirtual |
node_metatype
-specific initialization.
Node implementations should override this method to perform any node_metatype
-wide initialization.
[in,out] | initial_viewpoint | the viewpoint_node that should be bound initially; or 0 if the default viewpoint_node should be bound. |
[in] | time | the current time. |
|
privatevirtual |
node_metatype
-specific rendering.
The default implementation of this method does nothing.
[in,out] | v | the viewer to which to render. |
|
privatepure virtual |
Create a new node_type
.
[in] | id | the name for the new node_type . |
[in] | interfaces | a node_interface_set containing the interfaces for the new type. |
node_type
.unsupported_interface | if the node_metatype cannot support one of the node_interfaces in interfaces . |
std::bad_alloc | if memory allocation fails. |
|
privatevirtual |