Evaluation Phase

During the evaluation phase, the graph does a topological sort of the subgraph to establish a legal order for evaluating nodes. Topological sorting starts at an active node and proceeds along the edges that are connected to the node.

During the evaluation phase, an active node may be thought of as the generating node for each of its connected edges, while the opposing node on each edge is designated as a receiving node. Evaluation begins with the root node, and proceeds through the nodes as ordered by the topological sort. After the active nodes are evaluated, evaluation continues with the receiving nodes, which then become active nodes for any other edges that connect to them. As each node is evaluated, its evaluate() function is called.

Applications initiate a graph evaluation by calling the AcDbEvalGraph::evaluate() function. This function in turn calls the AcDbEvalExpr::evaluate() function on each activated node in the evaluation path. When calling the AcDbEvalGraph::evaluate() function, an application may pass a reference to an AcDbEvalContext object to provide custom data. The graph then passes the reference to each AcDbEvalExpr::evaluate() function call as it traverses the graph.

The AcDbEvalContext class is simply a container class for application data. It lets applications insert custom data into the evaluation context. It also allows custom nodes to extract the data during the evaluation of the node.