Home | Download | Screen shots | Discussion | Documentation | Links |
---|
Inheritance diagram for Node:
Public Types | |
typedef std::list< Route > | RouteList |
typedef std::list< Node * > | NodePath |
Public Methods | |
virtual | ~Node ()=0 throw () |
Destructor. | |
const std::string | getId () const |
Retrieve the nodeId of this node. | |
void | setId (const std::string &nodeId) |
Set the nodeId of the node. | |
const ScopePtr & | getScope () const throw () |
Scene * | getScene () const throw () |
std::ostream & | print (std::ostream &out, size_t indent) const |
bool | accept (NodeVisitor &visitor) |
Accept a visitor. | |
void | resetVisitedFlag () throw () |
Recursively set the visited flag to false for this node and its children. | |
void | addEventOutIS (const std::string &eventOut, PolledEventOutValue &eventOutValue) throw (UnsupportedInterface, std::bad_alloc) |
Add a polled eventOut value. | |
void | initialize (Scene &scene, double timestamp) throw (std::bad_alloc) |
Initialize the Node. | |
void | setField (const std::string &id, const FieldValue &value) throw (UnsupportedInterface, std::bad_cast, std::bad_alloc) |
Generalized field mutator. | |
const FieldValue & | getField (const std::string &id) const throw (UnsupportedInterface) |
Generalized field accessor. | |
void | processEvent (const std::string &id, const FieldValue &value, double timestamp) throw (UnsupportedInterface, std::bad_cast, std::bad_alloc) |
Process an event. | |
const FieldValue & | getEventOut (const std::string &id) const throw (UnsupportedInterface) |
Generalized eventOut accessor. | |
virtual const ScriptNode * | toScript () const throw () |
Cast to a const ScriptNode. | |
virtual ScriptNode * | toScript () throw () |
Cast to a ScriptNode. | |
virtual const AppearanceNode * | toAppearance () const throw () |
Cast to a const AppearanceNode. | |
virtual AppearanceNode * | toAppearance () throw () |
Cast to an AppearanceNode. | |
virtual const ChildNode * | toChild () const throw () |
Cast to a const ChildNode. | |
virtual ChildNode * | toChild () throw () |
Cast to a ChildNode. | |
virtual const ColorNode * | toColor () const throw () |
Cast to a const ColorNode. | |
virtual ColorNode * | toColor () throw () |
Cast to a ColorNode. | |
virtual const CoordinateNode * | toCoordinate () const throw () |
Cast to a const CoordinateNode. | |
virtual CoordinateNode * | toCoordinate () throw () |
Cast to a CoordinateNode. | |
virtual const FontStyleNode * | toFontStyle () const throw () |
Cast to a const FontStyleNode. | |
virtual FontStyleNode * | toFontStyle () throw () |
Cast to a FontStyleNode. | |
virtual const GeometryNode * | toGeometry () const throw () |
Cast to a const GeometryNode. | |
virtual GeometryNode * | toGeometry () throw () |
Cast to a GeometryNode. | |
virtual const MaterialNode * | toMaterial () const throw () |
Cast to a const MaterialNode. | |
virtual MaterialNode * | toMaterial () throw () |
Cast to a MaterialNode. | |
virtual const NormalNode * | toNormal () const throw () |
Cast to a const NormalNode. | |
virtual NormalNode * | toNormal () throw () |
Cast to a NormalNode. | |
virtual const SoundSourceNode * | toSoundSource () const throw () |
Cast to a const SoundSourceNode. | |
virtual SoundSourceNode * | toSoundSource () throw () |
Cast to a SoundSourceNode. | |
virtual const TextureNode * | toTexture () const throw () |
Cast to a const TextureNode. | |
virtual TextureNode * | toTexture () throw () |
Cast to a TextureNode. | |
virtual const TextureCoordinateNode * | toTextureCoordinate () const throw () |
Cast to a const TextureCoordinateNode. | |
virtual TextureCoordinateNode * | toTextureCoordinate () throw () |
Cast to a TextureCoordinateNode. | |
virtual const TextureTransformNode * | toTextureTransform () const throw () |
Cast to a const TextureTransformNode. | |
virtual TextureTransformNode * | toTextureTransform () throw () |
Cast to a TextureTransformNode. | |
virtual Vrml97Node::Anchor * | toAnchor () const |
virtual Vrml97Node::AudioClip * | toAudioClip () const |
virtual Vrml97Node::CylinderSensor * | toCylinderSensor () const |
virtual Vrml97Node::Group * | toGroup () const |
virtual Vrml97Node::AbstractLight * | toLight () const |
virtual Vrml97Node::MovieTexture * | toMovieTexture () const |
virtual Vrml97Node::NavigationInfo * | toNavigationInfo () const |
virtual Vrml97Node::PlaneSensor * | toPlaneSensor () const |
virtual Vrml97Node::PointLight * | toPointLight () const |
virtual Vrml97Node::SphereSensor * | toSphereSensor () const |
virtual Vrml97Node::SpotLight * | toSpotLight () const |
virtual Vrml97Node::TimeSensor * | toTimeSensor () const |
virtual Vrml97Node::TouchSensor * | toTouchSensor () const |
virtual Vrml97Node::Viewpoint * | toViewpoint () const |
void | setModified () |
void | clearModified () |
virtual bool | isModified () const |
Determine whether the node has been modified. | |
virtual void | updateModified (NodePath &path, int flags=0x003) |
Propagate the bvolume dirty flag from children to parents. | |
void | updateModified (int flags=0x003) |
virtual const BVolume * | getBVolume () const |
Get this node's bounding volume. | |
virtual void | setBVolume (const BVolume &v) |
virtual void | setBVolumeDirty (bool f) |
virtual bool | isBVolumeDirty () const |
void | addRoute (const std::string &fromEventOut, const NodePtr &toNode, const std::string &toEventIn) throw (UnsupportedInterface, FieldValueTypeMismatch) |
Add a route from an eventOut of this node to an eventIn of another node. | |
void | deleteRoute (const std::string &fromEventOut, const NodePtr &toNode, const std::string &toEventIn) throw () |
Remove a route from an eventOut of this node to an eventIn of another node. | |
const RouteList & | getRoutes () const |
Get the routes from this node. | |
virtual void | render (Viewer &viewer, VrmlRenderContext context) |
Render this node. | |
virtual void | accumulateTransform (Node *) |
Accumulate transformations for proper rendering of bindable nodes. | |
virtual Node * | getParentTransform () |
Get the nearest ancestor node that affects the modelview transform. | |
virtual void | inverseTransform (VrmlMatrix &) |
Static Public Methods | |
void | markPathModified (NodePath &path, bool mod, int flags=0x003) |
Mark all the nodes in the path as (not) modified. | |
Public Attributes | |
const NodeType & | nodeType |
The type information object for the node. | |
Protected Methods | |
Node (const NodeType &nodeType, const ScopePtr &scope) | |
Constructor. | |
void | emitEvent (const std::string &id, const FieldValue &fieldValue, double timestamp) throw (std::bad_cast, std::bad_alloc) |
Send an event from this node. | |
Protected Attributes | |
bool | d_modified |
bool | d_bvol_dirty |
bool | visited |
Private Types | |
typedef std::map< std::string, PolledEventOutValue * > | EventOutISMap |
Private Methods | |
Node (const Node &) | |
Node & | operator= (const Node &) |
virtual void | initializeImpl (double timestamp) throw (std::bad_alloc) |
Node subclass-specific initialization. | |
virtual void | setFieldImpl (const std::string &id, const FieldValue &value)=0 throw (UnsupportedInterface, std::bad_cast, std::bad_alloc) |
virtual const FieldValue & | getFieldImpl (const std::string &id) const=0 throw (UnsupportedInterface) |
virtual void | processEventImpl (const std::string &id, const FieldValue &value, double timestamp)=0 throw (UnsupportedInterface, std::bad_cast, std::bad_alloc) |
virtual const FieldValue & | getEventOutImpl (const std::string &id) const=0 throw (UnsupportedInterface) |
Private Attributes | |
ScopePtr | scope |
Scene * | scene |
RouteList | routes |
EventOutISMap | eventOutISMap |
Friends | |
std::ostream & | operator<< (std::ostream &out, const Node &node) |
Stream output. |
|
Destructor. Remove node name (if any) from the scope. |
|
Constructor.
|
|
Accept a visitor.
If the node has not been visited, set the visited flag to
The fact that the visited flag is set before the node is actually visited is an important detail. Even though scene graphs should not have cycles, nodes can be self-referencing: a field of a Script node can legally
|
|
Accumulate transformations for proper rendering of bindable nodes. Cache a pointer to one of the parent transforms. The resulting pointer is used by getParentTransform. Grouping nodes need to redefine this, the default implementation does nothing.
Reimplemented in Group, Billboard, Transform, and Viewpoint. |
|
Add a polled eventOut value. Used internally by the PROTO implementation.
|
|
Add a route from an eventOut of this node to an eventIn of another node. If the route being added already exists, this method has no effect.
|
|
Remove a route from an eventOut of this node to an eventIn of another node. If no such route exists, this method has no effect.
|
|
Send an event from this node.
|
|
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 Group, Anchor, Box, IndexedFaceSet, LOD, PointSet, Shape, Sphere, Switch, TimeSensor, Transform, and Viewpoint. |
|
Generalized eventOut accessor.
|
|
Generalized field accessor.
|
|
Retrieve the nodeId of this node.
|
|
Get the nearest ancestor node that affects the modelview transform. Doesn't work for nodes with more than one parent.
Reimplemented in Viewpoint. |
|
Get the routes from this node.
|
|
Initialize the Node.
This method works recursively, initializing any child nodes to the same
|
|
Node subclass-specific initialization. This method is called by Node::initialize. Subclasses of Node should override this method for any subclass-specific initialization. Note that this method cannot throw. The default implementation of this method does nothing.
Reimplemented in ScriptNode, AudioClip, Background, Fog, MovieTexture, NavigationInfo, PointLight, SpotLight, Text, TimeSensor, and Viewpoint. |
|
Compute the inverse of the transform stack above a Viewpoint node. This is safe since the behavior of multi-parented Viewpoint nodes is undefined. May be called at any time.
Reimplemented in Transform. |
|
Return true if the node's bounding volume needs to be recalculated. |
|
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
Reimplemented in AbstractIndexedSet, Group, Appearance, Collision, ElevationGrid, IndexedFaceSet, LOD, PointSet, Shape, Switch, and Text. |
|
Mark all the nodes in the path as (not) modified. Convenience function used by updateModified.
|
|
Process an event.
|
|
Render this node. Actually, most of the rendering work is delegated to the viewer, but this method is responsible for traversal to the node's renderable children, including culling. Each node class needs to implement this routine appropriately. It's not abstract since it doesn't make sense to call render on some nodes. Alternative would be to break render out into a seperate mixins class, but that's probably overkill.
Reimplemented in AbstractGeometry, Group, Anchor, Appearance, Billboard, CylinderSensor, DirectionalLight, ImageTexture, Inline, LOD, MovieTexture, PixelTexture, PlaneSensor, ProximitySensor, Shape, Sound, SphereSensor, Switch, TextureTransform, Transform, and VisibilitySensor. |
|
Recursively set the visited flag to Typically used by a visitor (a class that implements NodeVisitor) after traversal is complete. |
|
Override a node's calculated bounding volume. Not implemented.
|
|
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. |
|
Generalized field mutator.
|
|
Set the nodeId of the node.
|
|
Dirty bit - indicates node needs to be revisited for rendering. |
|
Cast to an AppearanceNode. Default implementation returns 0.
Reimplemented in AppearanceNode. |
|
Cast to a const AppearanceNode. Default implementation returns 0.
Reimplemented in AppearanceNode. |
|
Cast to a ChildNode. Default implementation returns 0.
Reimplemented in ChildNode. |
|
Cast to a const ChildNode. Default implementation returns 0.
Reimplemented in ChildNode. |
|
Cast to a ColorNode. Default implementation returns 0.
Reimplemented in ColorNode. |
|
Cast to a const ColorNode. Default implementation returns 0.
Reimplemented in ColorNode. |
|
Cast to a CoordinateNode. Default implementation returns 0.
Reimplemented in CoordinateNode. |
|
Cast to a const CoordinateNode. Default implementation returns 0.
Reimplemented in CoordinateNode. |
|
Cast to a FontStyleNode. Default implementation returns 0.
Reimplemented in FontStyleNode. |
|
Cast to a const FontStyleNode. Default implementation returns 0.
Reimplemented in FontStyleNode. |
|
Cast to a GeometryNode. Default implementation returns 0.
Reimplemented in GeometryNode. |
|
Cast to a const GeometryNode. Default implementation returns 0.
Reimplemented in GeometryNode. |
|
Cast to a MaterialNode. Default implementation returns 0.
Reimplemented in MaterialNode. |
|
Cast to a const MaterialNode. Default implementation returns 0.
Reimplemented in MaterialNode. |
|
Cast to a NormalNode. Default implementation returns 0.
Reimplemented in NormalNode. |
|
Cast to a const NormalNode. Default implementation returns 0.
Reimplemented in NormalNode. |
|
Cast to a ScriptNode. Default implementation returns 0.
Reimplemented in ScriptNode. |
|
Cast to a const ScriptNode. Default implementation returns 0.
Reimplemented in ScriptNode. |
|
Cast to a SoundSourceNode. Default implementation returns 0.
Reimplemented in SoundSourceNode. |
|
Cast to a const SoundSourceNode. Default implementation returns 0.
Reimplemented in SoundSourceNode. |
|
Cast to a TextureNode. Default implementation returns 0.
Reimplemented in TextureNode. |
|
Cast to a const TextureNode. Default implementation returns 0.
Reimplemented in TextureNode. |
|
Cast to a TextureCoordinateNode. Default implementation returns 0.
Reimplemented in TextureCoordinateNode. |
|
Cast to a const TextureCoordinateNode. Default implementation returns 0.
Reimplemented in TextureCoordinateNode. |
|
Cast to a TextureTransformNode. Default implementation returns 0.
Reimplemented in TextureTransformNode. |
|
Cast to a const TextureTransformNode. Default implementation returns 0.
Reimplemented in TextureTransformNode. |
|
Propagate the bvolume dirty flag from children to parents. I don't like this at all, but it's not worth making it pretty because the need for it will go away when parent pointers are implemented.
Reimplemented in AbstractIndexedSet, Group, Appearance, ElevationGrid, IndexedFaceSet, LOD, PointSet, Shape, Sound, Switch, and Text. |
|
Stream output.
|
|
The type information object for the node.
|