Main Page   Namespace List   Class Hierarchy   Compound List   Namespace Members   Compound Members   Related Pages  

NodeClass Class Reference

A class object for Node instances. More...

Inheritance diagram for NodeClass:

ScriptNodeClass AnchorClass AppearanceClass AudioClipClass BackgroundClass BillboardClass BoxClass CollisionClass ColorClass ColorInterpolatorClass ConeClass CoordinateClass CoordinateInterpolatorClass CylinderClass CylinderSensorClass DirectionalLightClass ElevationGridClass ExtrusionClass FogClass FontStyleClass GroupClass ImageTextureClass IndexedFaceSetClass IndexedLineSetClass InlineClass LODClass MaterialClass MovieTextureClass NavigationInfoClass NormalClass NormalInterpolatorClass OrientationInterpolatorClass PixelTextureClass PlaneSensorClass PointLightClass PointSetClass PositionInterpolatorClass ProximitySensorClass ScalarInterpolatorClass ShapeClass SoundClass SphereClass SphereSensorClass SpotLightClass SwitchClass TextClass TextureCoordinateClass TextureTransformClass TimeSensorClass TouchSensorClass TransformClass ViewpointClass VisibilitySensorClass WorldInfoClass List of all members.

Public Methods

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

virtual void initialize (double time) throw ()
 NodeClass-specific initialization.

virtual void render (Viewer &viewer) throw ()
 NodeClass-specific rendering.

virtual const NodeTypePtr createType (const std::string &id, const NodeInterfaceSet &interfaces)=0 throw (UnsupportedInterface, std::bad_alloc)
 Create a new NodeType.


Public Attributes

Browserbrowser
 The Browser associated with this NodeClass.


Protected Methods

 NodeClass (Browser &browser) throw ()
 Constructor.


Detailed Description

A class object for Node instances.

NodeClass 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 NodeClass object for a node implementation is to serve as a factory for these NodeTypes.


Constructor & Destructor Documentation

~NodeClass   throw () [pure virtual]
 

Destructor.

NodeClass Browser   browser throw () [explicit, protected]
 

Constructor.

A NodeClass is constructed using a Browser. All Node instances that share a particular NodeClass "belong to" the Browser associated with the NodeClass.

Parameters:
browser the Browser to be associated with the NodeClass.

Member Function Documentation

const NodeTypePtr createType const std::string &    id,
const NodeInterfaceSet   interfaces
throw (UnsupportedInterface, std::bad_alloc) [pure virtual]
 

Create a new NodeType.

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

Parameters:
id the name for the new NodeType.
interfaces a NodeInterfaceSet containing the interfaces for the new type.
Returns:
a NodeTypePtr to the newly created NodeType.
Exceptions:
std::invalid_argument if the NodeClass cannot support one of the NodeInterfaces in interfaces.
std::bad_alloc if memory allocation fails.

Implemented in ScriptNodeClass, GroupClass, AnchorClass, AppearanceClass, AudioClipClass, BackgroundClass, BillboardClass, BoxClass, CollisionClass, ColorClass, ColorInterpolatorClass, ConeClass, CoordinateClass, CoordinateInterpolatorClass, CylinderClass, CylinderSensorClass, DirectionalLightClass, ElevationGridClass, ExtrusionClass, FogClass, FontStyleClass, ImageTextureClass, IndexedFaceSetClass, IndexedLineSetClass, InlineClass, LODClass, MaterialClass, MovieTextureClass, NavigationInfoClass, NormalClass, NormalInterpolatorClass, OrientationInterpolatorClass, PixelTextureClass, PlaneSensorClass, PointLightClass, PointSetClass, PositionInterpolatorClass, ProximitySensorClass, ScalarInterpolatorClass, ShapeClass, SoundClass, SphereClass, SphereSensorClass, SpotLightClass, SwitchClass, TextClass, TextureCoordinateClass, TextureTransformClass, TimeSensorClass, TouchSensorClass, TransformClass, ViewpointClass, VisibilitySensorClass, and WorldInfoClass.

void initialize double    time throw () [virtual]
 

NodeClass-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:
time the current time.

Reimplemented in BackgroundClass, and FogClass.

void render Viewer   viewer throw () [virtual]
 

NodeClass-specific rendering.

The default implementation of this method does nothing.

Parameters:
viewer the Viewer to render to.

Reimplemented in BackgroundClass, and FogClass.


Member Data Documentation

Browser & browser
 

The Browser associated with this NodeClass.