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>
Public Member Functions | |
(void) | - close |
(id) | - initWithWorld: |
(void) | - open |
Static Public Member Functions | |
(id) | + visitor |
(id) | + visitorWithWorld: |
Properties | |
CC3PerformanceStatistics * | performanceStatistics |
BOOL | shouldVisitChildren |
CC3World * | world |
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.
- (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.
- (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.
- (CC3PerformanceStatistics *) performanceStatistics [read, assign] |
- (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] |