Public Member Functions | Static Public Member Functions | Properties

CC3NodeVisitor Class Reference

A CC3NodeVisitor is a context object that is passed to a node when it is visited during a traversal of the node hierarchy. More...

#import <CC3NodeVisitor.h>

Inheritance diagram for CC3NodeVisitor:
Inheritance graph
[legend]

List of all members.

Public Member Functions

(void) - close
(id) - initWithWorld:
(void) - open

Static Public Member Functions

(id) + visitor
(id) + visitorWithWorld:

Properties

CC3PerformanceStatisticsperformanceStatistics
BOOL shouldVisitChildren
CC3Worldworld

Detailed Description

A CC3NodeVisitor is a context object that is passed to a node when it is visited during a traversal of the node hierarchy.

The traversal of the node structural hierarchy is handled by the node, using contextual information contained in the visitor. The visitor encapsulates the CC3World, so that nodes have access to other nodes within their world.

The visitor class may also determine some or all of the activities that will occur during the traversal of the node hierarchy.

This base implementation does nothing. Subclasses can perform specialized functions when visiting the nodes, such as drawing, updating, or selecting nodes.


Member Function Documentation

- (void) close

Invoked automatically after visiting the last node during a visitation run.

This method is invoked automatically after all nodes have been visited. It is not invoked for each node visited.

Default implementation does nothing. Subclasses can override to clean up their state, or to reset any external state, such as GL state, upon completion of a visitation run.

- (id) initWithWorld: (CC3World *)  theWorld

Initializes this instance with the specified CC3World.

- (void) open

Invoked automatically prior to the first node being visited during a visitation run.

This method is invoked automatically once before visiting any nodes. It is not invoked for each node visited.

Default implementation does nothing. Subclasses can override to initialize their state, or to set any external state needed, such as GL state, prior to starting a visitation run.

+ (id) visitor

Allocates and initializes an autoreleased instance without a CC3World.

+ (id) visitorWithWorld: (CC3World *)  theWorld

Allocates and initializes an autoreleased instance with the specified CC3World.


Property Documentation

- (CC3PerformanceStatistics *) performanceStatistics [read, assign]

The performanceStatistics being accumulated by the CC3World.

This is extracted from the CC3World, and may be nil if the world is not collecting statistics.

- (BOOL) shouldVisitChildren [read, write, assign]

Indicates whether nodes should propagate visits to their children.

The default initial value is YES.

- (CC3World *) world [read, write, retain]

The CC3World that the node is part of.

Each node can interact with other nodes in the 3D world, through this property.

The requirement for encapsulating the world is determined by the subclass. Some subclasses may not need access to the CC3World.


The documentation for this class was generated from the following file: