Home | Download | Screen shots | Discussion | Documentation |
---|
Public Member Functions | |
virtual | ~node ()=0 throw () |
Destructor. | |
const node_type & | type () const throw () |
The type information object for the node. | |
const std::string & | id () const throw () |
Retrieve the name of this node. | |
void | id (const std::string &node_id) throw (std::bad_alloc) |
Set the name of the node. | |
const boost::shared_ptr < openvrml::scope > & | scope () const throw () |
Get the scope to which the node belongs. | |
openvrml::scene * | scene () const throw () |
Get the scene with which the node is associated. | |
std::ostream & | print (std::ostream &out, size_t indent) const |
Pretty print. | |
void | initialize (openvrml::scene &scene, double timestamp) throw (std::bad_alloc) |
Initialize the node. | |
const field_value & | field (const std::string &id) const throw (unsupported_interface) |
Generalized field accessor. | |
openvrml::event_listener & | event_listener (const std::string &id) throw (unsupported_interface) |
Get an event listener. | |
openvrml::event_emitter & | event_emitter (const std::string &id) throw (unsupported_interface) |
Get an event emitter. | |
void | shutdown (double timestamp) throw () |
Shut down the node. | |
virtual vrml97_node::anchor_node * | to_anchor () const |
Cast to an anchor_node. | |
virtual vrml97_node::audio_clip_node * | to_audio_clip () const |
Cast to an audio_clip_node. | |
virtual vrml97_node::cylinder_sensor_node * | to_cylinder_sensor () const |
Cast to a cylinder_sensor_node. | |
virtual vrml97_node::abstract_light_node * | to_light () const |
Cast to an abstract_light_node. | |
virtual vrml97_node::movie_texture_node * | to_movie_texture () const |
Cast to a movie_texture_node. | |
virtual vrml97_node::navigation_info_node * | to_navigation_info () const |
Cast to a navigation_info_node. | |
virtual vrml97_node::plane_sensor_node * | to_plane_sensor () const |
Cast to a plane_sensor_node. | |
virtual vrml97_node::point_light_node * | to_point_light () const |
Cast to a point_light_node. | |
virtual vrml97_node::sphere_sensor_node * | to_sphere_sensor () const |
Cast to a sphere_sensor_node. | |
virtual vrml97_node::spot_light_node * | to_spot_light () const |
Cast to a spot_light_node. | |
virtual vrml97_node::time_sensor_node * | to_time_sensor () const |
Cast to a time_sensor_node. | |
virtual vrml97_node::touch_sensor_node * | to_touch_sensor () const |
Cast to a touch_sensor_node. | |
virtual bool | modified () const |
Determine whether the node has been modified. | |
void | modified (bool value) |
Set the modified flag. | |
virtual void | bounding_volume (const openvrml::bounding_volume &v) |
virtual const openvrml::bounding_volume & | bounding_volume () const |
Get this node's bounding volume. | |
virtual void | bounding_volume_dirty (bool f) |
virtual bool | bounding_volume_dirty () const |
Protected Member Functions | |
node (const node_type &type, const boost::shared_ptr< openvrml::scope > &scope) throw () | |
Construct. | |
Static Protected Member Functions | |
static void | emit_event (openvrml::event_emitter &emitter, double timestamp) throw (std::bad_alloc) |
Emit an event. | |
Private Member Functions | |
virtual void | do_initialize (double timestamp) throw (std::bad_alloc) |
node subclass-specific initialization. | |
virtual const field_value & | do_field (const std::string &id) const =0 throw (unsupported_interface) |
Called by node::field to get a field. | |
virtual openvrml::event_listener & | do_event_listener (const std::string &id)=0 throw (unsupported_interface) |
Get an event listener. | |
virtual openvrml::event_emitter & | do_event_emitter (const std::string &id)=0 throw (unsupported_interface) |
Get an event emitter. | |
virtual void | do_shutdown (double timestamp) throw () |
Called by node::shutdown. | |
virtual script_node * | to_script () throw () |
Cast to a script_node. | |
virtual appearance_node * | to_appearance () throw () |
Cast to an appearance_node. | |
virtual child_node * | to_child () throw () |
Cast to a child_node. | |
virtual color_node * | to_color () throw () |
Cast to a color_node. | |
virtual coordinate_node * | to_coordinate () throw () |
Cast to a coordinate_node. | |
virtual font_style_node * | to_font_style () throw () |
Cast to a font_style_node. | |
virtual geometry_node * | to_geometry () throw () |
Cast to a geometry_node. | |
virtual grouping_node * | to_grouping () throw () |
Cast to a grouping_node. | |
virtual material_node * | to_material () throw () |
Cast to a material_node. | |
virtual normal_node * | to_normal () throw () |
Cast to a normal_node. | |
virtual sound_source_node * | to_sound_source () throw () |
Cast to a sound_source_node. | |
virtual texture_node * | to_texture () throw () |
Cast to a texture_node. | |
virtual texture_coordinate_node * | to_texture_coordinate () throw () |
Cast to a texture_coordinate_node. | |
virtual texture_transform_node * | to_texture_transform () throw () |
Cast to a texture_transform_node. | |
virtual transform_node * | to_transform () throw () |
Cast to a transform_node. | |
virtual viewpoint_node * | to_viewpoint () throw () |
Cast to a viewpoint_node. | |
Private Attributes | |
const node_type & | type_ |
The type information object for the node. | |
boost::shared_ptr < openvrml::scope > | scope_ |
The scope to which the node belongs. | |
openvrml::scene * | scene_ |
The scene with which the node is associated. | |
bool | modified_ |
Indicate whether the node has been modified. | |
bool | bounding_volume_dirty_ |
Indicate whether the node's cached bounding volume needs updating. | |
Friends | |
class | exposedfield< sfbool > |
class | exposedfield< sfcolor > |
class | exposedfield< sffloat > |
class | exposedfield< sfimage > |
class | exposedfield< sfint32 > |
class | exposedfield< sfnode > |
class | exposedfield< sfrotation > |
class | exposedfield< sfstring > |
class | exposedfield< sftime > |
class | exposedfield< sfvec2f > |
class | exposedfield< sfvec3f > |
class | exposedfield< mfcolor > |
class | exposedfield< mffloat > |
class | exposedfield< mfint32 > |
class | exposedfield< mfnode > |
class | exposedfield< mfrotation > |
class | exposedfield< mfstring > |
class | exposedfield< mftime > |
class | exposedfield< mfvec2f > |
class | exposedfield< mfvec3f > |
std::ostream & | operator<< (std::ostream &out, const node &n) |
Stream output. | |
script_node * | node_cast (node *n) throw () |
Downcast a node to one of the abstract node types. | |
appearance_node * | node_cast (node *n) throw () |
child_node * | node_cast (node *n) throw () |
color_node * | node_cast (node *n) throw () |
coordinate_node * | node_cast (node *n) throw () |
font_style_node * | node_cast (node *n) throw () |
geometry_node * | node_cast (node *n) throw () |
grouping_node * | node_cast (node *n) throw () |
material_node * | node_cast (node *n) throw () |
normal_node * | node_cast (node *n) throw () |
sound_source_node * | node_cast (node *n) throw () |
texture_node * | node_cast (node *n) throw () |
texture_coordinate_node * | node_cast (node *n) throw () |
texture_transform_node * | node_cast (node *n) throw () |
transform_node * | node_cast (node *n) throw () |
viewpoint_node * | node_cast (node *n) throw () |
openvrml::node::~node | ( | ) | throw () [pure virtual] |
openvrml::node::node | ( | const node_type & | type, | |
const boost::shared_ptr< openvrml::scope > & | scope | |||
) | throw () [protected] |
const node_type & openvrml::node::type | ( | ) | const throw () |
const std::string & openvrml::node::id | ( | ) | const throw () |
void openvrml::node::id | ( | const std::string & | node_id | ) | throw (std::bad_alloc) |
const boost::shared_ptr< scope > & openvrml::node::scope | ( | ) | const throw () [inline] |
openvrml::scene * openvrml::node::scene | ( | ) | const throw () [inline] |
std::ostream & openvrml::node::print | ( | std::ostream & | out, | |
size_t | indent | |||
) | const |
Pretty print.
out | output stream. | |
indent | number of spaces per indentation level. |
out
. void openvrml::node::initialize | ( | openvrml::scene & | scene, | |
double | timestamp | |||
) | throw (std::bad_alloc) |
const field_value & openvrml::node::field | ( | const std::string & | id | ) | const throw (unsupported_interface) |
Generalized field accessor.
id | the name of the field. |
unsupported_interface | if the node has no field named id . |
event_listener & openvrml::node::event_listener | ( | const std::string & | id | ) | throw (unsupported_interface) |
Get an event listener.
id | an eventIn identifier. |
unsupported_interface | if the node has no eventIn id . |
event_emitter & openvrml::node::event_emitter | ( | const std::string & | id | ) | throw (unsupported_interface) |
Get an event emitter.
id | an eventOut identifier. |
unsupported_interface | if the node has no eventOut id . |
void openvrml::node::shutdown | ( | double | timestamp | ) | throw () |
vrml97_node::anchor_node * openvrml::node::to_anchor | ( | ) | const [virtual] |
vrml97_node::audio_clip_node * openvrml::node::to_audio_clip | ( | ) | const [virtual] |
vrml97_node::cylinder_sensor_node * openvrml::node::to_cylinder_sensor | ( | ) | const [virtual] |
Cast to a cylinder_sensor_node.
Reimplemented in openvrml::vrml97_node::cylinder_sensor_node.
vrml97_node::abstract_light_node * openvrml::node::to_light | ( | ) | const [virtual] |
Cast to an abstract_light_node.
Reimplemented in openvrml::vrml97_node::abstract_light_node.
vrml97_node::movie_texture_node * openvrml::node::to_movie_texture | ( | ) | const [virtual] |
Cast to a movie_texture_node.
Reimplemented in openvrml::vrml97_node::movie_texture_node.
vrml97_node::navigation_info_node * openvrml::node::to_navigation_info | ( | ) | const [virtual] |
Cast to a navigation_info_node.
Reimplemented in openvrml::vrml97_node::navigation_info_node.
vrml97_node::plane_sensor_node * openvrml::node::to_plane_sensor | ( | ) | const [virtual] |
vrml97_node::point_light_node * openvrml::node::to_point_light | ( | ) | const [virtual] |
vrml97_node::sphere_sensor_node * openvrml::node::to_sphere_sensor | ( | ) | const [virtual] |
Cast to a sphere_sensor_node.
Reimplemented in openvrml::vrml97_node::sphere_sensor_node.
vrml97_node::spot_light_node * openvrml::node::to_spot_light | ( | ) | const [virtual] |
vrml97_node::time_sensor_node * openvrml::node::to_time_sensor | ( | ) | const [virtual] |
vrml97_node::touch_sensor_node * openvrml::node::to_touch_sensor | ( | ) | const [virtual] |
bool openvrml::node::modified | ( | ) | const [virtual] |
Determine whether the node has been modified.
The default implementation returns whether this node has been modified. Subclasses that can have child nodes should override this method and return true
if any of their children have been modified.
true
if the node has been modified; false
otherwise. Reimplemented in openvrml::vrml97_node::abstract_indexed_set_node, openvrml::vrml97_node::group_node, openvrml::vrml97_node::appearance_node, openvrml::vrml97_node::collision_node, openvrml::vrml97_node::elevation_grid_node, openvrml::vrml97_node::indexed_face_set_node, openvrml::vrml97_node::lod_node, openvrml::vrml97_node::point_set_node, openvrml::vrml97_node::shape_node, openvrml::vrml97_node::switch_node, and openvrml::vrml97_node::text_node.
void openvrml::node::modified | ( | bool | value | ) |
void openvrml::node::bounding_volume | ( | const openvrml::bounding_volume & | v | ) | [virtual] |
const bounding_volume & openvrml::node::bounding_volume | ( | ) | const [virtual] |
Get this node's bounding volume.
Nodes that have no bounding volume, or have a difficult to calculate bvolume (like, say, Extrusion or Billboard) can just return an infinite bsphere. Note that returning an infinite bvolume means that all the node's ancestors will also end up with an infinite bvolume, and will never be culled.
Reimplemented in openvrml::vrml97_node::group_node, openvrml::vrml97_node::anchor_node, openvrml::vrml97_node::box_node, openvrml::vrml97_node::indexed_face_set_node, openvrml::vrml97_node::lod_node, openvrml::vrml97_node::point_set_node, openvrml::vrml97_node::shape_node, openvrml::vrml97_node::sphere_node, openvrml::vrml97_node::switch_node, and openvrml::vrml97_node::transform_node.
void openvrml::node::bounding_volume_dirty | ( | bool | f | ) | [virtual] |
Indicate that a node's bounding volume needs to be recalculated (or not). If a node's bvolume is invalid, then the bvolumes of all that node's ancestors are also invalid. Normally, the node itself will determine when its bvolume needs updating.
bool openvrml::node::bounding_volume_dirty | ( | ) | const [virtual] |
Return true if the node's bounding volume needs to be recalculated.
void openvrml::node::emit_event | ( | openvrml::event_emitter & | emitter, | |
double | timestamp | |||
) | throw (std::bad_alloc) [static, protected] |
Emit an event.
emitter | an event_emitter. | |
timestamp | the current time. |
std::bad_alloc | if memory allocation fails. |
void openvrml::node::do_initialize | ( | double | timestamp | ) | throw (std::bad_alloc) [private, virtual] |
node subclass-specific initialization.
This method is called by node::initialize. Subclasses of node should override this method for any subclass-specific initialization.
The default implementation of this method does nothing.
timestamp | the current time. |
std::bad_alloc | if memory allocation fails. |
Reimplemented in openvrml::script_node, openvrml::vrml97_node::audio_clip_node, openvrml::vrml97_node::background_node, openvrml::vrml97_node::fog_node, openvrml::vrml97_node::movie_texture_node, openvrml::vrml97_node::navigation_info_node, openvrml::vrml97_node::point_light_node, openvrml::vrml97_node::spot_light_node, openvrml::vrml97_node::text_node, openvrml::vrml97_node::time_sensor_node, and openvrml::vrml97_node::viewpoint_node.
const field_value & openvrml::node::do_field | ( | const std::string & | id | ) | const throw (unsupported_interface) [private, pure virtual] |
Called by node::field to get a field.
id | field identifier. |
unsupported_interface | if the node has no field id . |
Implemented in openvrml::script_node, and openvrml::vrml97_node::abstract_base.
event_listener & openvrml::node::do_event_listener | ( | const std::string & | id | ) | throw (unsupported_interface) [private, pure virtual] |
Get an event listener.
This method is called by node::event_listener. Subclasses must implement this method.
id | eventIn identifier. |
unsupported_interface | if the node has no eventIn id . |
Implemented in openvrml::script_node, and openvrml::vrml97_node::abstract_base.
event_emitter & openvrml::node::do_event_emitter | ( | const std::string & | id | ) | throw (unsupported_interface) [private, pure virtual] |
Get an event emitter.
This method is called by node::event_emitter. Subclasses must implement this method.
id | eventOut identifier. |
unsupported_interface | if the node has no eventOut id . |
Implemented in openvrml::script_node, and openvrml::vrml97_node::abstract_base.
void openvrml::node::do_shutdown | ( | double | timestamp | ) | throw () [private, virtual] |
Called by node::shutdown.
node subclass-specific shut down.
timestamp | the current time. |
The default implementation of this method does nothing.
timestamp | the current time. |
Reimplemented in openvrml::script_node, openvrml::vrml97_node::audio_clip_node, openvrml::vrml97_node::background_node, openvrml::vrml97_node::fog_node, openvrml::vrml97_node::movie_texture_node, openvrml::vrml97_node::navigation_info_node, openvrml::vrml97_node::point_light_node, openvrml::vrml97_node::spot_light_node, openvrml::vrml97_node::text_node, openvrml::vrml97_node::time_sensor_node, and openvrml::vrml97_node::viewpoint_node.
script_node * openvrml::node::to_script | ( | ) | throw () [private, virtual] |
Cast to a script_node.
For internal use only.
Default implementation returns 0.
Reimplemented in openvrml::script_node.
appearance_node * openvrml::node::to_appearance | ( | ) | throw () [private, virtual] |
Cast to an appearance_node.
For internal use only.
Default implementation returns 0.
Reimplemented in openvrml::appearance_node.
child_node * openvrml::node::to_child | ( | ) | throw () [private, virtual] |
Cast to a child_node.
For internal use only.
Default implementation returns 0.
Reimplemented in openvrml::child_node.
color_node * openvrml::node::to_color | ( | ) | throw () [private, virtual] |
Cast to a color_node.
For internal use only.
Default implementation returns 0.
Reimplemented in openvrml::color_node.
coordinate_node * openvrml::node::to_coordinate | ( | ) | throw () [private, virtual] |
Cast to a coordinate_node.
For internal use only.
Default implementation returns 0.
Reimplemented in openvrml::coordinate_node.
font_style_node * openvrml::node::to_font_style | ( | ) | throw () [private, virtual] |
Cast to a font_style_node.
For internal use only.
Default implementation returns 0.
Reimplemented in openvrml::font_style_node.
geometry_node * openvrml::node::to_geometry | ( | ) | throw () [private, virtual] |
Cast to a geometry_node.
For internal use only.
Default implementation returns 0.
Reimplemented in openvrml::geometry_node.
grouping_node * openvrml::node::to_grouping | ( | ) | throw () [private, virtual] |
Cast to a grouping_node.
For internal use only.
Default implementation returns 0.
Reimplemented in openvrml::grouping_node.
material_node * openvrml::node::to_material | ( | ) | throw () [private, virtual] |
Cast to a material_node.
For internal use only.
Default implementation returns 0.
Reimplemented in openvrml::material_node.
normal_node * openvrml::node::to_normal | ( | ) | throw () [private, virtual] |
Cast to a normal_node.
For internal use only.
Default implementation returns 0.
Reimplemented in openvrml::normal_node.
sound_source_node * openvrml::node::to_sound_source | ( | ) | throw () [private, virtual] |
Cast to a sound_source_node.
For internal use only.
Default implementation returns 0.
Reimplemented in openvrml::sound_source_node.
texture_node * openvrml::node::to_texture | ( | ) | throw () [private, virtual] |
Cast to a texture_node.
For internal use only.
Default implementation returns 0.
Reimplemented in openvrml::texture_node.
texture_coordinate_node * openvrml::node::to_texture_coordinate | ( | ) | throw () [private, virtual] |
Cast to a texture_coordinate_node.
For internal use only.
Default implementation returns 0.
Reimplemented in openvrml::texture_coordinate_node.
texture_transform_node * openvrml::node::to_texture_transform | ( | ) | throw () [private, virtual] |
Cast to a texture_transform_node.
For internal use only.
Default implementation returns 0.
Reimplemented in openvrml::texture_transform_node.
transform_node * openvrml::node::to_transform | ( | ) | throw () [private, virtual] |
Cast to a transform_node.
For internal use only.
Default implementation returns 0.
Reimplemented in openvrml::transform_node.
viewpoint_node * openvrml::node::to_viewpoint | ( | ) | throw () [private, virtual] |
Cast to a viewpoint_node.
For internal use only.
Default implementation returns 0.
Reimplemented in openvrml::viewpoint_node.
std::ostream & openvrml::node::operator<< | ( | std::ostream & | out, | |
const node & | n | |||
) | [friend] |
openvrml::node::type_ [private] |
The type information object for the node.
For internal use only.
Reimplemented in openvrml::vrml97_node::navigation_info_node.
scope_ptr openvrml::node::scope_ [private] |
scene * openvrml::node::scene_ [private] |
bool openvrml::node::modified_ [private] |
bool openvrml::node::bounding_volume_dirty_ [private] |
Indicate whether the node's cached bounding volume needs updating.
For internal use only.