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

- Main Page
- Namespaces
- Classes
- Files
- Related Pages
- Examples

- Class List
- Class Hierarchy
- Class Members

# openvrml::geometry_node Class Reference

`#include <openvrml/node.h>`

Inheritance diagram for openvrml::geometry_node:

[legend]

List of all members.

## Detailed Description

Abstract base class for geometry nodes.

## Public Member Functions

virtual | ~geometry_node ()=0 throw ()
| Destroy.
viewer::object_t | render_geometry (viewer &v, rendering_context context)
| Insert geometry into a viewer.
bool | emissive () const throw ()
| Indicates whether the geometry should be drawn with the emissive color.
virtual const color_node * | color () const throw ()
| Get the color node (if any) associated with this geometry.

## Protected Member Functions

| geometry_node (const node_type &type, const boost::shared_ptr< openvrml::scope > &scope) throw ()
| Construct.

## Private Member Functions

virtual viewer::object_t | do_render_geometry (viewer &v, rendering_context context)
| `render_geometry` implementation.
virtual bool | do_emissive () const throw ()
| `emissive` implementation.
virtual geometry_node * | to_geometry () throw ()
| Cast to a `geometry_node`.

## Private Attributes

boost::mutex | geometry_reference_mutex_
| Mutex protecting `geometry_reference`.
viewer::object_t | geometry_reference
| Identifier for a geometry object in the renderer.

## Constructor & Destructor Documentation

openvrml::geometry_node::~geometry_node | ( |  | ) | throw ()`[pure virtual]`

Destroy.

Todo:
  Proper resource deallocation in the `viewer` depends on the `viewer` not having been decoupled from the `browser`. We need to handle this better via some refcounting scheme.

openvrml::geometry_node::geometry_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

openvrml::viewer::object_t openvrml::geometry_node::render_geometry | ( | viewer & | v,
|  | rendering_context | context |
| ) |  |  |

Insert geometry into a viewer.

Parameters:

  `[in,out]` | v | viewer.
  `[in]` | context | rendering context.

Returns:
  object identifier for the inserted geometry.

bool openvrml::geometry_node::emissive | ( |  | ) | const throw ()

Indicates whether the geometry should be drawn with the emissive color.

Returns:
  `true` if the geometry should be drawn with the emissive color; `false` otherwise (if the geometry should be drawn with the diffuse color).

const openvrml::color_node * openvrml::geometry_node::color | ( |  | ) | const throw ()`[virtual]`

Get the color node (if any) associated with this geometry.

Returns:
  the `color_node` associated associated with this geometry, or 0 if there is no such node.

Todo:
  Reevaluate the way the renderer visits geometry nodes; potentially eliminate this method.

openvrml::viewer::object_t openvrml::geometry_node::do_render_geometry | ( | viewer & | v,
|  | rendering_context | context |
| ) |  |  | `[private, virtual]`

`render_geometry` implementation.

Parameters:

  `[in,out]` | v | viewer.
  `[in]` | context | rendering context.

Returns:
  object identifier for the inserted geometry.

bool openvrml::geometry_node::do_emissive | ( |  | ) | const throw ()`[private, virtual]`

`emissive` implementation.

Returns:
  `false`.

openvrml::geometry_node * openvrml::geometry_node::to_geometry | ( |  | ) | throw ()`[private, virtual]`

Cast to a `geometry_node`.

Returns:
  a pointer to this `geometry_node`.

Reimplemented from openvrml::node.

## Member Data Documentation

boost::mutex openvrml::geometry_node::geometry_reference_mutex_ `[private]`

Mutex protecting `geometry_reference`.

For internal use only.

openvrml::viewer::object_t openvrml::geometry_node::geometry_reference `[private]`

Identifier for a geometry object in the renderer.

For internal use only.