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

# openvrml::bounded_volume_node Class Reference

Abstract base class for nodes that represent a bounded volume in the scene graph. More...

`#include <openvrml/node.h>`

Inheritance diagram for openvrml::bounded_volume_node:
[legend]

List of all members.

## Public Member Functions

virtual | ~bounded_volume_node () throw ()
| Destroy.
const openvrml::bounding_volume & | bounding_volume () const
| Get this node's bounding volume.

## Protected Member Functions

| bounded_volume_node (const node_type &type, const boost::shared_ptr< openvrml::scope > &scope) throw ()
| Construct.
void | bounding_volume_dirty (bool value)
| Set whether the node's bounding volume needs to be recalculated.
bool | bounding_volume_dirty () const
| Whether the node's bounding volume needs to be recalculated.
virtual const openvrml::bounding_volume & | do_bounding_volume () const
| Called by `bounding_volume`.

## Private Member Functions

virtual bounded_volume_node * | to_bounded_volume () throw ()
| Cast to an `bounded_volume_node`.

## Private Attributes

boost::shared_mutex | bounding_volume_dirty_mutex_
| Mutex protecting `bounding_volume_dirty_`.
bool | bounding_volume_dirty_
| Indicate whether the `node`'s cached bounding volume needs updating.

## Detailed Description

Abstract base class for nodes that represent a bounded volume in the scene graph.

## Constructor & Destructor Documentation

openvrml::bounded_volume_node::~bounded_volume_node | ( |  | ) | throw ()`[virtual]`

Destroy.

openvrml::bounded_volume_node::bounded_volume_node | ( | const node_type & | type,
|  | const boost::shared_ptr< openvrml::scope > & | scope |
| ) |  |  | throw ()`[protected]`

Construct.

Parameters:

  `[in]` | type | the `node_type` associated with the node.
  `[in]` | scope | the `scope` the node belongs to.

## Member Function Documentation

const openvrml::bounding_volume & openvrml::bounded_volume_node::bounding_volume | ( |  | ) | const

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.

Delegates to `do_bounding_volume`.

Returns:
  a maximized bounding volume.

void openvrml::bounded_volume_node::bounding_volume_dirty | ( | bool | value | ) | `[protected]`

Set whether the node's bounding volume needs to be recalculated.

Indicate that a node's bounding volume needs to be recalculated (or not). If a node's bounding volume is invalid, then the bounding volumes of all that node's ancestors are also invalid. Normally, the node itself will determine when its bounding volume needs updating.

Parameters:

  `[in]` | value | `true` if the node's bounding volume should be recalculated; `false` otherwise.

bool openvrml::bounded_volume_node::bounding_volume_dirty | ( |  | ) | const`[protected]`

Whether the node's bounding volume needs to be recalculated.

Returns:
  `true` if the node's bounding volume needs to be recalculated; `false` otherwise.

const openvrml::bounding_volume & openvrml::bounded_volume_node::do_bounding_volume | ( |  | ) | const`[protected, virtual]`

Called by `bounding_volume`.

Returns:
  a maximized bounding volume.

openvrml::bounded_volume_node * openvrml::bounded_volume_node::to_bounded_volume | ( |  | ) | throw ()`[private, virtual]`

Cast to an `bounded_volume_node`.

Returns:
  a pointer to this `bounded_volume_node`.

Reimplemented from openvrml::node.

## Member Data Documentation

boost::shared_mutex openvrml::bounded_volume_node::bounding_volume_dirty_mutex_`[mutable, private]`

Mutex protecting `bounding_volume_dirty_`.

For internal use only.

bool openvrml::bounded_volume_node::bounding_volume_dirty_`[mutable, private]`

Indicate whether the `node`'s cached bounding volume needs updating.

For internal use only.